nRF5 SDK v14.2.0
Macros | Typedefs | Functions
Infineon I2C Protocol Stack: Hardware Abstraction Layer

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 *p_data, uint16_t length)
 I2C transmit function to conduct an I2 write on I2C bus. More...
 
void ifx_i2c_receive (uint8_t *p_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...
 

Detailed Description

Module for the data link layer of the Infineon I2C Protocol Stack library.

Function Documentation

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
reinitIf 1, the call shal re-initializes the HAL module if it was used before. If 0, the module is initialized for the first time.
handlerEvent handler to propagate events to the upper layer
void ifx_i2c_receive ( uint8_t *  p_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
p_dataPointer to buffer where received data shall be stored.
lengthNumber of bytes to read from I2C slave.
void ifx_i2c_transmit ( uint8_t *  p_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
p_dataPointer to buffer with data to be written to I2C slave.
lengthLength 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_usTime in microseconds after the timer expires.
callback_functionFunction to be called once timer expired.

Documentation feedback | Developer Zone | Subscribe | Updated