|
Functions | |
| void | I2CMasterInit (unsigned long ulBase, unsigned long ulI2CClk) |
| Set the clock rate of the specified I2C port. | |
| xtBoolean | I2CMasterTransfer (unsigned long ulBase, tI2CMasterTransferCfg *tCfg, unsigned long ulOption) |
| Transmit and Receive data in master mode of the specified I2C port. | |
| xtBoolean | I2CSlaveTransfer (unsigned long ulBase, tI2CSlaveTransferCfg *tCfg, unsigned long ulOption) |
| Transmit and Receive data in slave mode of the specified I2C port. | |
| xtBoolean | I2CMasterTransferComplete (unsigned long ulBase) |
| Check Transfer of Master is complete or not. | |
| xtBoolean | I2CSlaveTransferComplete (unsigned long ulBase) |
| Check Slave of Master is complete or not. | |
| void | I2CMasterHandler (unsigned long ulBase) |
| General Master Interrupt handler for I2C peripheral. | |
| void | I2CSlaveHandler (unsigned long ulBase) |
| General slave Interrupt handler for I2C peripheral. | |
| void | I2CIntCallbackInit (unsigned long ulBase, xtEventCallback xtI2CCallback) |
| initialize interrupts callback for the specified Port. | |
| void | I2CDisable (unsigned long ulBase) |
| Disable I2C module of the specified I2C port. | |
| void | I2CEnable (unsigned long ulBase) |
| Enable I2C module of the specified I2C port. | |
| unsigned long | I2CStatusGet (unsigned long ulBase) |
| Get I2C status of the specified I2C port. | |
| void | I2CSlaveInit (unsigned long ulBase, unsigned char ucSlaveAddr, unsigned long ulGeneralCall) |
| Set the clock rate of the specified I2C port. | |
| void | I2CSlaveOwnAddressSet (unsigned long ulBase, unsigned char ucSlaveNum, unsigned char ucSlaveAddr, unsigned long ulGeneralCall) |
| Set the slave address of the specified I2C port. | |
| void | I2CSlaveOwnAddressMaskSet (unsigned long ulBase, unsigned char ucSlaveNum, unsigned char ucSlaveAddrMask) |
| Set 4 7-bit slave address mask of the specified I2C port. | |
| void | I2CIntFlagClear (unsigned long ulBase) |
| Clear the I2C interrupt flag of the specified I2C port. | |
| void | I2CTimeoutFlagClear (unsigned long ulBase) |
| Clear the I2C time out flag of the specified I2C port. | |
| void | I2CTimeoutCounterSet (unsigned long ulBase, unsigned long ulEnable, unsigned long ulDiv4) |
| Enable/Disable I2C 14-bit timeout counter of the specified I2C port. | |
| xtBoolean | I2CIntFlagGet (unsigned long ulBase) |
| Get the I2C interrupt flag of the specified I2C port. | |
| xtBoolean | I2CTimeoutFlagGet (unsigned long ulBase) |
| Get the I2C time out flag of the specified I2C port. | |
| void | I2CIntDisable (unsigned long ulBase) |
| Disable I2C interrupt of the specified I2C port. | |
| void | I2CIntEnable (unsigned long ulBase) |
| Enable I2C interrupt of the specified I2C port. | |
| void I2CMasterInit | ( | unsigned long | ulBase, |
| unsigned long | ulI2CClk | ||
| ) |
Set the clock rate of the specified I2C port.
| ulBase | specifies the I2C module base address. |
| ulI2CClk | specifies the I2C clock rate. |
This function is to initialize and set the clock rate specified I2C port.
The ulBase must be:I2C0_BASE.
The ulI2CClk is the I2C clock rate.
Definition at line 924 of file xi2c.c.
References I2C0_BASE, I2C_CON_ENS1, I2C_O_CLK, I2C_O_CON, SYSCTL_PERIPH_I2C0, SysCtlHClockGet(), SysCtlPeripheralReset(), xASSERT, and xHWREG.

| xtBoolean I2CMasterTransfer | ( | unsigned long | ulBase, |
| tI2CMasterTransferCfg * | tCfg, | ||
| unsigned long | ulOption | ||
| ) |
Transmit and Receive data in master mode of the specified I2C port.
| ulBase | specifies the I2C module base address. |
| tCfg | specifies Pointer to a I2C_M_SETUP_Type structure that contains specified information about the configuration for master transfer. |
| ulOption | specifies interrupt or polling mode. |
This function is to Transmit and Receive data in master mode of specified I2C port.
The ulBase must be: I2C0_BASE.
The tCfg is the I2C Master transfer setup data structure
Definition at line 980 of file xi2c.c.
References I2C0_BASE, I2C_CON_SI, I2C_CON_STA, I2C_I2STAT_M_RX_DAT_ACK, I2C_I2STAT_M_RX_DAT_NACK, I2C_I2STAT_M_RX_SLAR_ACK, I2C_I2STAT_M_TX_DAT_ACK, I2C_I2STAT_M_TX_RESTART, I2C_I2STAT_M_TX_SLAW_ACK, I2C_I2STAT_M_TX_START, I2C_O_CON, I2C_TRANSFER_INTERRUPT, I2C_TRANSFER_POLLING, I2CIntEnable(), tI2CMasterTransferCfg::pvRBuf, tI2CMasterTransferCfg::pvWBuf, tI2CConfig::ulDir, tI2CMasterTransferCfg::ulRCount, tI2CMasterTransferCfg::ulRLen, tI2CConfig::ulSetup, tI2CMasterTransferCfg::ulSlave, tI2CMasterTransferCfg::ulWCount, tI2CMasterTransferCfg::ulWLen, xASSERT, xfalse, xHWREG, and xtrue.

| xtBoolean I2CSlaveTransfer | ( | unsigned long | ulBase, |
| tI2CSlaveTransferCfg * | tCfg, | ||
| unsigned long | ulOption | ||
| ) |
Transmit and Receive data in slave mode of the specified I2C port.
| ulBase | specifies the I2C module base address. |
| tCfg | specifies Pointer to a I2C_M_SETUP_Type structure that contains specified information about the configuration for slave transfer. |
| ulOption | specifies interrupt or polling mode. |
This function is to Transmit and Receive data in slave mode of specified I2C port.
The ulBase must be:I2C0_BASE.
The tCfg is the I2C slave transfer setup data structure definitions.
Definition at line 1307 of file xi2c.c.
References I2C0_BASE, I2C_CON_AA, I2C_CON_SI, I2C_I2STAT_NO_INF, I2C_I2STAT_S_RX_GENCALL_ACK, I2C_I2STAT_S_RX_PRE_GENCALL_DAT_ACK, I2C_I2STAT_S_RX_PRE_GENCALL_DAT_NACK, I2C_I2STAT_S_RX_PRE_SLA_DAT_ACK, I2C_I2STAT_S_RX_PRE_SLA_DAT_NACK, I2C_I2STAT_S_RX_SLAW_ACK, I2C_I2STAT_S_RX_STA_STO_SLVREC_SLVTRX, I2C_I2STAT_S_TX_DAT_ACK, I2C_I2STAT_S_TX_DAT_NACK, I2C_I2STAT_S_TX_SLAR_ACK, I2C_O_CON, I2C_O_DAT, I2C_O_STATUS, I2C_STATUS_M, I2C_TRANSFER_INTERRUPT, I2C_TRANSFER_POLLING, I2CIntEnable(), tI2CSlaveTransferCfg::pvRBuf, tI2CSlaveTransferCfg::pvWBuf, tI2CConfig::ulDir, tI2CSlaveTransferCfg::ulRCount, tI2CSlaveTransferCfg::ulRLen, tI2CConfig::ulSetup, tI2CSlaveTransferCfg::ulWCount, tI2CSlaveTransferCfg::ulWLen, xASSERT, xfalse, xHWREG, and xtrue.

| xtBoolean I2CMasterTransferComplete | ( | unsigned long | ulBase | ) |
Check Transfer of Master is complete or not.
| ulBase | specifies the I2C module base address. |
This function is to get status of Master Transfer
The ulBase must be:I2C0_BASE.
Definition at line 1192 of file xi2c.c.
References xfalse.
| xtBoolean I2CSlaveTransferComplete | ( | unsigned long | ulBase | ) |
Check Slave of Master is complete or not.
| ulBase | specifies the I2C module base address. |
This function is to get status of slave Transfer
The ulBase must be:I2C0_BASE.
Definition at line 1219 of file xi2c.c.
References xfalse.
| void I2CMasterHandler | ( | unsigned long | ulBase | ) |
General Master Interrupt handler for I2C peripheral.
| ulBase | specifies the I2C module base address. |
This function is to give a general Master Interrupt handler for I2C peripheral.
The ulBase must be:I2C0_BASE.
Definition at line 376 of file xi2c.c.
References tI2CConfig::g_pfnI2CHandlerCallbacks, I2C0_BASE, I2C_CON_AA, I2C_CON_SI, I2C_CON_STA, I2C_DAT_DATA_M, I2C_I2STAT_M_RX_DAT_ACK, I2C_I2STAT_M_RX_DAT_NACK, I2C_I2STAT_M_RX_SLAR_ACK, I2C_I2STAT_M_RX_SLAR_NACK, I2C_I2STAT_M_TX_ARB_LOST, I2C_I2STAT_M_TX_DAT_ACK, I2C_I2STAT_M_TX_DAT_NACK, I2C_I2STAT_M_TX_RESTART, I2C_I2STAT_M_TX_SLAW_ACK, I2C_I2STAT_M_TX_SLAW_NACK, I2C_I2STAT_M_TX_START, I2C_I2STAT_NO_INF, I2C_O_CON, I2C_O_DAT, I2C_O_STATUS, I2C_STATUS_M, I2CDisable(), tI2CMasterTransferCfg::pvRBuf, tI2CMasterTransferCfg::pvWBuf, tI2CConfig::ulDir, tI2CMasterTransferCfg::ulRCount, tI2CMasterTransferCfg::ulRLen, tI2CMasterTransferCfg::ulSlave, tI2CMasterTransferCfg::ulWCount, tI2CMasterTransferCfg::ulWLen, xASSERT, xHWREG, and xtrue.
Referenced by I2C0IntHandler().

| void I2CSlaveHandler | ( | unsigned long | ulBase | ) |
General slave Interrupt handler for I2C peripheral.
| ulBase | specifies the I2C module base address. |
This function is to give a general slave Interrupt handler for I2C peripheral
The ulBase must be:I2C0_BASE.
Definition at line 712 of file xi2c.c.
References tI2CConfig::g_pfnI2CHandlerCallbacks, I2C_CON_AA, I2C_CON_SI, I2C_I2STAT_NO_INF, I2C_I2STAT_S_RX_GENCALL_ACK, I2C_I2STAT_S_RX_PRE_GENCALL_DAT_ACK, I2C_I2STAT_S_RX_PRE_GENCALL_DAT_NACK, I2C_I2STAT_S_RX_PRE_SLA_DAT_ACK, I2C_I2STAT_S_RX_PRE_SLA_DAT_NACK, I2C_I2STAT_S_RX_SLAW_ACK, I2C_I2STAT_S_RX_STA_STO_SLVREC_SLVTRX, I2C_I2STAT_S_TX_DAT_ACK, I2C_I2STAT_S_TX_DAT_NACK, I2C_I2STAT_S_TX_SLAR_ACK, I2C_O_CON, I2C_O_DAT, I2C_O_STATUS, I2C_STATUS_M, I2CIntDisable(), I2CIntEnable(), tI2CSlaveTransferCfg::pvRBuf, tI2CSlaveTransferCfg::pvWBuf, tI2CSlaveTransferCfg::ulRCount, tI2CSlaveTransferCfg::ulRLen, tI2CSlaveTransferCfg::ulWCount, tI2CSlaveTransferCfg::ulWLen, xHWREG, and xtrue.
Referenced by I2C0IntHandler().

| void I2CIntCallbackInit | ( | unsigned long | ulBase, |
| xtEventCallback | xtI2CCallback | ||
| ) |
| void I2CDisable | ( | unsigned long | ulBase | ) |
Disable I2C module of the specified I2C port.
| ulBase | specifies the I2C module base address. |
This function is to disable I2C module of the specified I2C port.
The ulBase must be:I2C0_BASE.
Definition at line 1853 of file xi2c.c.
References I2C0_BASE, I2C_CON_ENS1, I2C_O_CON, xASSERT, and xHWREG.
Referenced by I2CMasterHandler().
| void I2CEnable | ( | unsigned long | ulBase | ) |
Enable I2C module of the specified I2C port.
| ulBase | specifies the I2C module base address. |
This function is to enable I2C module of the specified I2C port.
The ulBase must be:I2C0_BASE.
Definition at line 1829 of file xi2c.c.
References I2C0_BASE, I2C_CON_ENS1, I2C_O_CON, xASSERT, and xHWREG.
| unsigned long I2CStatusGet | ( | unsigned long | ulBase | ) |
Get I2C status of the specified I2C port.
| ulBase | specifies the I2C module base address. |
This function is to get I2C status of the specified I2C port. There are 26 status codes. Please refer to xi2c.h M051_I2C_STATUS_Type in detail.
The ulBase must be:I2C0_BASE.
Definition at line 1685 of file xi2c.c.
References I2C0_BASE, I2C_O_STATUS, I2C_STATUS_M, xASSERT, and xHWREG.
| void I2CSlaveInit | ( | unsigned long | ulBase, |
| unsigned char | ucSlaveAddr, | ||
| unsigned long | ulGeneralCall | ||
| ) |
Set the clock rate of the specified I2C port.
| ulBase | specifies the I2C module base address. |
| ucSlaveAddr | specifies the slave address. |
| ulGeneralCall | specifies enable General Call function or not. |
This function is to Set 4 7-bit slave addresses and enable General Call function of specified I2C port.
The ulBase must be:I2C0_BASE.
The ucSlaveAddr is the I2C slave address,There are 4 slave addrss. The ucSlaveAddr can be a 7-bit value.
The ulGeneralCall is to enable the General Call function or not. The ulGeneralCall can be one of the following values: I2C_GENERAL_CALL_EN,I2C_GENERAL_CALL_DIS.
Definition at line 1254 of file xi2c.c.
References I2C0_BASE, I2C_CON_AA, I2C_CON_ENS1, I2C_O_ADDR0, I2C_O_CON, SYSCTL_PERIPH_I2C0, SysCtlPeripheralReset(), xASSERT, and xHWREG.

| void I2CSlaveOwnAddressSet | ( | unsigned long | ulBase, |
| unsigned char | ucSlaveNum, | ||
| unsigned char | ucSlaveAddr, | ||
| unsigned long | ulGeneralCall | ||
| ) |
Set the slave address of the specified I2C port.
| ulBase | specifies the I2C module base address. |
| ucSlaveNum | specifies the salve address number. |
| ucSlaveAddr | specifies the slave address. |
| ulGeneralCall | specifies enable General Call function or not. |
This function is to Set 4 7-bit slave addresses and enable General Call function of specified I2C port.
The ulBase must be:I2C0_BASE.
The ucSlaveNum is the I2C slave address number,There are 4 slave addrss,so The ucSlaveNum can be: 0, 1, 2, 3.
The ucSlaveAddr is the I2C slave address,There are 4 slave addrss. The ucSlaveAddr can be a 7-bit value.
The ulGeneralCall is to enable the General Call function or not. The ulGeneralCall can be one of the following values: I2C_GENERAL_CALL_EN,I2C_GENERAL_CALL_DIS.
Definition at line 1597 of file xi2c.c.
References I2C0_BASE, I2C_GENERAL_CALL_DIS, I2C_GENERAL_CALL_EN, xASSERT, and xHWREG.
| void I2CSlaveOwnAddressMaskSet | ( | unsigned long | ulBase, |
| unsigned char | ucSlaveNum, | ||
| unsigned char | ucSlaveAddrMask | ||
| ) |
Set 4 7-bit slave address mask of the specified I2C port.
| ulBase | specifies the I2C module base address. |
| ucSlaveNum | specifies the salve address number. |
| ucSlaveAddrMask | specifies the slave address mask. |
This function is to Set 4 7-bit slave address mask of specified I2C port.The corresponding address bit is "Don't Care"
The ulBase must be:I2C0_BASE.
The ucSlaveNum is the I2C slave address number,There are 4 slave addrss,so The ucSlaveNum can be: 0, 1, 2, 3.
The ucSlaveAddrMask is the I2C slave address mask,There are 4 slave addrss. The ucSlaveAddrMask can be a 7-bit value.
| void I2CIntFlagClear | ( | unsigned long | ulBase | ) |
Clear the I2C interrupt flag of the specified I2C port.
| ulBase | specifies the I2C module base address. |
This function is to clear the I2C interrupt flag of the specified I2C port.
The ulBase must be:I2C0_BASE.
Definition at line 1926 of file xi2c.c.
References I2C0_BASE, I2C_CON_SI, I2C_O_CON, xASSERT, and xHWREG.
| void I2CTimeoutFlagClear | ( | unsigned long | ulBase | ) |
Clear the I2C time out flag of the specified I2C port.
| ulBase | specifies the I2C module base address. |
This function is to clear the I2C time out flag of the specified I2C port.
The ulBase must be:I2C0_BASE.
Definition at line 1950 of file xi2c.c.
References I2C0_BASE, I2C_O_TOC, I2C_TOC_TIF, xASSERT, and xHWREG.
| void I2CTimeoutCounterSet | ( | unsigned long | ulBase, |
| unsigned long | ulEnable, | ||
| unsigned long | ulDiv4 | ||
| ) |
Enable/Disable I2C 14-bit timeout counter of the specified I2C port.
| ulBase | specifies the I2C module base address. |
| ulEnable | specifies Enable/Disable 14-bit timeout counter. |
| ulDiv4 | specifies 4 time the 14-bit timeout counter or not. |
This function is to Enable/Disable I2C 14-bit timeout counter and set div4 bit of timeout counter of the specified I2C port.
The ulBase must be:I2C0_BASE.
The ulEnable can be one of the following values: I2C_TIMEOUT_EN, I2C_TIMEOUT_DIS.
The ulDiv4 can be one of the following values: I2C_TIMEOUT_DIV4, I2C_TIMEOUT_DIV_NO.
Definition at line 1983 of file xi2c.c.
References I2C0_BASE, I2C_O_TOC, I2C_TIMEOUT_DIS, I2C_TIMEOUT_DIV4, I2C_TIMEOUT_DIV_NO, I2C_TIMEOUT_EN, xASSERT, and xHWREG.
| xtBoolean I2CIntFlagGet | ( | unsigned long | ulBase | ) |
Get the I2C interrupt flag of the specified I2C port.
| ulBase | specifies the I2C module base address. |
This function is to get the I2C interrupt flag of the specified I2C port.
The ulBase must be: I2C0_BASE.
Definition at line 1878 of file xi2c.c.
References I2C0_BASE, I2C_O_CON, xASSERT, xfalse, xHWREG, and xtrue.
| xtBoolean I2CTimeoutFlagGet | ( | unsigned long | ulBase | ) |
Get the I2C time out flag of the specified I2C port.
| ulBase | specifies the I2C module base address. |
This function is to get the I2C time out flag of the specified I2C port.
The ulBase must be:I2C0_BASE.
Definition at line 1902 of file xi2c.c.
References I2C0_BASE, I2C_O_TOC, I2C_TOC_TIF, xASSERT, xfalse, xHWREG, and xtrue.
| void I2CIntDisable | ( | unsigned long | ulBase | ) |
Disable I2C interrupt of the specified I2C port.
| ulBase | specifies the I2C module base address. |
This function is to disable I2C interrupt of the specified I2C port.
The ulBase must be:I2C0_BASE.
Definition at line 1803 of file xi2c.c.
References I2C0_BASE, I2C_CON_EI, I2C_O_CON, INT_I2C0, xASSERT, xHWREG, and xIntDisable().
Referenced by I2C0IntHandler(), and I2CSlaveHandler().

| void I2CIntEnable | ( | unsigned long | ulBase | ) |
Enable I2C interrupt of the specified I2C port.
| ulBase | specifies the I2C module base address. |
This function is to enable I2C interrupt of the specified I2C port.
The ulBase must be:I2C0_BASE.
Definition at line 1755 of file xi2c.c.
References I2C0_BASE, I2C_CON_EI, I2C_O_CON, INT_I2C0, xASSERT, xHWREG, and xIntEnable().
Referenced by I2C0IntHandler(), I2CMasterTransfer(), I2CSlaveHandler(), and I2CSlaveTransfer().
