I2C_StopTransfer Function

Appendices: P08

Appendices:

I2C_StopTransfer Function

                /****************************************************************************
                 * Function:    void StopTransfer( I2C_MODULE i2c_port )
                 * Summary:     Stops a transfer to/from the EEPROM.\
                 *
                 * Description: This routine Stops a transfer to/from the EEPROM, waiting
                 *              (in a blocking loop) until the Stop condition has completed.
                 *
                 * Precondition: The I2C module must have been initialized & a transfer 
                 *               started.
                 *
                 * Parameters:  i2c_port    - I2C_MODULE
                 * Returns:     None.
                  ***************************************************************************/
                
                void StopTransfer( I2C_MODULE i2c_port )
                {
                I2C_STATUS  i2c_status;
                
                /* Send the STOP sequence */
                    I2CStop(i2c_port);
                
                /* Wait for the STOP sequence to complete */
                    do
                    {
                        i2c_status = I2CGetStatus(i2c_port);
                
                    } while ( !(i2c_status & I2C_STOP) );
                }
                

  • Other product and company names mentioned herein are trademarks or trade names of their respective companies. © 2014 Digilent Inc. All rights reserved.