Download MSP430 Peripheral Driver Library User's Guide
Transcript
EUSCI Inter-Integrated Circuit (I2C) For the interrupt-driven transaction, the user must register an interrupt handler for the I2C devices and enable the I2C interrupt. This driver is contained in driverlib/5xx_6xx/ei2c.c, with driverlib/5xx_6xx/ei2c.h containing the API definitions for use by applications. 16.2 API Functions The eUSCI I2C API is broken into three groups of functions: those that deal with interrupts, those that handle status and initialization, and those that deal with sending and receiving data. The I2C master and slave interrupts are handled by eI2C_enableInterrupt eI2C_disableInterrupt eI2C_clearInterruptFlag eI2C_getInterruptStatus Status and initialization functions for the I2C modules are eI2C_masterInit eI2C_enable eI2C_disable eI2C_isBusBusy eI2C_isBusy eI2C_slaveInit eI2C_interruptStatus eI2C_setSlaveAddress eI2C_setMode eI2C_masterIsSTOPSent eI2C_selectMasterEnvironmentSelect Sending and receiving data from the I2C slave module is handled by eI2C_slaveDataPut eI2C_slaveDataGet Sending and receiving data from the I2C slave module is handled by eI2C_masterSendSingleByte eI2C_masterSendStart eI2C_masterMultiByteSendStart eI2C_masterMultiByteSendNext eI2C_masterMultiByteSendFinish eI2C_masterMultiByteSendStop eI2C_masterMultiByteReceiveNext 2012-08-281 4 : 58 : 17− 0500 51 TI Information–Selective Disclosure