Master Thesis
V1.0
Research and Design of Sensor Node for NMSD Treatment
|
I2C function to read-write the I2C bus, based on DRAMCO code. More...
Go to the source code of this file.
Macros | |
#define | I2C_PORT_LOCATION 1 |
Functions | |
void | IIC_Init (void) |
Setup I2C functionality. More... | |
void | IIC_Enable (bool enable) |
void | IIC_Reset (void) |
Resets the I2C interface. More... | |
bool | IIC_WriteBuffer (uint8_t iicAddress, uint8_t *wBuffer, uint8_t wLength) |
I2C write functionality. More... | |
bool | IIC_ReadBuffer (uint8_t iicAddress, uint8_t *rBuffer, uint8_t rLength) |
I2C read functionality. More... | |
bool | IIC_WriteReadBuffer (uint8_t iicAddress, uint8_t *wBuffer, uint8_t wLength, uint8_t *rBuffer, uint8_t rLength) |
I2C read/write functionality, to read and write at the same time. More... | |
Variables | |
I2CSPM_Init_TypeDef | i2cInit = I2CSPM_INIT_DEFAULT |
void IIC_Enable | ( | bool | enable | ) |
Definition at line 71 of file I2C.c.
References ICM_20948_SCL_PIN, ICM_20948_SCL_PORT, ICM_20948_SDA_PIN, and ICM_20948_SDA_PORT.
void IIC_Init | ( | void | ) |
Setup I2C functionality.
Definition at line 52 of file I2C.c.
References i2cInit.
Referenced by ICM_20948_Init().
bool IIC_ReadBuffer | ( | uint8_t | iicAddress, |
uint8_t * | rBuffer, | ||
uint8_t | rLength | ||
) |
void IIC_Reset | ( | void | ) |
bool IIC_WriteBuffer | ( | uint8_t | iicAddress, |
uint8_t * | wBuffer, | ||
uint8_t | wLength | ||
) |
I2C write functionality.
[in] | iicAddress | 10bit I2C address |
[in] | wBuffer | Address where the data is that needs to be written |
[in] | wLength | Length of the data that has to be written |
Definition at line 112 of file I2C.c.
References i2cInit.
Referenced by ICM_20948_bankSelect(), ICM_20948_registerWrite(), and ICM_20948_write_mag_register().
bool IIC_WriteReadBuffer | ( | uint8_t | iicAddress, |
uint8_t * | wBuffer, | ||
uint8_t | wLength, | ||
uint8_t * | rBuffer, | ||
uint8_t | rLength | ||
) |
I2C read/write functionality, to read and write at the same time.
[in] | iicAddress | 10bit I2C address |
[in] | regCommand | Address that needs to be read |
[in] | rBuffer | Address where the read data needs to be stored |
[in] | rLength | Length of the data that has to be read |
Definition at line 190 of file I2C.c.
References i2cInit.
Referenced by ICM_20948_read_mag_register(), and ICM_20948_registerRead().
I2CSPM_Init_TypeDef i2cInit = I2CSPM_INIT_DEFAULT |
Definition at line 44 of file I2C.c.
Referenced by IIC_Init(), IIC_ReadBuffer(), IIC_Reset(), IIC_WriteBuffer(), and IIC_WriteReadBuffer().