![]() |
Nano102_112 Series BSP
V3.03.002
The Board Support Package for Nano102_112 Series
|
Macros | |
#define | I2C_SET_CONTROL_REG(i2c, u8Ctrl) |
This macro sets the I2C control register at one time. More... | |
#define | I2C_START(i2c) |
This macro only set START bit to the control register of I2C module. More... | |
#define | I2C_STOP(i2c) |
This macro only set STOP bit to the control register of I2C module. More... | |
#define | I2C_WAIT_READY(i2c) |
This macro will return when I2C module is ready and flag is cleared. More... | |
#define | I2C_GET_DATA(i2c) |
This macro returns the data stored in data register of I2C module. More... | |
#define | I2C_SET_DATA(i2c, u8Data) |
This macro writes the data to data register of I2C module. More... | |
#define | I2C_GET_STATUS(i2c) |
This macro returns the status of I2C module. More... | |
#define | I2C_GET_TIMEOUT_FLAG(i2c) |
This macro returns timeout flag. More... | |
#define | I2C_CLEAR_TIMEOUT_FLAG(i2c) |
This macro clears timeout flag. More... | |
#define | I2C_GET_WAKEUP_FLAG(i2c) |
This macro returns wakeup flag. More... | |
#define | I2C_GET_WAKEUP_ACK_DONE_FLAG(i2c) |
This macro returns acknowledge status after waking up. More... | |
#define | I2C_CLEAR_WAKEUP_FLAG(i2c) |
This macro clears wakeup flag. More... | |
#define | I2C_CLEAR_WAKEUP_ACK_DONE_FLAG(i2c) |
This macro clears acknowledge status after waking up. And also release SCK pin after clearing this flag. More... | |
#define | I2C_DISABLE_FIFO(i2c) |
This macro disables the FIFO function. More... | |
#define | I2C_ENABLE_FIFO(i2c) |
This macro enables the FIFO function. More... | |
#define | I2C_DISABLE_CLOCK_STRETCH(i2c) |
This macro disables clock stretch function. More... | |
#define | I2C_ENABLE_CLOCK_STRETCH(i2c) |
This macro enables clock stretch function. More... | |
#define | I2C_DISABLE_OVERRUN_INT(i2c) |
This macro disables over-run interrupt. More... | |
#define | I2C_ENABLE_OVERRUN_INT(i2c) |
This macro enables over-run interrupt. More... | |
#define | I2C_ENABLE_UNDERRUN_INT(i2c) |
This macro enables under-run interrupt. More... | |
#define | I2C_DISABLE_UNDERRUN_INT(i2c) |
This macro disables under-run interrupt. More... | |
#define | I2C_GET_BUS_FREE_FLAG(i2c) |
This macro returns I2C bus status flag. More... | |
#define | I2C_GET_WAKEUP_RW_FLAG(i2c) |
This macro returns wakeup read/write flag. After system wake up, this bit indicates that the master wants to read or write in R/W bit of I2C data. More... | |
Functions | |
uint32_t | I2C_Open (I2C_T *i2c, uint32_t u32BusClock) |
This function make I2C module be ready and set the wanted bus clock. More... | |
void | I2C_Close (I2C_T *i2c) |
This function closes the I2C module. More... | |
void | I2C_ClearTimeoutFlag (I2C_T *i2c) |
This function clears the timeout flag. More... | |
void | I2C_Trigger (I2C_T *i2c, uint8_t u8Start, uint8_t u8Stop, uint8_t u8Si, uint8_t u8Ack) |
This function sets the control bit of the I2C module. More... | |
void | I2C_DisableInt (I2C_T *i2c) |
This function disables the interrupt of I2C module. More... | |
void | I2C_EnableInt (I2C_T *i2c) |
This function enables the interrupt (EI bit) of I2C module. More... | |
uint32_t | I2C_GetBusClockFreq (I2C_T *i2c) |
This function returns the real bus clock of I2C module. More... | |
uint32_t | I2C_SetBusClockFreq (I2C_T *i2c, uint32_t u32BusClock) |
This function sets bus frequency of I2C module. More... | |
uint32_t | I2C_GetIntFlag (I2C_T *i2c) |
This function gets the interrupt flag of I2C module. More... | |
void | I2C_ClearIntFlag (I2C_T *i2c) |
This function clears the interrupt flag of I2C module. More... | |
uint32_t | I2C_GetStatus (I2C_T *i2c) |
This function returns the status of I2C module. More... | |
uint32_t | I2C_GetData (I2C_T *i2c) |
This function returns the data stored in data register of I2C module. More... | |
void | I2C_SetData (I2C_T *i2c, uint8_t u8Data) |
This function writes the data to data register of I2C module. More... | |
void | I2C_SetSlaveAddr (I2C_T *i2c, uint8_t u8SlaveNo, uint8_t u8SlaveAddr, uint8_t u8GCMode) |
Configure slave address and enable GC mode. More... | |
void | I2C_SetSlaveAddrMask (I2C_T *i2c, uint8_t u8SlaveNo, uint8_t u8SlaveAddrMask) |
Configure the mask of slave address. The corresponding address bit is "Don't Care". More... | |
void | I2C_EnableTimeout (I2C_T *i2c, uint8_t u8LongTimeout) |
This function enables timeout function and configures DIV4 function to support long timeout. More... | |
void | I2C_DisableTimeout (I2C_T *i2c) |
This function disables timeout function. More... | |
void | I2C_EnableWakeup (I2C_T *i2c) |
This function enables the wakeup function of I2C module. More... | |
void | I2C_DisableWakeup (I2C_T *i2c) |
This function disables the wakeup function of I2C module. More... | |
#define I2C_CLEAR_TIMEOUT_FLAG | ( | i2c | ) |
#define I2C_CLEAR_WAKEUP_ACK_DONE_FLAG | ( | i2c | ) |
#define I2C_CLEAR_WAKEUP_FLAG | ( | i2c | ) |
#define I2C_DISABLE_CLOCK_STRETCH | ( | i2c | ) |
#define I2C_DISABLE_FIFO | ( | i2c | ) |
#define I2C_DISABLE_OVERRUN_INT | ( | i2c | ) |
#define I2C_DISABLE_UNDERRUN_INT | ( | i2c | ) |
#define I2C_ENABLE_CLOCK_STRETCH | ( | i2c | ) |
#define I2C_ENABLE_FIFO | ( | i2c | ) |
#define I2C_ENABLE_OVERRUN_INT | ( | i2c | ) |
#define I2C_ENABLE_UNDERRUN_INT | ( | i2c | ) |
#define I2C_GET_BUS_FREE_FLAG | ( | i2c | ) |
#define I2C_GET_DATA | ( | i2c | ) |
#define I2C_GET_STATUS | ( | i2c | ) |
#define I2C_GET_TIMEOUT_FLAG | ( | i2c | ) |
#define I2C_GET_WAKEUP_ACK_DONE_FLAG | ( | i2c | ) |
#define I2C_GET_WAKEUP_FLAG | ( | i2c | ) |
#define I2C_GET_WAKEUP_RW_FLAG | ( | i2c | ) |
#define I2C_SET_CONTROL_REG | ( | i2c, | |
u8Ctrl | |||
) |
#define I2C_SET_DATA | ( | i2c, | |
u8Data | |||
) |
#define I2C_START | ( | i2c | ) |
#define I2C_STOP | ( | i2c | ) |
#define I2C_WAIT_READY | ( | i2c | ) |
void I2C_ClearIntFlag | ( | I2C_T * | i2c | ) |
void I2C_ClearTimeoutFlag | ( | I2C_T * | i2c | ) |
void I2C_Close | ( | I2C_T * | i2c | ) |
void I2C_DisableInt | ( | I2C_T * | i2c | ) |
void I2C_DisableTimeout | ( | I2C_T * | i2c | ) |
void I2C_DisableWakeup | ( | I2C_T * | i2c | ) |
void I2C_EnableInt | ( | I2C_T * | i2c | ) |
void I2C_EnableTimeout | ( | I2C_T * | i2c, |
uint8_t | u8LongTimeout | ||
) |
void I2C_EnableWakeup | ( | I2C_T * | i2c | ) |
uint32_t I2C_GetBusClockFreq | ( | I2C_T * | i2c | ) |
uint32_t I2C_GetData | ( | I2C_T * | i2c | ) |
uint32_t I2C_GetIntFlag | ( | I2C_T * | i2c | ) |
uint32_t I2C_GetStatus | ( | I2C_T * | i2c | ) |
uint32_t I2C_Open | ( | I2C_T * | i2c, |
uint32_t | u32BusClock | ||
) |
uint32_t I2C_SetBusClockFreq | ( | I2C_T * | i2c, |
uint32_t | u32BusClock | ||
) |
void I2C_SetData | ( | I2C_T * | i2c, |
uint8_t | u8Data | ||
) |
void I2C_SetSlaveAddr | ( | I2C_T * | i2c, |
uint8_t | u8SlaveNo, | ||
uint8_t | u8SlaveAddr, | ||
uint8_t | u8GCMode | ||
) |
Configure slave address and enable GC mode.
[in] | i2c | is the base address of I2C module. |
[in] | u8SlaveNo | is the set number of salve address. |
[in] | u8SlaveAddr | is the slave address. |
[in] | u8GCMode | GC mode enable or not. Valid values are: |
void I2C_SetSlaveAddrMask | ( | I2C_T * | i2c, |
uint8_t | u8SlaveNo, | ||
uint8_t | u8SlaveAddrMask | ||
) |
void I2C_Trigger | ( | I2C_T * | i2c, |
uint8_t | u8Start, | ||
uint8_t | u8Stop, | ||
uint8_t | u8Si, | ||
uint8_t | u8Ack | ||
) |
This function sets the control bit of the I2C module.
[in] | i2c | is the base address of I2C module. |
[in] | u8Start | sets START bit to I2C module. |
[in] | u8Stop | sets STOP bit to I2C module. |
[in] | u8Si | sets SI bit to I2C module. |
[in] | u8Ack | sets ACK bit to I2C module. |