Module for the data link layer of the Infineon I2C Protocol Stack library. More...
Macros |
|
| #define | IFX_I2C_HAL_TX_SUCCESS 0x01 |
|
Success event propagated to upper layer.
|
|
| #define | IFX_I2C_HAL_RX_SUCCESS 0x02 |
|
Success event propagated to upper layer.
|
|
| #define | IFX_I2C_HAL_ERROR 0x03 |
|
Error event propagated to upper layer.
|
|
Typedefs |
|
| typedef void(* | IFX_I2C_EventHandler )(uint8_t event) |
|
Function pointer type for upper layer event handler.
|
|
| typedef void(* | IFX_Timer_Callback )(void) |
|
Callback function to handle elapsed timer.
|
|
Functions |
|
| uint16_t | ifx_i2c_init (uint8_t reinit, IFX_I2C_EventHandler handler) |
|
Function for initializing a HAL module.
More...
|
|
| void | ifx_i2c_transmit (uint8_t *data, uint16_t length) |
|
I2C transmit function to conduct an I2 write on I2C bus.
More...
|
|
| void | ifx_i2c_receive (uint8_t *data, uint16_t length) |
|
I2C receive function to conduct an I2 read on I2C bus.
More...
|
|
| void | ifx_timer_setup (uint16_t time_us, IFX_Timer_Callback callback_function) |
|
Timer setup function to initialize and start a timer.
More...
|
|
| void | ifx_debug_log (uint8_t log_id, char *format_msg,...) |
|
Function to route logging messages to a hardware-specific logger.
More...
|
|
Detailed Description
Module for the data link layer of the Infineon I2C Protocol Stack library.
Function Documentation
| void ifx_debug_log | ( | uint8_t | log_id , |
| char * | format_msg , | ||
| ... | |||
| ) |
Function to route logging messages to a hardware-specific logger.
The function routes formatted log messages to a hardware-specific logger.
- Parameters
-
log_id Log ID number to distinguish layers (see ifx_i2c_config.h) format_msg Format string with log message
| uint16_t ifx_i2c_init | ( | uint8_t | reinit , |
| IFX_I2C_EventHandler | handler | ||
| ) |
Function for initializing a HAL module.
The function initializes a HAL module.
- Parameters
-
reinit If 1, the call shal re-initializes the HAL module if it was used before. If 0, the module is initialized for the first time. handler Event handler to propagate events to the upper layer
| void ifx_i2c_receive | ( | uint8_t * | data , |
| uint16_t | length | ||
| ) |
I2C receive function to conduct an I2 read on I2C bus.
The function conducts an I2C read on the I2C bus.
- Parameters
-
data Pointer to buffer where received data shall be stored length Number of bytes to read from I2C slave
| void ifx_i2c_transmit | ( | uint8_t * | data , |
| uint16_t | length | ||
| ) |
I2C transmit function to conduct an I2 write on I2C bus.
The function conducts an I2C write on the I2C bus.
- Parameters
-
data Pointer to buffer with data to be written to I2C slave length Length of data in data buffer
| void ifx_timer_setup | ( | uint16_t | time_us , |
| IFX_Timer_Callback | callback_function | ||
| ) |
Timer setup function to initialize and start a timer.
The function initializes and starts a timer that will call callback_function after time_ms milliseconds have elapsed.
- Parameters
-
time_us Time in microseconds after the timer expires callback_function Function to be called once timer expired