OPTIGA Trust M  1.1.0
C++ library for Optiga Trust M Chip Security Controller
ifx_i2c_physical_layer.c File Reference

This file implements the APIs for physical layer of the Infineon I2C Protocol Stack library. More...

Include dependency graph for ifx_i2c_physical_layer.c:

Functions

optiga_lib_status_t ifx_i2c_pl_init (ifx_i2c_context_t *p_ctx, ifx_i2c_event_handler_t handler)
 Function for initializing the module. More...
 
optiga_lib_status_t ifx_i2c_pl_send_frame (ifx_i2c_context_t *p_ctx, uint8_t *p_frame, uint16_t frame_len)
 Function for sending a frame. More...
 
optiga_lib_status_t ifx_i2c_pl_receive_frame (ifx_i2c_context_t *p_ctx)
 Function for receiving a frame. More...
 
optiga_lib_status_t ifx_i2c_pl_write_slave_address (ifx_i2c_context_t *p_ctx, uint8_t slave_address, uint8_t persistent)
 Function for setting slave address. More...
 
_STATIC_H void ifx_i2c_pl_read_register (ifx_i2c_context_t *p_ctx, uint8_t reg_addr, uint16_t reg_len)
 
_STATIC_H void ifx_i2c_pl_write_register (ifx_i2c_context_t *p_ctx, uint8_t reg_addr, uint16_t reg_len, const uint8_t *p_content)
 
_STATIC_H void ifx_i2c_pl_status_poll_callback (void *p_ctx)
 
_STATIC_H optiga_lib_status_t ifx_i2c_pl_set_bit_rate (ifx_i2c_context_t *p_ctx, uint16_t bitrate)
 
_STATIC_H void ifx_i2c_pl_negotiation_event_handler (void *p_input_ctx)
 
_STATIC_H void ifx_i2c_pl_frame_event_handler (ifx_i2c_context_t *p_ctx, optiga_lib_status_t event)
 
_STATIC_H void ifx_i2c_pal_poll_callback (void *p_ctx)
 
_STATIC_H void ifx_i2c_pl_guard_time_callback (void *p_ctx)
 
_STATIC_H void ifx_i2c_pl_pal_event_handler (void *p_ctx, optiga_lib_status_t event)
 
_STATIC_H void ifx_i2c_pl_soft_reset (ifx_i2c_context_t *p_ctx)
 
_STATIC_H void ifx_i2c_pl_pal_slave_addr_event_handler (void *p_ctx, optiga_lib_status_t event)
 

Detailed Description

This file implements the APIs for physical layer of the Infineon I2C Protocol Stack library.

Copyright (c) 2019 Infineon Technologies AG

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE

\endcopyright

Author
Infineon Technologies AG

Function Documentation

◆ ifx_i2c_pal_poll_callback()

_STATIC_H void ifx_i2c_pal_poll_callback ( void *  p_ctx)
Here is the call graph for this function:

◆ ifx_i2c_pl_frame_event_handler()

_STATIC_H void ifx_i2c_pl_frame_event_handler ( ifx_i2c_context_t p_ctx,
optiga_lib_status_t  event 
)
Here is the call graph for this function:

◆ ifx_i2c_pl_guard_time_callback()

_STATIC_H void ifx_i2c_pl_guard_time_callback ( void *  p_ctx)
Here is the call graph for this function:

◆ ifx_i2c_pl_init()

optiga_lib_status_t ifx_i2c_pl_init ( ifx_i2c_context_t p_ctx,
ifx_i2c_event_handler_t  handler 
)

Function for initializing the module.

Function initializes and enables the module

  • It registers an event handler to receive events from this module.
Precondition
  • This function must be called before using the module.
Note
  • None
Parameters
[in,out]p_ctxPointer to IFX I2C context.
[in]handlerFunction pointer to the event handler of the upper layer.
Return values
IFX_I2C_STACK_SUCCESSIf initialization was successful.
IFX_I2C_STACK_ERRORIf the module is already initialized.
Here is the call graph for this function:

◆ ifx_i2c_pl_negotiation_event_handler()

_STATIC_H void ifx_i2c_pl_negotiation_event_handler ( void *  p_input_ctx)
Here is the call graph for this function:

◆ ifx_i2c_pl_pal_event_handler()

_STATIC_H void ifx_i2c_pl_pal_event_handler ( void *  p_ctx,
optiga_lib_status_t  event 
)
Here is the call graph for this function:

◆ ifx_i2c_pl_pal_slave_addr_event_handler()

_STATIC_H void ifx_i2c_pl_pal_slave_addr_event_handler ( void *  p_ctx,
optiga_lib_status_t  event 
)

◆ ifx_i2c_pl_read_register()

_STATIC_H void ifx_i2c_pl_read_register ( ifx_i2c_context_t p_ctx,
uint8_t  reg_addr,
uint16_t  reg_len 
)
Here is the call graph for this function:

◆ ifx_i2c_pl_receive_frame()

optiga_lib_status_t ifx_i2c_pl_receive_frame ( ifx_i2c_context_t p_ctx)

Function for receiving a frame.

Asynchronous function to receive a frame

  • The function returns immediately.
  • One of the following events is propagated to the event handler registered with ifx_i2c_pl_init
Precondition
  • None
Note
  • None
Parameters
[in]p_ctxPointer to IFX I2C context.
Return values
IFX_I2C_STACK_SUCCESSIf function was successful.
IFX_I2C_STACK_ERRORIf the module is busy.
Here is the call graph for this function:

◆ ifx_i2c_pl_send_frame()

optiga_lib_status_t ifx_i2c_pl_send_frame ( ifx_i2c_context_t p_ctx,
uint8_t *  p_frame,
uint16_t  frame_len 
)

Function for sending a frame.

Asynchronous function to send a frame.

  • The function returns immediately.
  • One of the following events is propagated to the event handler registered with ifx_i2c_pl_init
Precondition
  • None
Note
  • None
Parameters
[in,out]p_ctxPointer to IFX I2C context.
[in]p_frameBuffer containing the frame.
[in]frame_lenFrame length.
Return values
IFX_I2C_STACK_SUCCESSIf function was successful.
IFX_I2C_STACK_ERRORIf the module is busy.
Here is the call graph for this function:

◆ ifx_i2c_pl_set_bit_rate()

_STATIC_H optiga_lib_status_t ifx_i2c_pl_set_bit_rate ( ifx_i2c_context_t p_ctx,
uint16_t  bitrate 
)
Here is the call graph for this function:

◆ ifx_i2c_pl_soft_reset()

_STATIC_H void ifx_i2c_pl_soft_reset ( ifx_i2c_context_t p_ctx)
Here is the call graph for this function:

◆ ifx_i2c_pl_status_poll_callback()

_STATIC_H void ifx_i2c_pl_status_poll_callback ( void *  p_ctx)
Here is the call graph for this function:

◆ ifx_i2c_pl_write_register()

_STATIC_H void ifx_i2c_pl_write_register ( ifx_i2c_context_t p_ctx,
uint8_t  reg_addr,
uint16_t  reg_len,
const uint8_t *  p_content 
)
Here is the call graph for this function:

◆ ifx_i2c_pl_write_slave_address()

optiga_lib_status_t ifx_i2c_pl_write_slave_address ( ifx_i2c_context_t p_ctx,
uint8_t  slave_address,
uint8_t  storage_type 
)

Function for setting slave address.

Synchronous function to set slave address.

Precondition
  • None
Note
  • None
Parameters
[in]p_ctxPointer to IFX I2C context.
[in]slave_addressHolds new slave address[7 Bit] to be set.
[in]storage_type0: To set the Slave address until next reset.
Non-zero: To set the slave address to persistent memory.
Return values
IFX_I2C_STACK_SUCCESSIf function was successful.
IFX_I2C_STACK_ERRORIf setting slave address fails.
Here is the call graph for this function: