Data Structures | Macros | Functions
I2C

eUSCI Inter-Integrated Circuit (I2C) serial communication module. More...

Data Structures

struct  eUSCI_I2C_MasterConfig
 
struct  _eUSCI_I2C_MasterConfig
 Type definition for _eUSCI_I2C_MasterConfig structure. More...
 

Macros

#define EUSCI_B_I2C_NO_AUTO_STOP   EUSCI_B_CTLW1_ASTP_0
 
#define EUSCI_B_I2C_SET_BYTECOUNT_THRESHOLD_FLAG   EUSCI_B_CTLW1_ASTP_1
 
#define EUSCI_B_I2C_SEND_STOP_AUTOMATICALLY_ON_BYTECOUNT_THRESHOLD   EUSCI_B_CTLW1_ASTP_2
 
#define EUSCI_B_I2C_SET_DATA_RATE_1MBPS   1000000
 
#define EUSCI_B_I2C_SET_DATA_RATE_400KBPS   400000
 
#define EUSCI_B_I2C_SET_DATA_RATE_100KBPS   100000
 
#define EUSCI_B_I2C_CLOCKSOURCE_ACLK   EUSCI_B_CTLW0_SSEL__ACLK
 
#define EUSCI_B_I2C_CLOCKSOURCE_SMCLK   EUSCI_B_CTLW0_SSEL__SMCLK
 
#define EUSCI_B_I2C_OWN_ADDRESS_OFFSET0   0x00
 
#define EUSCI_B_I2C_OWN_ADDRESS_OFFSET1   0x02
 
#define EUSCI_B_I2C_OWN_ADDRESS_OFFSET2   0x04
 
#define EUSCI_B_I2C_OWN_ADDRESS_OFFSET3   0x06
 
#define EUSCI_B_I2C_OWN_ADDRESS_DISABLE   0x00
 
#define EUSCI_B_I2C_OWN_ADDRESS_ENABLE   EUSCI_B_I2COA0_OAEN
 
#define EUSCI_B_I2C_TRANSMIT_MODE   EUSCI_B_CTLW0_TR
 
#define EUSCI_B_I2C_RECEIVE_MODE   0x00
 
#define EUSCI_B_I2C_NAK_INTERRUPT   EUSCI_B_IE_NACKIE
 
#define EUSCI_B_I2C_ARBITRATIONLOST_INTERRUPT   EUSCI_B_IE_ALIE
 
#define EUSCI_B_I2C_STOP_INTERRUPT   EUSCI_B_IE_STPIE
 
#define EUSCI_B_I2C_START_INTERRUPT   EUSCI_B_IE_STTIE
 
#define EUSCI_B_I2C_TRANSMIT_INTERRUPT0   EUSCI_B_IE_TXIE0
 
#define EUSCI_B_I2C_TRANSMIT_INTERRUPT1   EUSCI_B_IE_TXIE1
 
#define EUSCI_B_I2C_TRANSMIT_INTERRUPT2   EUSCI_B_IE_TXIE2
 
#define EUSCI_B_I2C_TRANSMIT_INTERRUPT3   EUSCI_B_IE_TXIE3
 
#define EUSCI_B_I2C_RECEIVE_INTERRUPT0   EUSCI_B_IE_RXIE0
 
#define EUSCI_B_I2C_RECEIVE_INTERRUPT1   EUSCI_B_IE_RXIE1
 
#define EUSCI_B_I2C_RECEIVE_INTERRUPT2   EUSCI_B_IE_RXIE2
 
#define EUSCI_B_I2C_RECEIVE_INTERRUPT3   EUSCI_B_IE_RXIE3
 
#define EUSCI_B_I2C_BIT9_POSITION_INTERRUPT   EUSCI_B_IE_BIT9IE
 
#define EUSCI_B_I2C_CLOCK_LOW_TIMEOUT_INTERRUPT   EUSCI_B_IE_CLTOIE
 
#define EUSCI_B_I2C_BYTE_COUNTER_INTERRUPT   EUSCI_B_IE_BCNTIE
 
#define EUSCI_B_I2C_BUS_BUSY   EUSCI_B_STATW_BBUSY
 
#define EUSCI_B_I2C_BUS_NOT_BUSY   0x00
 
#define EUSCI_B_I2C_STOP_SEND_COMPLETE   0x00
 
#define EUSCI_B_I2C_SENDING_STOP   EUSCI_B_CTLW0_TXSTP
 
#define EUSCI_B_I2C_START_SEND_COMPLETE   0x00
 
#define EUSCI_B_I2C_SENDING_START   EUSCI_B_CTLW0_TXSTT
 
#define EUSCI_B_I2C_slaveInit   I2C_initSlave
 
#define EUSCI_B_I2C_enable   I2C_enableModule
 
#define EUSCI_B_I2C_disable   I2C_disableModule
 
#define EUSCI_B_I2C_setSlaveAddress   I2C_setSlaveAddress
 
#define EUSCI_B_I2C_setMode   I2C_setMode
 
#define EUSCI_B_I2C_getMode   I2C_getMode
 
#define EUSCI_B_I2C_slaveDataPut   I2C_slavePutData
 
#define EUSCI_B_I2C_slaveDataGet   I2C_slaveGetData
 
#define EUSCI_B_I2C_isBusBusy   I2C_isBusBusy
 
#define EUSCI_B_I2C_masterIsStopSent   I2C_masterIsStopSent
 
#define EUSCI_B_I2C_masterIsStartSent   I2C_masterIsStartSent
 
#define EUSCI_B_I2C_enableInterrupt   I2C_enableInterrupt
 
#define EUSCI_B_I2C_disableInterrupt   I2C_disableInterrupt
 
#define EUSCI_B_I2C_clearInterruptFlag   I2C_clearInterruptFlag
 
#define EUSCI_B_I2C_getInterruptStatus   I2C_getEnabledInterruptStatus
 
#define EUSCI_B_I2C_masterSendSingleByte   I2C_masterSendSingleByte
 
#define EUSCI_B_I2C_masterReceiveSingleByte   I2C_masterReceiveSingleByte
 
#define EUSCI_B_I2C_masterSendSingleByteWithTimeout   I2C_masterSendSingleByteWithTimeout
 
#define EUSCI_B_I2C_masterMultiByteSendStart   I2C_masterSendMultiByteStart
 
#define EUSCI_B_I2C_masterMultiByteSendStartWithTimeout   I2C_masterSendMultiByteStartWithTimeout
 
#define EUSCI_B_I2C_masterMultiByteSendNext   I2C_masterSendMultiByteNext
 
#define EUSCI_B_I2C_masterMultiByteSendNextWithTimeout   I2C_masterSendMultiByteNextWithTimeout
 
#define EUSCI_B_I2C_masterMultiByteSendFinish   I2C_masterSendMultiByteFinish
 
#define EUSCI_B_I2C_masterMultiByteSendFinishWithTimeout   I2C_masterSendMultiByteFinishWithTimeout
 
#define EUSCI_B_I2C_masterSendStart   I2C_masterSendStart
 
#define EUSCI_B_I2C_masterMultiByteSendStop   I2C_masterSendMultiByteStop
 
#define EUSCI_B_I2C_masterMultiByteSendStopWithTimeout   I2C_masterSendMultiByteStopWithTimeout
 
#define EUSCI_B_I2C_masterReceiveStart   I2C_masterReceiveStart
 
#define EUSCI_B_I2C_masterMultiByteReceiveNext   I2C_masterReceiveMultiByteNext
 
#define EUSCI_B_I2C_masterMultiByteReceiveFinish   I2C_masterReceiveMultiByteFinish
 
#define EUSCI_B_I2C_masterMultiByteReceiveFinishWithTimeout   I2C_masterReceiveMultiByteFinishWithTimeout
 
#define EUSCI_B_I2C_masterMultiByteReceiveStop   I2C_masterReceiveMultiByteStop
 
#define EUSCI_B_I2C_enableMultiMasterMode   I2C_enableMultiMasterMode
 
#define EUSCI_B_I2C_disableMultiMasterMode   I2C_disableMultiMasterMode
 
#define EUSCI_B_I2C_masterSingleReceive   I2C_masterReceiveSingle
 
#define EUSCI_B_I2C_getReceiveBufferAddressForDMA   I2C_getReceiveBufferAddressForDMA
 
#define EUSCI_B_I2C_getTransmitBufferAddressForDMA   I2C_getTransmitBufferAddressForDMA
 

Functions

void I2C_initMaster (uint32_t moduleInstance, const eUSCI_I2C_MasterConfig *config)
 
void I2C_initSlave (uint32_t moduleInstance, uint_fast16_t slaveAddress, uint_fast8_t slaveAddressOffset, uint32_t slaveOwnAddressEnable)
 
void I2C_enableModule (uint32_t moduleInstance)
 
void I2C_disableModule (uint32_t moduleInstance)
 
void I2C_setSlaveAddress (uint32_t moduleInstance, uint_fast16_t slaveAddress)
 
void I2C_setMode (uint32_t moduleInstance, uint_fast8_t mode)
 
uint_fast8_t I2C_getMode (uint32_t moduleInstance)
 Gets the mode of the I2C device. More...
 
void I2C_slavePutData (uint32_t moduleInstance, uint8_t transmitData)
 
uint8_t I2C_slaveGetData (uint32_t moduleInstance)
 
uint8_t I2C_isBusBusy (uint32_t moduleInstance)
 
void I2C_masterSendSingleByte (uint32_t moduleInstance, uint8_t txData)
 
bool I2C_masterSendSingleByteWithTimeout (uint32_t moduleInstance, uint8_t txData, uint32_t timeout)
 
void I2C_masterSendMultiByteStart (uint32_t moduleInstance, uint8_t txData)
 
bool I2C_masterSendMultiByteStartWithTimeout (uint32_t moduleInstance, uint8_t txData, uint32_t timeout)
 
void I2C_masterSendMultiByteNext (uint32_t moduleInstance, uint8_t txData)
 
bool I2C_masterSendMultiByteNextWithTimeout (uint32_t moduleInstance, uint8_t txData, uint32_t timeout)
 
void I2C_masterSendMultiByteFinish (uint32_t moduleInstance, uint8_t txData)
 
bool I2C_masterSendMultiByteFinishWithTimeout (uint32_t moduleInstance, uint8_t txData, uint32_t timeout)
 
void I2C_masterSendMultiByteStop (uint32_t moduleInstance)
 
bool I2C_masterSendMultiByteStopWithTimeout (uint32_t moduleInstance, uint32_t timeout)
 
void I2C_masterReceiveStart (uint32_t moduleInstance)
 
uint8_t I2C_masterReceiveMultiByteNext (uint32_t moduleInstance)
 
uint8_t I2C_masterReceiveMultiByteFinish (uint32_t moduleInstance)
 
bool I2C_masterReceiveMultiByteFinishWithTimeout (uint32_t moduleInstance, uint8_t *txData, uint32_t timeout)
 
void I2C_masterReceiveMultiByteStop (uint32_t moduleInstance)
 
uint8_t I2C_masterReceiveSingleByte (uint32_t moduleInstance)
 
uint8_t I2C_masterReceiveSingle (uint32_t moduleInstance)
 
uint32_t I2C_getReceiveBufferAddressForDMA (uint32_t moduleInstance)
 
uint32_t I2C_getTransmitBufferAddressForDMA (uint32_t moduleInstance)
 
uint8_t I2C_masterIsStopSent (uint32_t moduleInstance)
 
bool I2C_masterIsStartSent (uint32_t moduleInstance)
 
void I2C_masterSendStart (uint32_t moduleInstance)
 
void I2C_enableMultiMasterMode (uint32_t moduleInstance)
 
void I2C_disableMultiMasterMode (uint32_t moduleInstance)
 
void I2C_enableInterrupt (uint32_t moduleInstance, uint_fast16_t mask)
 
void I2C_disableInterrupt (uint32_t moduleInstance, uint_fast16_t mask)
 
void I2C_clearInterruptFlag (uint32_t moduleInstance, uint_fast16_t mask)
 
uint_fast16_t I2C_getInterruptStatus (uint32_t moduleInstance, uint16_t mask)
 
uint_fast16_t I2C_getEnabledInterruptStatus (uint32_t moduleInstance)
 
void I2C_registerInterrupt (uint32_t moduleInstance, void(*intHandler)(void))
 
void I2C_unregisterInterrupt (uint32_t moduleInstance)
 
void I2C_slaveSendNAK (uint32_t moduleInstance)
 

Detailed Description

eUSCI Inter-Integrated Circuit (I2C) serial communication module.


I2C (eUSCI_B) Module Operation


In I2C mode, the eUSCI_B module provides an interface between the device and I2C-compatible devices connected by the two-wire I2C serial bus. External components attached to the I2C bus serially transmit and/or receive serial data to/from the eUSCI_B module through the 2-wire I2C interface. The Inter-Integrated Circuit (I2C) API provides a set of functions for using the MSPWare I2C modules. Functions are provided to initialize the I2C modules, to send and receive data, obtain status, and to manage interrupts for the I2C modules. For the sake of simplicity and code readability, the EUSCI_B module name has been omitted from the API name space.

The I2C module provide the ability to communicate to other IC devices over an I2C bus. The I2C bus is specified to support devices that can both transmit and receive (write and read) data. Also, devices on the I2C bus can be designated as either a master or a slave. The MSPWare L I2C modules support both sending and receiving data as either a master or a slave, and also support the simultaneous operation as both a master and a slave.

I2C module can generate interrupts. The I2C module configured as a master will generate interrupts when a transmit or receive operation is completed (or aborted due to an error). The I2C module configured as a slave will generate interrupts when data has been sent or requested by a master.


Master Operation


To drive the master module, the APIs need to be invoked in the following order

The user must first initialize the I2C module and configure it as a master with a call to I2C_initMaster . That function will set the clock and data rates. This is followed by a call to set the slave address with which the master intends to communicate with using I2C_setSlaveAddress . Then the mode of operation (transmit or receive) is chosen using I2C_setMode . The I2C module may now be enabled using I2C_enableModule . It is recommended to enable the I2C module before enabling the interrupts. Any transmission or reception of data may be initiated at this point after interrupts are enabled (if any).

The transaction can then be initiated on the bus by calling the transmit or receive related APIs as listed below.

Master Single Byte Transmission

Master Multiple Byte Transmission

Master Single Byte Reception

Master Multiple Byte Reception

For the interrupt-driven transaction, the user must register an interrupt handler for the I2C devices and enable the I2C interrupt.


Slave Operation


To drive the slave module, the APIs need to be invoked in the following order

The user must first call the I2C_initSlave to initialize the slave module in I2C mode and set the slave address. This is followed by a call to set the mode of operation (transmit or receive). The I2C module may now be enabled using I2C_enableModule . It is recommended to enable the I2C module before enabling the interrupts. Any transmission or reception of data may be initiated at this point after interrupts are enabled (if any).

The transaction can then be initiated on the bus by calling the transmit or receive related APIs as listed below.

Slave Transmission API

Slave Reception API

For the interrupt-driven transaction, the user must register an interrupt handler for the I2C devices and enable the I2C interrupt.


Timeout Parameters


For serial transmission APIs (sending/receiving), a "timeout" API exists that will return control of execution back to the user application if a specified duration passes. The variable that is passed into these functions is a unit of time specified by how many "loop iterations" elapse before unsuccessful transmission of data.


Programming Examples


The DriverLib package contains a variety of different code examples that demonstrate the usage of the I2C module. These code examples are accessible under the examples/ folder of the MSPWare release as well as through TI Resource Explorer if using Code Composer Studio. These code examples provide a comprehensive list of use cases as well as practical applications involving each module.

Below is a simple example of how to setup the I2C module for master operation with a 400KHz clock.

First, below is an example of setting up the I2C module configuration structure:

/* I2C Master Configuration Parameter */
const eUSCI_I2C_MasterConfig i2cConfig =
{
EUSCI_B_I2C_CLOCKSOURCE_SMCLK, // SMCLK Clock Source
3000000, // SMCLK = 3MHz
EUSCI_B_I2C_SET_DATA_RATE_400KBPS, // Desired I2C Clock of 400khz
0, // No byte counter threshold
EUSCI_B_I2C_NO_AUTO_STOP // No Autostop
};

Below are the actual DriverLib calls to configure/setup the I2C module:

/* Initializing I2C Master to SMCLK at 400kbs with no autostop */
MAP_I2C_initMaster(EUSCI_B0_BASE, &i2cConfig);
/* Specify slave address */
MAP_I2C_setSlaveAddress(EUSCI_B0_BASE, SLAVE_ADDRESS);
/* Set Master in transmit mode */
/* Enable I2C Module to start operations */
MAP_I2C_enableModule(EUSCI_B0_BASE);
/* Enable and clear the interrupt flag */
/* Enable master transmit interrupt */
MAP_I2C_enableInterrupt(EUSCI_B0_BASE,

Macro Definition Documentation

#define EUSCI_B_I2C_NO_AUTO_STOP   EUSCI_B_CTLW1_ASTP_0

Referenced by I2C_initMaster().

#define EUSCI_B_I2C_SET_BYTECOUNT_THRESHOLD_FLAG   EUSCI_B_CTLW1_ASTP_1

Referenced by I2C_initMaster().

#define EUSCI_B_I2C_SEND_STOP_AUTOMATICALLY_ON_BYTECOUNT_THRESHOLD   EUSCI_B_CTLW1_ASTP_2

Referenced by I2C_initMaster().

#define EUSCI_B_I2C_SET_DATA_RATE_1MBPS   1000000

Referenced by I2C_initMaster().

#define EUSCI_B_I2C_SET_DATA_RATE_400KBPS   400000

Referenced by I2C_initMaster().

#define EUSCI_B_I2C_SET_DATA_RATE_100KBPS   100000

Referenced by I2C_initMaster().

#define EUSCI_B_I2C_CLOCKSOURCE_ACLK   EUSCI_B_CTLW0_SSEL__ACLK

Referenced by I2C_initMaster().

#define EUSCI_B_I2C_CLOCKSOURCE_SMCLK   EUSCI_B_CTLW0_SSEL__SMCLK

Referenced by I2C_initMaster().

#define EUSCI_B_I2C_OWN_ADDRESS_OFFSET0   0x00

Referenced by I2C_initSlave().

#define EUSCI_B_I2C_OWN_ADDRESS_OFFSET1   0x02

Referenced by I2C_initSlave().

#define EUSCI_B_I2C_OWN_ADDRESS_OFFSET2   0x04

Referenced by I2C_initSlave().

#define EUSCI_B_I2C_OWN_ADDRESS_OFFSET3   0x06

Referenced by I2C_initSlave().

#define EUSCI_B_I2C_OWN_ADDRESS_DISABLE   0x00
#define EUSCI_B_I2C_OWN_ADDRESS_ENABLE   EUSCI_B_I2COA0_OAEN
#define EUSCI_B_I2C_TRANSMIT_MODE   EUSCI_B_CTLW0_TR

Referenced by I2C_setMode().

#define EUSCI_B_I2C_RECEIVE_MODE   0x00

Referenced by I2C_setMode().

#define EUSCI_B_I2C_NAK_INTERRUPT   EUSCI_B_IE_NACKIE
#define EUSCI_B_I2C_ARBITRATIONLOST_INTERRUPT   EUSCI_B_IE_ALIE
#define EUSCI_B_I2C_STOP_INTERRUPT   EUSCI_B_IE_STPIE
#define EUSCI_B_I2C_START_INTERRUPT   EUSCI_B_IE_STTIE
#define EUSCI_B_I2C_TRANSMIT_INTERRUPT0   EUSCI_B_IE_TXIE0
#define EUSCI_B_I2C_TRANSMIT_INTERRUPT1   EUSCI_B_IE_TXIE1
#define EUSCI_B_I2C_TRANSMIT_INTERRUPT2   EUSCI_B_IE_TXIE2
#define EUSCI_B_I2C_TRANSMIT_INTERRUPT3   EUSCI_B_IE_TXIE3
#define EUSCI_B_I2C_RECEIVE_INTERRUPT0   EUSCI_B_IE_RXIE0
#define EUSCI_B_I2C_RECEIVE_INTERRUPT1   EUSCI_B_IE_RXIE1
#define EUSCI_B_I2C_RECEIVE_INTERRUPT2   EUSCI_B_IE_RXIE2
#define EUSCI_B_I2C_RECEIVE_INTERRUPT3   EUSCI_B_IE_RXIE3
#define EUSCI_B_I2C_BIT9_POSITION_INTERRUPT   EUSCI_B_IE_BIT9IE
#define EUSCI_B_I2C_CLOCK_LOW_TIMEOUT_INTERRUPT   EUSCI_B_IE_CLTOIE
#define EUSCI_B_I2C_BYTE_COUNTER_INTERRUPT   EUSCI_B_IE_BCNTIE
#define EUSCI_B_I2C_BUS_BUSY   EUSCI_B_STATW_BBUSY
#define EUSCI_B_I2C_BUS_NOT_BUSY   0x00
#define EUSCI_B_I2C_STOP_SEND_COMPLETE   0x00
#define EUSCI_B_I2C_SENDING_STOP   EUSCI_B_CTLW0_TXSTP
#define EUSCI_B_I2C_START_SEND_COMPLETE   0x00
#define EUSCI_B_I2C_SENDING_START   EUSCI_B_CTLW0_TXSTT
#define EUSCI_B_I2C_slaveInit   I2C_initSlave
#define EUSCI_B_I2C_enable   I2C_enableModule
#define EUSCI_B_I2C_disable   I2C_disableModule
#define EUSCI_B_I2C_setSlaveAddress   I2C_setSlaveAddress
#define EUSCI_B_I2C_setMode   I2C_setMode
#define EUSCI_B_I2C_getMode   I2C_getMode
#define EUSCI_B_I2C_slaveDataPut   I2C_slavePutData
#define EUSCI_B_I2C_slaveDataGet   I2C_slaveGetData
#define EUSCI_B_I2C_isBusBusy   I2C_isBusBusy
#define EUSCI_B_I2C_masterIsStopSent   I2C_masterIsStopSent
#define EUSCI_B_I2C_masterIsStartSent   I2C_masterIsStartSent
#define EUSCI_B_I2C_enableInterrupt   I2C_enableInterrupt
#define EUSCI_B_I2C_disableInterrupt   I2C_disableInterrupt
#define EUSCI_B_I2C_clearInterruptFlag   I2C_clearInterruptFlag
#define EUSCI_B_I2C_getInterruptStatus   I2C_getEnabledInterruptStatus
#define EUSCI_B_I2C_masterSendSingleByte   I2C_masterSendSingleByte
#define EUSCI_B_I2C_masterReceiveSingleByte   I2C_masterReceiveSingleByte
#define EUSCI_B_I2C_masterSendSingleByteWithTimeout   I2C_masterSendSingleByteWithTimeout
#define EUSCI_B_I2C_masterMultiByteSendStart   I2C_masterSendMultiByteStart
#define EUSCI_B_I2C_masterMultiByteSendStartWithTimeout   I2C_masterSendMultiByteStartWithTimeout
#define EUSCI_B_I2C_masterMultiByteSendNext   I2C_masterSendMultiByteNext
#define EUSCI_B_I2C_masterMultiByteSendNextWithTimeout   I2C_masterSendMultiByteNextWithTimeout
#define EUSCI_B_I2C_masterMultiByteSendFinish   I2C_masterSendMultiByteFinish
#define EUSCI_B_I2C_masterMultiByteSendFinishWithTimeout   I2C_masterSendMultiByteFinishWithTimeout
#define EUSCI_B_I2C_masterSendStart   I2C_masterSendStart
#define EUSCI_B_I2C_masterMultiByteSendStop   I2C_masterSendMultiByteStop
#define EUSCI_B_I2C_masterMultiByteSendStopWithTimeout   I2C_masterSendMultiByteStopWithTimeout
#define EUSCI_B_I2C_masterReceiveStart   I2C_masterReceiveStart
#define EUSCI_B_I2C_masterMultiByteReceiveNext   I2C_masterReceiveMultiByteNext
#define EUSCI_B_I2C_masterMultiByteReceiveFinish   I2C_masterReceiveMultiByteFinish
#define EUSCI_B_I2C_masterMultiByteReceiveFinishWithTimeout   I2C_masterReceiveMultiByteFinishWithTimeout
#define EUSCI_B_I2C_masterMultiByteReceiveStop   I2C_masterReceiveMultiByteStop
#define EUSCI_B_I2C_enableMultiMasterMode   I2C_enableMultiMasterMode
#define EUSCI_B_I2C_disableMultiMasterMode   I2C_disableMultiMasterMode
#define EUSCI_B_I2C_masterSingleReceive   I2C_masterReceiveSingle
#define EUSCI_B_I2C_getReceiveBufferAddressForDMA   I2C_getReceiveBufferAddressForDMA
#define EUSCI_B_I2C_getTransmitBufferAddressForDMA   I2C_getTransmitBufferAddressForDMA

Function Documentation

void I2C_initMaster ( uint32_t  moduleInstance,
const eUSCI_I2C_MasterConfig config 
)

Initializes the I2C Master block.

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.
configConfiguration structure for I2C master mode

Configuration options for eUSCI_I2C_MasterConfig structure.


Parameters
selectClockSourceis the clock source. Valid values are
  • EUSCI_B_I2C_CLOCKSOURCE_ACLK
  • EUSCI_B_I2C_CLOCKSOURCE_SMCLK
i2cClkis the rate of the clock supplied to the I2C module (the frequency in Hz of the clock source specified in selectClockSource).
dataRateset up for selecting data transfer rate. Valid values are
  • EUSCI_B_I2C_SET_DATA_RATE_1MBPS
  • EUSCI_B_I2C_SET_DATA_RATE_400KBPS
  • EUSCI_B_I2C_SET_DATA_RATE_100KBPS
byteCounterThresholdsets threshold for automatic STOP or UCSTPIFG
autoSTOPGenerationsets up the STOP condition generation. Valid values are
  • EUSCI_B_I2C_NO_AUTO_STOP
  • EUSCI_B_I2C_SET_BYTECOUNT_THRESHOLD_FLAG
  • EUSCI_B_I2C_SEND_STOP_AUTOMATICALLY_ON_BYTECOUNT_THRESHOLD

This function initializes operation of the I2C Master block. Upon successful initialization of the I2C block, this function will have set the bus speed for the master; however I2C module is still disabled till I2C_enableModule is invoked

Modified bits are UCMST,UCMODE_3,UCSYNC of UCBxCTL0 register UCSSELx, UCSWRST, of UCBxCTL1 register UCBxBR0 and UCBxBR1 registers

Returns
None.

References ASSERT, eUSCI_I2C_MasterConfig::autoSTOPGeneration, eUSCI_I2C_MasterConfig::byteCounterThreshold, eUSCI_I2C_MasterConfig::dataRate, EUSCI_B_CMSIS, EUSCI_B_I2C_CLOCKSOURCE_ACLK, EUSCI_B_I2C_CLOCKSOURCE_SMCLK, EUSCI_B_I2C_NO_AUTO_STOP, EUSCI_B_I2C_SEND_STOP_AUTOMATICALLY_ON_BYTECOUNT_THRESHOLD, EUSCI_B_I2C_SET_BYTECOUNT_THRESHOLD_FLAG, EUSCI_B_I2C_SET_DATA_RATE_100KBPS, EUSCI_B_I2C_SET_DATA_RATE_1MBPS, EUSCI_B_I2C_SET_DATA_RATE_400KBPS, eUSCI_I2C_MasterConfig::i2cClk, and eUSCI_I2C_MasterConfig::selectClockSource.

void I2C_initSlave ( uint32_t  moduleInstance,
uint_fast16_t  slaveAddress,
uint_fast8_t  slaveAddressOffset,
uint32_t  slaveOwnAddressEnable 
)

Initializes the I2C Slave block.

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.
slaveAddress7-bit or 10-bit slave address
slaveAddressOffsetOwn address Offset referred to- 'x' value of UCBxI2COAx. Valid values are:
  • EUSCI_B_I2C_OWN_ADDRESS_OFFSET0,
  • EUSCI_B_I2C_OWN_ADDRESS_OFFSET1,
  • EUSCI_B_I2C_OWN_ADDRESS_OFFSET2,
  • EUSCI_B_I2C_OWN_ADDRESS_OFFSET3
slaveOwnAddressEnableselects if the specified address is enabled or disabled. Valid values are:
  • EUSCI_B_I2C_OWN_ADDRESS_DISABLE,
  • EUSCI_B_I2C_OWN_ADDRESS_ENABLE

This function initializes operation of the I2C as a Slave mode. Upon successful initialization of the I2C blocks, this function will have set the slave address but the I2C module is still disabled till I2C_enableModule is invoked.

The parameter slaveAddress is the value that will be compared against the slave address sent by an I2C master.

Modified bits are UCMODE_3, UCSYNC of UCBxCTL0 register UCSWRST of UCBxCTL1 register UCBxI2COA register

Returns
None.

References ASSERT, EUSCI_B_CMSIS, EUSCI_B_I2C_OWN_ADDRESS_OFFSET0, EUSCI_B_I2C_OWN_ADDRESS_OFFSET1, EUSCI_B_I2C_OWN_ADDRESS_OFFSET2, EUSCI_B_I2C_OWN_ADDRESS_OFFSET3, and HWREG16.

void I2C_enableModule ( uint32_t  moduleInstance)

Enables the I2C block.

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.

This will enable operation of the I2C block. Modified bits are UCSWRST of UCBxCTL1 register.

Returns
None.

References EUSCI_B_CMSIS.

void I2C_disableModule ( uint32_t  moduleInstance)

Disables the I2C block.

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.

This will disable operation of the I2C block. Modified bits are UCSWRST of UCBxCTL1 register.

Returns
None.

References EUSCI_B_CMSIS.

void I2C_setSlaveAddress ( uint32_t  moduleInstance,
uint_fast16_t  slaveAddress 
)

Sets the address that the I2C Master will place on the bus.

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.
slaveAddress7-bit or 10-bit slave address

This function will set the address that the I2C Master will place on the bus when initiating a transaction. Modified register is UCBxI2CSA register

Returns
None.

References EUSCI_B_CMSIS.

void I2C_setMode ( uint32_t  moduleInstance,
uint_fast8_t  mode 
)

Sets the mode of the I2C device

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.
modeindicates whether module is in transmit/receive mode
  • EUSCI_B_I2C_TRANSMIT_MODE
  • EUSCI_B_I2C_RECEIVE_MODE [Default value]

Modified bits are UCTR of UCBxCTL1 register

Returns
None.

References ASSERT, EUSCI_B_CMSIS, EUSCI_B_I2C_RECEIVE_MODE, and EUSCI_B_I2C_TRANSMIT_MODE.

uint_fast8_t I2C_getMode ( uint32_t  moduleInstance)

Gets the mode of the I2C device.

Current I2C transmit/receive mode.

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.

Modified bits are UCTR of UCBxCTL1 register.

Returns
None Return one of the following:
  • EUSCI_B_I2C_TRANSMIT_MODE
  • EUSCI_B_I2C_RECEIVE_MODE
    indicating the current mode

References EUSCI_B_CMSIS.

void I2C_slavePutData ( uint32_t  moduleInstance,
uint8_t  transmitData 
)

Transmits a byte from the I2C Module.

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.
transmitDatadata to be transmitted from the I2C module

This function will place the supplied data into I2C transmit data register to start transmission Modified register is UCBxTXBUF register

Returns
None.

References EUSCI_B_CMSIS.

uint8_t I2C_slaveGetData ( uint32_t  moduleInstance)

Receives a byte that has been sent to the I2C Module.

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.

This function reads a byte of data from the I2C receive data Register.

Returns
Returns the byte received from by the I2C module, cast as an uint8_t. Modified bit is UCBxRXBUF register

References EUSCI_B_CMSIS.

uint8_t I2C_isBusBusy ( uint32_t  moduleInstance)

Indicates whether or not the I2C bus is busy.

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.

This function returns an indication of whether or not the I2C bus is busy.This function checks the status of the bus via UCBBUSY bit in UCBxSTAT register.

Returns
Returns EUSCI_B_I2C_BUS_BUSY if the I2C Master is busy; otherwise, returns EUSCI_B_I2C_BUS_NOT_BUSY.

References EUSCI_B_CMSIS.

void I2C_masterSendSingleByte ( uint32_t  moduleInstance,
uint8_t  txData 
)

Does single byte transmission from Master to Slave

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.
txDatais the data byte to be transmitted

This function is used by the Master module to send a single byte. This function

  • Sends START
  • Transmits the byte to the Slave
  • Sends STOP

Modified registers are UCBxIE, UCBxCTL1, UCBxIFG, UCBxTXBUF, UCBxIE

Returns
none

References EUSCI_B_CMSIS.

bool I2C_masterSendSingleByteWithTimeout ( uint32_t  moduleInstance,
uint8_t  txData,
uint32_t  timeout 
)

Does single byte transmission from Master to Slave with timeout

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.
txDatais the data byte to be transmitted
timeoutis the amount of time to wait until giving up

This function is used by the Master module to send a single byte. This function

  • Sends START
  • Transmits the byte to the Slave
  • Sends STOP

Modified registers are UCBxIE, UCBxCTL1, UCBxIFG, UCBxTXBUF, UCBxIE

Returns
0x01 or 0x00URE of the transmission process.

References ASSERT, and EUSCI_B_CMSIS.

void I2C_masterSendMultiByteStart ( uint32_t  moduleInstance,
uint8_t  txData 
)

Starts multi-byte transmission from Master to Slave

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.
txDatais the first data byte to be transmitted

This function is used by the Master module to send a single byte. This function

  • Sends START
  • Transmits the first data byte of a multi-byte transmission to the Slave

Modified registers are UCBxIE, UCBxCTL1, UCBxIFG, UCBxTXBUF, UCBxIE

Returns
None.

References EUSCI_B_CMSIS.

bool I2C_masterSendMultiByteStartWithTimeout ( uint32_t  moduleInstance,
uint8_t  txData,
uint32_t  timeout 
)

Starts multi-byte transmission from Master to Slave with timeout

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.
txDatais the first data byte to be transmitted
timeoutis the amount of time to wait until giving up

This function is used by the Master module to send a single byte. This function

  • Sends START
  • Transmits the first data byte of a multi-byte transmission to the Slave

Modified registers are UCBxIE, UCBxCTL1, UCBxIFG, UCBxTXBUF, UCBxIE

Returns
0x01 or 0x00URE of the transmission process.

References ASSERT, and EUSCI_B_CMSIS.

void I2C_masterSendMultiByteNext ( uint32_t  moduleInstance,
uint8_t  txData 
)

Continues multi-byte transmission from Master to Slave

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.
txDatais the next data byte to be transmitted

This function is used by the Master module continue each byte of a multi-byte trasmission. This function

  • Transmits each data byte of a multi-byte transmission to the Slave

Modified registers are UCBxTXBUF

Returns
None.

References EUSCI_B_CMSIS.

bool I2C_masterSendMultiByteNextWithTimeout ( uint32_t  moduleInstance,
uint8_t  txData,
uint32_t  timeout 
)

Continues multi-byte transmission from Master to Slave with timeout

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.
txDatais the next data byte to be transmitted
timeoutis the amount of time to wait until giving up

This function is used by the Master module continue each byte of a multi-byte transmission. This function

  • Transmits each data byte of a multi-byte transmission to the Slave

Modified registers are UCBxTXBUF

Returns
0x01 or 0x00URE of the transmission process.

References ASSERT, and EUSCI_B_CMSIS.

void I2C_masterSendMultiByteFinish ( uint32_t  moduleInstance,
uint8_t  txData 
)

Finishes multi-byte transmission from Master to Slave

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.
txDatais the last data byte to be transmitted in a multi-byte transmsission

This function is used by the Master module to send the last byte and STOP. This function

  • Transmits the last data byte of a multi-byte transmission to the Slave
  • Sends STOP

Modified registers are UCBxTXBUF and UCBxCTL1.

Returns
None.

References EUSCI_B_CMSIS.

bool I2C_masterSendMultiByteFinishWithTimeout ( uint32_t  moduleInstance,
uint8_t  txData,
uint32_t  timeout 
)

Finishes multi-byte transmission from Master to Slave with timeout

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.
txDatais the last data byte to be transmitted in a multi-byte transmission
timeoutis the amount of time to wait until giving up

This function is used by the Master module to send the last byte and STOP. This function

  • Transmits the last data byte of a multi-byte transmission to the Slave
  • Sends STOP

Modified registers are UCBxTXBUF and UCBxCTL1.

Returns
0x01 or 0x00URE of the transmission process.

References ASSERT, and EUSCI_B_CMSIS.

void I2C_masterSendMultiByteStop ( uint32_t  moduleInstance)

Send STOP byte at the end of a multi-byte transmission from Master to Slave

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.

This function is used by the Master module send STOP at the end of a multi-byte transmission

This function

  • Send a STOP after current transmission is complete

Modified bits are UCTXSTP bit of UCBxCTL1.

Returns
None.

References EUSCI_B_CMSIS.

bool I2C_masterSendMultiByteStopWithTimeout ( uint32_t  moduleInstance,
uint32_t  timeout 
)

Send STOP byte at the end of a multi-byte transmission from Master to Slave with timeout

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.
timeoutis the amount of time to wait until giving up

This function is used by the Master module send STOP at the end of a multi-byte transmission

This function

  • Send a STOP after current transmission is complete

Modified bits are UCTXSTP bit of UCBxCTL1.

Returns
0x01 or 0x00URE of the transmission process.

References ASSERT, and EUSCI_B_CMSIS.

void I2C_masterReceiveStart ( uint32_t  moduleInstance)

Starts reception at the Master end

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.

This function is used by the Master module initiate reception of a single byte. This function

  • Sends START

Modified bits are UCTXSTT bit of UCBxCTL1.

Returns
None.

References EUSCI_B_CMSIS.

uint8_t I2C_masterReceiveMultiByteNext ( uint32_t  moduleInstance)

Starts multi-byte reception at the Master end one byte at a time

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.

This function is used by the Master module to receive each byte of a multi-byte reception This function reads currently received byte

Modified register is UCBxRXBUF.

Returns
Received byte at Master end.

References EUSCI_B_CMSIS.

uint8_t I2C_masterReceiveMultiByteFinish ( uint32_t  moduleInstance)

Finishes multi-byte reception at the Master end

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.

This function is used by the Master module to initiate completion of a multi-byte reception This function

  • Receives the current byte and initiates the STOP from Master to Slave

Modified bits are UCTXSTP bit of UCBxCTL1.

Returns
Received byte at Master end.

References EUSCI_B_CMSIS.

bool I2C_masterReceiveMultiByteFinishWithTimeout ( uint32_t  moduleInstance,
uint8_t *  txData,
uint32_t  timeout 
)

Finishes multi-byte reception at the Master end with timeout

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.
txDatais a pointer to the location to store the received byte at master end
timeoutis the amount of time to wait until giving up

This function is used by the Master module to initiate completion of a multi-byte reception This function

  • Receives the current byte and initiates the STOP from Master to Slave

Modified bits are UCTXSTP bit of UCBxCTL1.

Returns
0x01 or 0x00URE of the transmission process.

References ASSERT, and EUSCI_B_CMSIS.

void I2C_masterReceiveMultiByteStop ( uint32_t  moduleInstance)

Sends the STOP at the end of a multi-byte reception at the Master end

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.

This function is used by the Master module to initiate STOP

Modified bits are UCTXSTP bit of UCBxCTL1.

Returns
None.

References EUSCI_B_CMSIS.

uint8_t I2C_masterReceiveSingleByte ( uint32_t  moduleInstance)

Does single byte reception from the slave

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.

This function is used by the Master module to receive a single byte. This function:

  • Sends START and STOP
  • Waits for data reception
  • Receives one byte from the Slave

Modified registers are UCBxIE, UCBxCTL1, UCBxIFG, UCBxTXBUF, UCBxIE

Returns
The byte that has been received from the slave

References EUSCI_B_CMSIS.

uint8_t I2C_masterReceiveSingle ( uint32_t  moduleInstance)

Receives a byte that has been sent to the I2C Master Module.

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.

This function reads a byte of data from the I2C receive data Register.

Returns
Returns the byte received from by the I2C module, cast as an uint8_t.

References EUSCI_B_CMSIS.

uint32_t I2C_getReceiveBufferAddressForDMA ( uint32_t  moduleInstance)

Returns the address of the RX Buffer of the I2C for the DMA module.

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.

Returns the address of the I2C RX Buffer. This can be used in conjunction with the DMA to store the received data directly to memory.

Returns
NONE

References EUSCI_B_CMSIS.

uint32_t I2C_getTransmitBufferAddressForDMA ( uint32_t  moduleInstance)

Returns the address of the TX Buffer of the I2C for the DMA module.

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.

Returns the address of the I2C TX Buffer. This can be used in conjunction with the DMA to obtain transmitted data directly from memory.

Returns
NONE

References EUSCI_B_CMSIS.

uint8_t I2C_masterIsStopSent ( uint32_t  moduleInstance)

Indicates whether STOP got sent.

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.

This function returns an indication of whether or not STOP got sent This function checks the status of the bus via UCTXSTP bit in UCBxCTL1 register.

Returns
Returns EUSCI_B_I2C_STOP_SEND_COMPLETE if the I2C Master finished sending STOP; otherwise, returns EUSCI_B_I2C_SENDING_STOP.

References EUSCI_B_CMSIS.

bool I2C_masterIsStartSent ( uint32_t  moduleInstance)

Indicates whether Start got sent.

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.

This function returns an indication of whether or not Start got sent This function checks the status of the bus via UCTXSTT bit in UCBxCTL1 register.

Returns
Returns true if the START has been sent, false if it is sending

References EUSCI_B_CMSIS.

void I2C_masterSendStart ( uint32_t  moduleInstance)

This function is used by the Master module to initiate START

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.

This function is used by the Master module to initiate STOP

Modified bits are UCTXSTT bit of UCBxCTLW0.

Returns
None.

References EUSCI_B_CMSIS.

void I2C_enableMultiMasterMode ( uint32_t  moduleInstance)

Enables Multi Master Mode

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.

At the end of this function, the I2C module is still disabled till I2C_enableModule is invoked

Modified bits are UCSWRST of OFS_UCBxCTLW0, UCMM bit of UCBxCTLW0

Returns
None.

References EUSCI_B_CMSIS.

void I2C_disableMultiMasterMode ( uint32_t  moduleInstance)

Disables Multi Master Mode

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.

At the end of this function, the I2C module is still disabled till I2C_enableModule is invoked

Modified bits are UCSWRST of OFS_UCBxCTLW0, UCMM bit of UCBxCTLW0

Returns
None.

References EUSCI_B_CMSIS.

void I2C_enableInterrupt ( uint32_t  moduleInstance,
uint_fast16_t  mask 
)

Enables individual I2C interrupt sources.

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.
maskis the bit mask of the interrupt sources to be enabled.

Enables the indicated I2C interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.

The mask parameter is the logical OR of any of the following:

  • EUSCI_B_I2C_STOP_INTERRUPT - STOP condition interrupt
  • EUSCI_B_I2C_START_INTERRUPT - START condition interrupt
  • EUSCI_B_I2C_TRANSMIT_INTERRUPT0 - Transmit interrupt0
  • EUSCI_B_I2C_TRANSMIT_INTERRUPT1 - Transmit interrupt1
  • EUSCI_B_I2C_TRANSMIT_INTERRUPT2 - Transmit interrupt2
  • EUSCI_B_I2C_TRANSMIT_INTERRUPT3 - Transmit interrupt3
  • EUSCI_B_I2C_RECEIVE_INTERRUPT0 - Receive interrupt0
  • EUSCI_B_I2C_RECEIVE_INTERRUPT1 - Receive interrupt1
  • EUSCI_B_I2C_RECEIVE_INTERRUPT2 - Receive interrupt2
  • EUSCI_B_I2C_RECEIVE_INTERRUPT3 - Receive interrupt3
  • EUSCI_B_I2C_NAK_INTERRUPT - Not-acknowledge interrupt
  • EUSCI_B_I2C_ARBITRATIONLOST_INTERRUPT - Arbitration lost interrupt
  • EUSCI_B_I2C_BIT9_POSITION_INTERRUPT - Bit position 9 interrupt enable
  • EUSCI_B_I2C_CLOCK_LOW_TIMEOUT_INTERRUPT - Clock low timeout interrupt enable
  • EUSCI_B_I2C_BYTE_COUNTER_INTERRUPT - Byte counter interrupt enable

Modified registers are UCBxIFG and OFS_UCBxIE.

Returns
None.

References ASSERT, EUSCI_B_CMSIS, EUSCI_B_I2C_ARBITRATIONLOST_INTERRUPT, EUSCI_B_I2C_BIT9_POSITION_INTERRUPT, EUSCI_B_I2C_BYTE_COUNTER_INTERRUPT, EUSCI_B_I2C_CLOCK_LOW_TIMEOUT_INTERRUPT, EUSCI_B_I2C_NAK_INTERRUPT, EUSCI_B_I2C_RECEIVE_INTERRUPT0, EUSCI_B_I2C_RECEIVE_INTERRUPT1, EUSCI_B_I2C_RECEIVE_INTERRUPT2, EUSCI_B_I2C_RECEIVE_INTERRUPT3, EUSCI_B_I2C_START_INTERRUPT, EUSCI_B_I2C_STOP_INTERRUPT, EUSCI_B_I2C_TRANSMIT_INTERRUPT0, EUSCI_B_I2C_TRANSMIT_INTERRUPT1, EUSCI_B_I2C_TRANSMIT_INTERRUPT2, and EUSCI_B_I2C_TRANSMIT_INTERRUPT3.

void I2C_disableInterrupt ( uint32_t  moduleInstance,
uint_fast16_t  mask 
)

Disables individual I2C interrupt sources.

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.
maskis the bit mask of the interrupt sources to be disabled.

Disables the indicated I2C interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.

The mask parameter is the logical OR of any of the following:

  • EUSCI_B_I2C_STOP_INTERRUPT - STOP condition interrupt
  • EUSCI_B_I2C_START_INTERRUPT - START condition interrupt
  • EUSCI_B_I2C_TRANSMIT_INTERRUPT0 - Transmit interrupt0
  • EUSCI_B_I2C_TRANSMIT_INTERRUPT1 - Transmit interrupt1
  • EUSCI_B_I2C_TRANSMIT_INTERRUPT2 - Transmit interrupt2
  • EUSCI_B_I2C_TRANSMIT_INTERRUPT3 - Transmit interrupt3
  • EUSCI_B_I2C_RECEIVE_INTERRUPT0 - Receive interrupt0
  • EUSCI_B_I2C_RECEIVE_INTERRUPT1 - Receive interrupt1
  • EUSCI_B_I2C_RECEIVE_INTERRUPT2 - Receive interrupt2
  • EUSCI_B_I2C_RECEIVE_INTERRUPT3 - Receive interrupt3
  • EUSCI_B_I2C_NAK_INTERRUPT - Not-acknowledge interrupt
  • EUSCI_B_I2C_ARBITRATIONLOST_INTERRUPT - Arbitration lost interrupt
  • EUSCI_B_I2C_BIT9_POSITION_INTERRUPT - Bit position 9 interrupt enable
  • EUSCI_B_I2C_CLOCK_LOW_TIMEOUT_INTERRUPT - Clock low timeout interrupt enable
  • EUSCI_B_I2C_BYTE_COUNTER_INTERRUPT - Byte counter interrupt enable

Modified register is UCBxIE.

Returns
None.

References ASSERT, EUSCI_B_CMSIS, EUSCI_B_I2C_ARBITRATIONLOST_INTERRUPT, EUSCI_B_I2C_BIT9_POSITION_INTERRUPT, EUSCI_B_I2C_BYTE_COUNTER_INTERRUPT, EUSCI_B_I2C_CLOCK_LOW_TIMEOUT_INTERRUPT, EUSCI_B_I2C_NAK_INTERRUPT, EUSCI_B_I2C_RECEIVE_INTERRUPT0, EUSCI_B_I2C_RECEIVE_INTERRUPT1, EUSCI_B_I2C_RECEIVE_INTERRUPT2, EUSCI_B_I2C_RECEIVE_INTERRUPT3, EUSCI_B_I2C_START_INTERRUPT, EUSCI_B_I2C_STOP_INTERRUPT, EUSCI_B_I2C_TRANSMIT_INTERRUPT0, EUSCI_B_I2C_TRANSMIT_INTERRUPT1, EUSCI_B_I2C_TRANSMIT_INTERRUPT2, and EUSCI_B_I2C_TRANSMIT_INTERRUPT3.

void I2C_clearInterruptFlag ( uint32_t  moduleInstance,
uint_fast16_t  mask 
)

Clears I2C interrupt sources.

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.
maskis a bit mask of the interrupt sources to be cleared.

The I2C interrupt source is cleared, so that it no longer asserts. The highest interrupt flag is automatically cleared when an interrupt vector generator is used.

The mask parameter has the same definition as the mask parameter to I2C_enableInterrupt().

Modified register is UCBxIFG.

Returns
None.

References ASSERT, EUSCI_B_CMSIS, EUSCI_B_I2C_ARBITRATIONLOST_INTERRUPT, EUSCI_B_I2C_BIT9_POSITION_INTERRUPT, EUSCI_B_I2C_BYTE_COUNTER_INTERRUPT, EUSCI_B_I2C_CLOCK_LOW_TIMEOUT_INTERRUPT, EUSCI_B_I2C_NAK_INTERRUPT, EUSCI_B_I2C_RECEIVE_INTERRUPT0, EUSCI_B_I2C_RECEIVE_INTERRUPT1, EUSCI_B_I2C_RECEIVE_INTERRUPT2, EUSCI_B_I2C_RECEIVE_INTERRUPT3, EUSCI_B_I2C_START_INTERRUPT, EUSCI_B_I2C_STOP_INTERRUPT, EUSCI_B_I2C_TRANSMIT_INTERRUPT0, EUSCI_B_I2C_TRANSMIT_INTERRUPT1, EUSCI_B_I2C_TRANSMIT_INTERRUPT2, and EUSCI_B_I2C_TRANSMIT_INTERRUPT3.

uint_fast16_t I2C_getInterruptStatus ( uint32_t  moduleInstance,
uint16_t  mask 
)

Gets the current I2C interrupt status.

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.
maskis the masked interrupt flag status to be returned. Mask value is the logical OR of any of the following:
  • EUSCI_B_I2C_NAK_INTERRUPT - Not-acknowledge interrupt
  • EUSCI_B_I2C_ARBITRATIONLOST_INTERRUPT - Arbitration lost interrupt
  • EUSCI_B_I2C_STOP_INTERRUPT - STOP condition interrupt
  • EUSCI_B_I2C_START_INTERRUPT - START condition interrupt
  • EUSCI_B_I2C_TRANSMIT_INTERRUPT0 - Transmit interrupt0
  • EUSCI_B_I2C_TRANSMIT_INTERRUPT1 - Transmit interrupt1
  • EUSCI_B_I2C_TRANSMIT_INTERRUPT2 - Transmit interrupt2
  • EUSCI_B_I2C_TRANSMIT_INTERRUPT3 - Transmit interrupt3
  • EUSCI_B_I2C_RECEIVE_INTERRUPT0 - Receive interrupt0
  • EUSCI_B_I2C_RECEIVE_INTERRUPT1 - Receive interrupt1
  • EUSCI_B_I2C_RECEIVE_INTERRUPT2 - Receive interrupt2
  • EUSCI_B_I2C_RECEIVE_INTERRUPT3 - Receive interrupt3
  • EUSCI_B_I2C_BIT9_POSITION_INTERRUPT - Bit position 9 interrupt
  • EUSCI_B_I2C_CLOCK_LOW_TIMEOUT_INTERRUPT - Clock low timeout interrupt enable
  • EUSCI_B_I2C_BYTE_COUNTER_INTERRUPT - Byte counter interrupt enable
Returns
the masked status of the interrupt flag
  • EUSCI_B_I2C_STOP_INTERRUPT - STOP condition interrupt
  • EUSCI_B_I2C_START_INTERRUPT - START condition interrupt
  • EUSCI_B_I2C_TRANSMIT_INTERRUPT0 - Transmit interrupt0
  • EUSCI_B_I2C_TRANSMIT_INTERRUPT1 - Transmit interrupt1
  • EUSCI_B_I2C_TRANSMIT_INTERRUPT2 - Transmit interrupt2
  • EUSCI_B_I2C_TRANSMIT_INTERRUPT3 - Transmit interrupt3
  • EUSCI_B_I2C_RECEIVE_INTERRUPT0 - Receive interrupt0
  • EUSCI_B_I2C_RECEIVE_INTERRUPT1 - Receive interrupt1
  • EUSCI_B_I2C_RECEIVE_INTERRUPT2 - Receive interrupt2
  • EUSCI_B_I2C_RECEIVE_INTERRUPT3 - Receive interrupt3
  • EUSCI_B_I2C_NAK_INTERRUPT - Not-acknowledge interrupt
  • EUSCI_B_I2C_ARBITRATIONLOST_INTERRUPT - Arbitration lost interrupt
  • EUSCI_B_I2C_BIT9_POSITION_INTERRUPT - Bit position 9 interrupt enable
  • EUSCI_B_I2C_CLOCK_LOW_TIMEOUT_INTERRUPT - Clock low timeout interrupt enable
  • EUSCI_B_I2C_BYTE_COUNTER_INTERRUPT - Byte counter interrupt enable

References ASSERT, EUSCI_B_CMSIS, EUSCI_B_I2C_ARBITRATIONLOST_INTERRUPT, EUSCI_B_I2C_BIT9_POSITION_INTERRUPT, EUSCI_B_I2C_BYTE_COUNTER_INTERRUPT, EUSCI_B_I2C_CLOCK_LOW_TIMEOUT_INTERRUPT, EUSCI_B_I2C_NAK_INTERRUPT, EUSCI_B_I2C_RECEIVE_INTERRUPT0, EUSCI_B_I2C_RECEIVE_INTERRUPT1, EUSCI_B_I2C_RECEIVE_INTERRUPT2, EUSCI_B_I2C_RECEIVE_INTERRUPT3, EUSCI_B_I2C_START_INTERRUPT, EUSCI_B_I2C_STOP_INTERRUPT, EUSCI_B_I2C_TRANSMIT_INTERRUPT0, EUSCI_B_I2C_TRANSMIT_INTERRUPT1, EUSCI_B_I2C_TRANSMIT_INTERRUPT2, and EUSCI_B_I2C_TRANSMIT_INTERRUPT3.

Referenced by I2C_getEnabledInterruptStatus().

uint_fast16_t I2C_getEnabledInterruptStatus ( uint32_t  moduleInstance)

Gets the current I2C interrupt status masked with the enabled interrupts. This function is useful to call in ISRs to get a list of pending interrupts that are actually enabled and could have caused the ISR.

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.
Returns
the masked status of the interrupt flag
  • EUSCI_B_I2C_STOP_INTERRUPT - STOP condition interrupt
  • EUSCI_B_I2C_START_INTERRUPT - START condition interrupt
  • EUSCI_B_I2C_TRANSMIT_INTERRUPT0 - Transmit interrupt0
  • EUSCI_B_I2C_TRANSMIT_INTERRUPT1 - Transmit interrupt1
  • EUSCI_B_I2C_TRANSMIT_INTERRUPT2 - Transmit interrupt2
  • EUSCI_B_I2C_TRANSMIT_INTERRUPT3 - Transmit interrupt3
  • EUSCI_B_I2C_RECEIVE_INTERRUPT0 - Receive interrupt0
  • EUSCI_B_I2C_RECEIVE_INTERRUPT1 - Receive interrupt1
  • EUSCI_B_I2C_RECEIVE_INTERRUPT2 - Receive interrupt2
  • EUSCI_B_I2C_RECEIVE_INTERRUPT3 - Receive interrupt3
  • EUSCI_B_I2C_NAK_INTERRUPT - Not-acknowledge interrupt
  • EUSCI_B_I2C_ARBITRATIONLOST_INTERRUPT - Arbitration lost interrupt
  • EUSCI_B_I2C_BIT9_POSITION_INTERRUPT - Bit position 9 interrupt enable
  • EUSCI_B_I2C_CLOCK_LOW_TIMEOUT_INTERRUPT - Clock low timeout interrupt enable
  • EUSCI_B_I2C_BYTE_COUNTER_INTERRUPT - Byte counter interrupt enable

References EUSCI_B_CMSIS, and I2C_getInterruptStatus().

void I2C_registerInterrupt ( uint32_t  moduleInstance,
void(*)(void)  intHandler 
)

Registers an interrupt handler for I2C interrupts.

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.
intHandleris a pointer to the function to be called when the timer capture compare interrupt occurs.

This function registers the handler to be called when an I2C interrupt occurs. This function enables the global interrupt in the interrupt controller; specific I2C interrupts must be enabled via I2C_enableInterrupt(). It is the interrupt handler's responsibility to clear the interrupt source via I2C_clearInterruptFlag().

See also
Interrupt_registerInterrupt() for important information about registering interrupt handlers.
Returns
None.

References ASSERT, INT_EUSCIB0, INT_EUSCIB1, INT_EUSCIB2, INT_EUSCIB3, Interrupt_enableInterrupt(), and Interrupt_registerInterrupt().

void I2C_unregisterInterrupt ( uint32_t  moduleInstance)

Unregisters the interrupt handler for the timer

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.

This function unregisters the handler to be called when timer interrupt occurs. This function also masks off the interrupt in the interrupt controller so that the interrupt handler no longer is called.

See also
Interrupt_registerInterrupt() for important information about registering interrupt handlers.
Returns
None.

References ASSERT, INT_EUSCIB0, INT_EUSCIB1, INT_EUSCIB2, INT_EUSCIB3, Interrupt_disableInterrupt(), and Interrupt_unregisterInterrupt().

void I2C_slaveSendNAK ( uint32_t  moduleInstance)

This function is used by the slave to send a NAK out over the I2C line

Parameters
moduleInstanceis the instance of the eUSCI B (I2C) module. Valid parameters vary from part to part, but can include:
  • EUSCI_B0_BASE
  • EUSCI_B1_BASE
  • EUSCI_B2_BASE
  • EUSCI_B3_BASE
    It is important to note that for eUSCI modules, only "B" modules such as EUSCI_B0 can be used. "A" modules such as EUSCI_A0 do not support the I2C mode.
Returns
None.

References EUSCI_B_CMSIS.


Copyright 2016, Texas Instruments Incorporated