Go to the source code of this file.
Classes | |
struct | I2C_XFER_T |
Master transfer data structure definitions. More... | |
struct | LPC_I2C_T |
I2C register block structure. More... | |
Typedefs | |
typedef void(* | I2C_EVENTHANDLER_T) (I2C_ID_T, I2C_EVENT_T) |
Event handler function type. More... | |
typedef enum I2C_ID | I2C_ID_T |
I2C interface IDs. More... | |
Enumerations | |
enum | I2C_EVENT_T { I2C_EVENT_WAIT = 1, I2C_EVENT_DONE, I2C_EVENT_LOCK, I2C_EVENT_UNLOCK, I2C_EVENT_SLAVE_RX, I2C_EVENT_SLAVE_TX } |
I2C master events. More... | |
enum | I2C_ID { I2C0, I2C_NUM_INTERFACE } |
I2C interface IDs. More... | |
enum | I2C_SLAVE_ID { I2C_SLAVE_GENERAL, I2C_SLAVE_0, I2C_SLAVE_1, I2C_SLAVE_2, I2C_SLAVE_3, I2C_SLAVE_NUM_INTERFACE } |
I2C Slave Identifiers. More... | |
enum | I2C_STATUS_T { I2C_STATUS_DONE, I2C_STATUS_NAK, I2C_STATUS_ARBLOST, I2C_STATUS_BUSERR, I2C_STATUS_BUSY } |
I2C transfer status. More... | |
Functions | |
void | Chip_I2C_DeInit (I2C_ID_T id) |
De-initializes the I2C peripheral registers to their default reset values. More... | |
void | Chip_I2C_Disable (I2C_ID_T id) |
Disable I2C peripheral's operation. More... | |
void | Chip_I2C_EventHandler (I2C_ID_T id, I2C_EVENT_T event) |
Default event handler for interrupt base operation. More... | |
void | Chip_I2C_EventHandlerPolling (I2C_ID_T id, I2C_EVENT_T event) |
Default event handler for polling operation. More... | |
uint32_t | Chip_I2C_GetClockRate (I2C_ID_T id) |
Get current clock rate for LPC_I2C peripheral. More... | |
I2C_EVENTHANDLER_T | Chip_I2C_GetMasterEventHandler (I2C_ID_T id) |
Get pointer to current function handling the events. More... | |
void | Chip_I2C_Init (I2C_ID_T id) |
Initializes the LPC_I2C peripheral with specified parameter. More... | |
int | Chip_I2C_IsMasterActive (I2C_ID_T id) |
Checks if master xfer in progress. More... | |
int | Chip_I2C_IsStateChanged (I2C_ID_T id) |
I2C peripheral state change checking. More... | |
int | Chip_I2C_MasterCmdRead (I2C_ID_T id, uint8_t slaveAddr, uint8_t cmd, uint8_t *buff, int len) |
Transfer a command to slave and receive data from slave after a repeated start. More... | |
int | Chip_I2C_MasterRead (I2C_ID_T id, uint8_t slaveAddr, uint8_t *buff, int len) |
Set function that must handle I2C events. More... | |
int | Chip_I2C_MasterSend (I2C_ID_T id, uint8_t slaveAddr, const uint8_t *buff, uint8_t len) |
Transmit data to I2C slave using I2C Master mode. More... | |
void | Chip_I2C_MasterStateHandler (I2C_ID_T id) |
I2C Master transfer state change handler. More... | |
int | Chip_I2C_MasterTransfer (I2C_ID_T id, I2C_XFER_T *xfer) |
Transmit and Receive data in master mode. More... | |
void | Chip_I2C_SetClockRate (I2C_ID_T id, uint32_t clockrate) |
Set up clock rate for LPC_I2C peripheral. More... | |
int | Chip_I2C_SetMasterEventHandler (I2C_ID_T id, I2C_EVENTHANDLER_T event) |
Set function that must handle I2C events. More... | |
void | Chip_I2C_SlaveSetup (I2C_ID_T id, I2C_SLAVE_ID sid, I2C_XFER_T *xfer, I2C_EVENTHANDLER_T event, uint8_t addrMask) |
Setup a slave I2C device. More... | |
void | Chip_I2C_SlaveStateHandler (I2C_ID_T id) |
I2C Slave event handler. More... | |