40 #ifndef __DRIVERLIB_I2C_H__
41 #define __DRIVERLIB_I2C_H__
65 #define I2C_INT_MASTER 0x00000001
66 #define I2C_INT_SLAVE 0x00000002
73 #define I2C_MASTER_CMD_SINGLE_SEND \
75 #define I2C_MASTER_CMD_SINGLE_RECEIVE \
77 #define I2C_MASTER_CMD_BURST_SEND_START \
79 #define I2C_MASTER_CMD_BURST_SEND_CONT \
81 #define I2C_MASTER_CMD_BURST_SEND_FINISH \
83 #define I2C_MASTER_CMD_BURST_SEND_STOP \
85 #define I2C_MASTER_CMD_BURST_SEND_ERROR_STOP \
87 #define I2C_MASTER_CMD_BURST_RECEIVE_START \
89 #define I2C_MASTER_CMD_BURST_RECEIVE_CONT \
91 #define I2C_MASTER_CMD_BURST_RECEIVE_FINISH \
93 #define I2C_MASTER_CMD_BURST_RECEIVE_ERROR_STOP \
95 #define I2C_MASTER_CMD_QUICK_COMMAND \
97 #define I2C_MASTER_CMD_HS_MASTER_CODE_SEND \
105 #define I2C_MASTER_ERR_NONE 0
106 #define I2C_MASTER_ERR_ADDR_ACK 0x00000004
107 #define I2C_MASTER_ERR_DATA_ACK 0x00000008
108 #define I2C_MASTER_ERR_ARB_LOST 0x00000010
109 #define I2C_MASTER_ERR_CLK_TOUT 0x00000080
116 #define I2C_SLAVE_ACT_NONE 0
117 #define I2C_SLAVE_ACT_RREQ 0x00000001 // Master has sent data
118 #define I2C_SLAVE_ACT_TREQ 0x00000002 // Master has requested data
119 #define I2C_SLAVE_ACT_RREQ_FBR 0x00000005 // Master has sent first byte
120 #define I2C_SLAVE_ACT_OWN2SEL 0x00000008 // Master requested secondary slave
121 #define I2C_SLAVE_ACT_QCMD 0x00000010 // Master has sent a Quick Command
122 #define I2C_SLAVE_ACT_QCMD_DATA 0x00000020 // Master Quick Command value
129 #define I2C_MASTER_MAX_RETRIES 1000 // Number of retries
136 #define I2C_MASTER_INT_TIMEOUT 0x00000002 // Clock Timeout Interrupt
137 #define I2C_MASTER_INT_DATA 0x00000001 // Data Interrupt
144 #define I2C_SLAVE_INT_STOP 0x00000004 // Stop Condition Interrupt
145 #define I2C_SLAVE_INT_START 0x00000002 // Start Condition Interrupt
146 #define I2C_SLAVE_INT_DATA 0x00000001 // Data Interrupt
153 extern void I2CIntRegister(uint32_t ui32Base,
void(pfnHandler)(
void));
170 uint32_t ui32IntFlags);
172 uint32_t ui32IntFlags);
176 uint32_t ui32IntFlags);
182 uint8_t ui8SlaveAddr,
188 extern void I2CSlaveInit(uint32_t ui32Base, uint8_t ui8SlaveAddr);
190 uint8_t ui8SlaveAddr);
196 uint32_t ui32IntFlags);
212 #endif // __DRIVERLIB_I2C_H__
bool I2CMasterBusy(uint32_t ui32Base)
Definition: i2c.c:1147
void I2CSlaveAddressSet(uint32_t ui32Base, uint8_t ui8AddrNum, uint8_t ui8SlaveAddr)
Definition: i2c.c:283
void I2CMasterEnable(uint32_t ui32Base)
Definition: i2c.c:329
bool I2CMasterIntStatus(uint32_t ui32Base, bool bMasked)
Definition: i2c.c:776
bool I2CMasterBusBusy(uint32_t ui32Base)
Definition: i2c.c:1182
void I2CMasterIntDisable(uint32_t ui32Base)
Definition: i2c.c:657
void I2CMasterDisable(uint32_t ui32Base)
Definition: i2c.c:384
void I2CSlaveDataPut(uint32_t ui32Base, uint8_t ui8Data)
Definition: i2c.c:1523
uint32_t I2CSlaveStatus(uint32_t ui32Base)
Definition: i2c.c:1497
void I2CSlaveIntEnableEx(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: i2c.c:632
void I2CMasterDataPut(uint32_t ui32Base, uint8_t ui8Data)
Definition: i2c.c:1319
void I2CSlaveIntClear(uint32_t ui32Base)
Definition: i2c.c:1017
void I2CSlaveACKValueSet(uint32_t ui32Base, bool bACK)
Definition: i2c.c:1443
void I2CMasterSlaveAddrSet(uint32_t ui32Base, uint8_t ui8SlaveAddr, bool bReceive)
Definition: i2c.c:1088
void I2CMasterInitExpClk(uint32_t ui32Base, uint32_t ui32I2CClk, bool bFast)
Definition: i2c.c:178
uint32_t I2CMasterIntStatusEx(uint32_t ui32Base, bool bMasked)
Definition: i2c.c:814
void I2CSlaveInit(uint32_t ui32Base, uint8_t ui8SlaveAddr)
Definition: i2c.c:245
void I2CSlaveIntEnable(uint32_t ui32Base)
Definition: i2c.c:594
void I2CMasterIntClear(uint32_t ui32Base)
Definition: i2c.c:934
uint32_t I2CSlaveIntStatusEx(uint32_t ui32Base, bool bMasked)
Definition: i2c.c:890
void I2CSlaveDisable(uint32_t ui32Base)
Definition: i2c.c:409
void I2CMasterTimeoutSet(uint32_t ui32Base, uint32_t ui32Value)
Definition: i2c.c:1378
void I2CMasterIntEnableEx(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: i2c.c:569
void I2CSlaveIntDisable(uint32_t ui32Base)
Definition: i2c.c:714
void I2CMasterIntEnable(uint32_t ui32Base)
Definition: i2c.c:532
void I2CMasterControl(uint32_t ui32Base, uint32_t ui32Cmd)
Definition: i2c.c:1230
uint32_t I2CMasterLineStateGet(uint32_t ui32Base)
Definition: i2c.c:1120
bool I2CSlaveIntStatus(uint32_t ui32Base, bool bMasked)
Definition: i2c.c:852
uint32_t I2CMasterErr(uint32_t ui32Base)
Definition: i2c.c:1270
uint32_t I2CSlaveDataGet(uint32_t ui32Base)
Definition: i2c.c:1549
uint32_t I2CMasterDataGet(uint32_t ui32Base)
Definition: i2c.c:1345
void I2CSlaveEnable(uint32_t ui32Base)
Definition: i2c.c:354
void I2CMasterIntDisableEx(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: i2c.c:689
void I2CMasterIntClearEx(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: i2c.c:981
void I2CSlaveACKOverride(uint32_t ui32Base, bool bEnable)
Definition: i2c.c:1408
void I2CIntRegister(uint32_t ui32Base, void(*pfnHandler)(void))
Definition: i2c.c:449
void I2CSlaveIntClearEx(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: i2c.c:1057
void I2CSlaveIntDisableEx(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: i2c.c:746
void I2CIntUnregister(uint32_t ui32Base)
Definition: i2c.c:493