OPTIGA™ Trust M
Host Library Documentation
ifx_i2c_config.h File Reference

This file defines the structures and macros for the Infineon I2C Protocol. More...

Include dependency graph for ifx_i2c_config.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ifx_i2c_pl
 Physical layer structure. More...
 
struct  ifx_i2c_dl
 Datalink layer structure. More...
 
struct  ifx_i2c_tl
 Transport layer structure. More...
 
struct  ifx_i2c_context
 IFX I2C context structure. More...
 
#define IFX_I2C_BASE_ADDR   (0x30)
 I2C slave address of the Infineon device. More...
 
#define PL_POLLING_INVERVAL_US   (1000U)
 Physical Layer: polling interval in microseconds. More...
 
#define PL_POLLING_MAX_CNT   (200U)
 Physical layer: maximal attempts. More...
 
#define PL_DATA_POLLING_INVERVAL_US   (5000U)
 Physical Layer: data register polling interval in microseconds. More...
 
#define PL_GUARD_TIME_INTERVAL_US   (50U)
 Physical Layer: guard time interval in microseconds. More...
 
#define IFX_I2C_FRAME_SIZE   (277U)
 Data link layer: frame size (max supported is 277 in OPTIGA ). More...
 
#define TL_HEADER_SIZE   (1U)
 Transport Layer: header size. More...
 
#define DL_HEADER_SIZE   (5U)
 Data link layer: header size. More...
 
#define DL_TRANS_REPEAT   (3U)
 Data link layer: maximum number of retries in case of transmission error. More...
 
#define PL_TRANS_TIMEOUT_MS   (10U)
 Data link layer: Trans timeout in milliseconds. More...
 
#define TL_MAX_EXIT_TIMEOUT   (180U)
 Transport layer: Maximum exit timeout in seconds. More...
 
#define RESET_LOW_TIME_MSEC   (2000U)
 Reset low time for GPIO pin toggling. More...
 
#define STARTUP_TIME_MSEC   (12000U)
 Start up time. More...
 
#define IFX_I2C_STACK_SUCCESS   (0x0000)
 Protocol Stack: Status codes for success. More...
 
#define IFX_I2C_STACK_BUSY   (0x0001)
 Protocol Stack: Status codes busy. More...
 
#define IFX_I2C_STACK_ERROR   (0x0102)
 Protocol Stack: Status codes for error. More...
 
#define IFX_I2C_STACK_MEM_ERROR   (0x0104)
 Protocol Stack: Memory insufficient. More...
 
#define IFX_I2C_FATAL_ERROR   (0x0106)
 Protocol Stack: Fatal error. Used internal to IFX I2C Stack. More...
 
#define IFX_I2C_HANDSHAKE_ERROR   (0x0107)
 Protocol Stack: handshake error. More...
 
#define IFX_I2C_SESSION_ERROR   (0x0108)
 Protocol Stack: session error. More...
 
#define IFX_I2C_DL_HEADER_OFFSET   (0U)
 Offset of Datalink header in tx_frame_buffer. More...
 
#define IFX_I2C_TL_HEADER_OFFSET   (IFX_I2C_DL_HEADER_OFFSET + 3)
 Offset of Transport header in tx_frame_buffer. More...
 
#define IFX_I2C_LOG_PL   (0U)
 Protocol Stack debug switch for physical layer (set to 0 or 1) More...
 
#define IFX_I2C_LOG_DL   (0U)
 Protocol Stack debug switch for data link layer (set to 0 or 1) More...
 
#define IFX_I2C_LOG_TL   (0U)
 Protocol Stack debug switch for transport layer (set to 0 or 1) More...
 
#define IFX_I2C_LOG_PRL   (0U)
 Protocol Stack debug switch for presentation layer (set to 0 or 1) More...
 
#define IFX_I2C_LOG_ID_PL   (0x00)
 Log ID number for physical layer. More...
 
#define IFX_I2C_LOG_ID_DL   (0x01)
 Log ID number for data link layer. More...
 
#define IFX_I2C_LOG_ID_TL   (0x02)
 Log ID number for transport layer. More...
 
#define IFX_I2C_LOG_ID_PRL   (0x03)
 Log ID number for presentation layer. More...
 
#define IFX_I2C_LOG_ID_PAL   (0x04)
 Log ID number for platform abstraction layer. More...
 
#define IFX_I2C_PRESENCE_BIT   (0x00)
 
#define IFX_I2C_PRL_MAC_SIZE   (0x00)
 
#define IFX_I2C_PRL_HEADER_SIZE   (0x00)
 
#define IFX_I2C_PRL_OVERHEAD_SIZE   (IFX_I2C_PRL_HEADER_SIZE + IFX_I2C_PRL_MAC_SIZE)
 Overhead buffer size for user buffer. More...
 
#define IFX_I2C_DATA_OFFSET   (IFX_I2C_PRL_HEADER_SIZE)
 Offset for data. More...
 
#define IFX_I2C_PRESENCE_BIT_CHECK   (0x00)
 
#define PROTOCOL_VERSION_PRE_SHARED_SECRET   (0x01)
 Pre shared secret protocol version. More...
 
#define IFX_I2C_SESSION_CONTEXT_RESTORE   (0x11)
 To restore saved secure session. More...
 
#define IFX_I2C_SESSION_CONTEXT_SAVE   (0x22)
 To store active secure session. More...
 
#define IFX_I2C_SESSION_CONTEXT_NONE   (0x33)
 For no manage context operation. More...
 
#define NO_PROTECTION   (0x00)
 When data from master and slave is unprotected. More...
 
#define MASTER_PROTECTION   (0x01)
 When data from master is protected and data from slave is unprotected. More...
 
#define SLAVE_PROTECTION   (0x02)
 When data from master is unprotected and data from is slave protected. More...
 
#define FULL_PROTECTION   (0x03)
 When data from master and slave protected. More...
 
#define RE_ESTABLISH   (0x80)
 To re-establish secure channel. More...
 
#define IFX_I2C_SESSION_KEY_BUFFER_SIZE   (0x28)
 Session key buffer size. More...
 
typedef struct ifx_i2c_context ifx_i2c_context_t
 IFX I2C context structure. More...
 
typedef void(* ifx_i2c_event_handler_t) (struct ifx_i2c_context *p_ctx, optiga_lib_status_t event, const uint8_t *data, uint16_t data_len)
 Event handler function prototype. More...
 
typedef struct ifx_i2c_pl ifx_i2c_pl_t
 Physical layer structure. More...
 
typedef struct ifx_i2c_dl ifx_i2c_dl_t
 Datalink layer structure. More...
 
typedef struct ifx_i2c_tl ifx_i2c_tl_t
 Transport layer structure. More...
 
ifx_i2c_context_t ifx_i2c_context_0
 IFX I2C Instance. More...
 

Detailed Description

This file defines the structures and macros for the Infineon I2C Protocol.

Author
Infineon Technologies AG

Definition in file ifx_i2c_config.h.

Macro Definition Documentation

◆ DL_HEADER_SIZE

#define DL_HEADER_SIZE   (5U)

Data link layer: header size.

Definition at line 83 of file ifx_i2c_config.h.

◆ DL_TRANS_REPEAT

#define DL_TRANS_REPEAT   (3U)

Data link layer: maximum number of retries in case of transmission error.

Definition at line 85 of file ifx_i2c_config.h.

◆ FULL_PROTECTION

#define FULL_PROTECTION   (0x03)

When data from master and slave protected.

Definition at line 175 of file ifx_i2c_config.h.

◆ IFX_I2C_BASE_ADDR

#define IFX_I2C_BASE_ADDR   (0x30)

I2C slave address of the Infineon device.

Definition at line 57 of file ifx_i2c_config.h.

◆ IFX_I2C_DATA_OFFSET

#define IFX_I2C_DATA_OFFSET   (IFX_I2C_PRL_HEADER_SIZE)

Offset for data.

Definition at line 155 of file ifx_i2c_config.h.

◆ IFX_I2C_DL_HEADER_OFFSET

#define IFX_I2C_DL_HEADER_OFFSET   (0U)

Offset of Datalink header in tx_frame_buffer.

Definition at line 113 of file ifx_i2c_config.h.

◆ IFX_I2C_FATAL_ERROR

#define IFX_I2C_FATAL_ERROR   (0x0106)

Protocol Stack: Fatal error. Used internal to IFX I2C Stack.

Definition at line 106 of file ifx_i2c_config.h.

◆ IFX_I2C_FRAME_SIZE

#define IFX_I2C_FRAME_SIZE   (277U)

Data link layer: frame size (max supported is 277 in OPTIGA ).

  • Note: This can be configured externally to a lesser value due to platform restrictions.
    Externally means through command line argument or project configuration or optiga_lib_config.h

Definition at line 77 of file ifx_i2c_config.h.

◆ IFX_I2C_HANDSHAKE_ERROR

#define IFX_I2C_HANDSHAKE_ERROR   (0x0107)

Protocol Stack: handshake error.

Definition at line 108 of file ifx_i2c_config.h.

◆ IFX_I2C_LOG_DL

#define IFX_I2C_LOG_DL   (0U)

Protocol Stack debug switch for data link layer (set to 0 or 1)

Definition at line 119 of file ifx_i2c_config.h.

◆ IFX_I2C_LOG_ID_DL

#define IFX_I2C_LOG_ID_DL   (0x01)

Log ID number for data link layer.

Definition at line 128 of file ifx_i2c_config.h.

◆ IFX_I2C_LOG_ID_PAL

#define IFX_I2C_LOG_ID_PAL   (0x04)

Log ID number for platform abstraction layer.

Definition at line 134 of file ifx_i2c_config.h.

◆ IFX_I2C_LOG_ID_PL

#define IFX_I2C_LOG_ID_PL   (0x00)

Log ID number for physical layer.

Definition at line 126 of file ifx_i2c_config.h.

◆ IFX_I2C_LOG_ID_PRL

#define IFX_I2C_LOG_ID_PRL   (0x03)

Log ID number for presentation layer.

Definition at line 132 of file ifx_i2c_config.h.

◆ IFX_I2C_LOG_ID_TL

#define IFX_I2C_LOG_ID_TL   (0x02)

Log ID number for transport layer.

Definition at line 130 of file ifx_i2c_config.h.

◆ IFX_I2C_LOG_PL

#define IFX_I2C_LOG_PL   (0U)

Protocol Stack debug switch for physical layer (set to 0 or 1)

Definition at line 117 of file ifx_i2c_config.h.

◆ IFX_I2C_LOG_PRL

#define IFX_I2C_LOG_PRL   (0U)

Protocol Stack debug switch for presentation layer (set to 0 or 1)

Definition at line 123 of file ifx_i2c_config.h.

◆ IFX_I2C_LOG_TL

#define IFX_I2C_LOG_TL   (0U)

Protocol Stack debug switch for transport layer (set to 0 or 1)

Definition at line 121 of file ifx_i2c_config.h.

◆ IFX_I2C_PRESENCE_BIT

#define IFX_I2C_PRESENCE_BIT   (0x00)

Definition at line 149 of file ifx_i2c_config.h.

◆ IFX_I2C_PRESENCE_BIT_CHECK

#define IFX_I2C_PRESENCE_BIT_CHECK   (0x00)

Definition at line 156 of file ifx_i2c_config.h.

◆ IFX_I2C_PRL_HEADER_SIZE

#define IFX_I2C_PRL_HEADER_SIZE   (0x00)

Definition at line 151 of file ifx_i2c_config.h.

◆ IFX_I2C_PRL_MAC_SIZE

#define IFX_I2C_PRL_MAC_SIZE   (0x00)

Definition at line 150 of file ifx_i2c_config.h.

◆ IFX_I2C_PRL_OVERHEAD_SIZE

#define IFX_I2C_PRL_OVERHEAD_SIZE   (IFX_I2C_PRL_HEADER_SIZE + IFX_I2C_PRL_MAC_SIZE)

Overhead buffer size for user buffer.

Definition at line 153 of file ifx_i2c_config.h.

◆ IFX_I2C_SESSION_CONTEXT_NONE

#define IFX_I2C_SESSION_CONTEXT_NONE   (0x33)

For no manage context operation.

Definition at line 166 of file ifx_i2c_config.h.

◆ IFX_I2C_SESSION_CONTEXT_RESTORE

#define IFX_I2C_SESSION_CONTEXT_RESTORE   (0x11)

To restore saved secure session.

Definition at line 162 of file ifx_i2c_config.h.

◆ IFX_I2C_SESSION_CONTEXT_SAVE

#define IFX_I2C_SESSION_CONTEXT_SAVE   (0x22)

To store active secure session.

Definition at line 164 of file ifx_i2c_config.h.

◆ IFX_I2C_SESSION_ERROR

#define IFX_I2C_SESSION_ERROR   (0x0108)

Protocol Stack: session error.

Definition at line 110 of file ifx_i2c_config.h.

◆ IFX_I2C_SESSION_KEY_BUFFER_SIZE

#define IFX_I2C_SESSION_KEY_BUFFER_SIZE   (0x28)

Session key buffer size.

Definition at line 180 of file ifx_i2c_config.h.

◆ IFX_I2C_STACK_BUSY

#define IFX_I2C_STACK_BUSY   (0x0001)

Protocol Stack: Status codes busy.

Definition at line 100 of file ifx_i2c_config.h.

◆ IFX_I2C_STACK_ERROR

#define IFX_I2C_STACK_ERROR   (0x0102)

Protocol Stack: Status codes for error.

Definition at line 102 of file ifx_i2c_config.h.

◆ IFX_I2C_STACK_MEM_ERROR

#define IFX_I2C_STACK_MEM_ERROR   (0x0104)

Protocol Stack: Memory insufficient.

Definition at line 104 of file ifx_i2c_config.h.

◆ IFX_I2C_STACK_SUCCESS

#define IFX_I2C_STACK_SUCCESS   (0x0000)

Protocol Stack: Status codes for success.

Definition at line 98 of file ifx_i2c_config.h.

◆ IFX_I2C_TL_HEADER_OFFSET

#define IFX_I2C_TL_HEADER_OFFSET   (IFX_I2C_DL_HEADER_OFFSET + 3)

Offset of Transport header in tx_frame_buffer.

Definition at line 115 of file ifx_i2c_config.h.

◆ MASTER_PROTECTION

#define MASTER_PROTECTION   (0x01)

When data from master is protected and data from slave is unprotected.

Definition at line 171 of file ifx_i2c_config.h.

◆ NO_PROTECTION

#define NO_PROTECTION   (0x00)

When data from master and slave is unprotected.

Definition at line 169 of file ifx_i2c_config.h.

◆ PL_DATA_POLLING_INVERVAL_US

#define PL_DATA_POLLING_INVERVAL_US   (5000U)

Physical Layer: data register polling interval in microseconds.

Definition at line 64 of file ifx_i2c_config.h.

◆ PL_GUARD_TIME_INTERVAL_US

#define PL_GUARD_TIME_INTERVAL_US   (50U)

Physical Layer: guard time interval in microseconds.

Definition at line 66 of file ifx_i2c_config.h.

◆ PL_POLLING_INVERVAL_US

#define PL_POLLING_INVERVAL_US   (1000U)

Physical Layer: polling interval in microseconds.

Definition at line 60 of file ifx_i2c_config.h.

◆ PL_POLLING_MAX_CNT

#define PL_POLLING_MAX_CNT   (200U)

Physical layer: maximal attempts.

Definition at line 62 of file ifx_i2c_config.h.

◆ PL_TRANS_TIMEOUT_MS

#define PL_TRANS_TIMEOUT_MS   (10U)

Data link layer: Trans timeout in milliseconds.

Definition at line 87 of file ifx_i2c_config.h.

◆ PROTOCOL_VERSION_PRE_SHARED_SECRET

#define PROTOCOL_VERSION_PRE_SHARED_SECRET   (0x01)

Pre shared secret protocol version.

Definition at line 160 of file ifx_i2c_config.h.

◆ RE_ESTABLISH

#define RE_ESTABLISH   (0x80)

To re-establish secure channel.

Definition at line 177 of file ifx_i2c_config.h.

◆ RESET_LOW_TIME_MSEC

#define RESET_LOW_TIME_MSEC   (2000U)

Reset low time for GPIO pin toggling.

Definition at line 93 of file ifx_i2c_config.h.

◆ SLAVE_PROTECTION

#define SLAVE_PROTECTION   (0x02)

When data from master is unprotected and data from is slave protected.

Definition at line 173 of file ifx_i2c_config.h.

◆ STARTUP_TIME_MSEC

#define STARTUP_TIME_MSEC   (12000U)

Start up time.

Definition at line 95 of file ifx_i2c_config.h.

◆ TL_HEADER_SIZE

#define TL_HEADER_SIZE   (1U)

Transport Layer: header size.

Definition at line 81 of file ifx_i2c_config.h.

◆ TL_MAX_EXIT_TIMEOUT

#define TL_MAX_EXIT_TIMEOUT   (180U)

Transport layer: Maximum exit timeout in seconds.

Definition at line 90 of file ifx_i2c_config.h.

Typedef Documentation

◆ ifx_i2c_context_t

IFX I2C context structure.

Definition at line 1 of file ifx_i2c_config.h.

◆ ifx_i2c_dl_t

typedef struct ifx_i2c_dl ifx_i2c_dl_t

Datalink layer structure.

◆ ifx_i2c_event_handler_t

typedef void( * ifx_i2c_event_handler_t) (struct ifx_i2c_context *p_ctx, optiga_lib_status_t event, const uint8_t *data, uint16_t data_len)

Event handler function prototype.

Definition at line 186 of file ifx_i2c_config.h.

◆ ifx_i2c_pl_t

typedef struct ifx_i2c_pl ifx_i2c_pl_t

Physical layer structure.

◆ ifx_i2c_tl_t

typedef struct ifx_i2c_tl ifx_i2c_tl_t

Transport layer structure.

Variable Documentation

◆ ifx_i2c_context_0

ifx_i2c_context_t ifx_i2c_context_0
extern

IFX I2C Instance.