OPTIGA™ Trust M
Host Library Documentation
|
This file defines the structures and macros for the Infineon I2C Protocol. More...
#include "optiga/pal/pal_i2c.h"
#include "optiga/pal/pal_gpio.h"
#include "optiga/pal/pal_os_timer.h"
#include "optiga/pal/pal_os_datastore.h"
#include "optiga/optiga_lib_config.h"
#include "optiga/common/optiga_lib_logger.h"
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... | |
This file defines the structures and macros for the Infineon I2C Protocol.
Definition in file ifx_i2c_config.h.
#define DL_HEADER_SIZE (5U) |
Data link layer: header size.
Definition at line 83 of file ifx_i2c_config.h.
#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.
#define FULL_PROTECTION (0x03) |
When data from master and slave protected.
Definition at line 175 of file ifx_i2c_config.h.
#define IFX_I2C_BASE_ADDR (0x30) |
I2C slave address of the Infineon device.
Definition at line 57 of file ifx_i2c_config.h.
#define IFX_I2C_DATA_OFFSET (IFX_I2C_PRL_HEADER_SIZE) |
Offset for data.
Definition at line 155 of file ifx_i2c_config.h.
#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.
#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.
#define IFX_I2C_FRAME_SIZE (277U) |
Data link layer: frame size (max supported is 277 in OPTIGA ).
Definition at line 77 of file ifx_i2c_config.h.
#define IFX_I2C_HANDSHAKE_ERROR (0x0107) |
Protocol Stack: handshake error.
Definition at line 108 of file ifx_i2c_config.h.
#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.
#define IFX_I2C_LOG_ID_DL (0x01) |
Log ID number for data link layer.
Definition at line 128 of file ifx_i2c_config.h.
#define IFX_I2C_LOG_ID_PAL (0x04) |
Log ID number for platform abstraction layer.
Definition at line 134 of file ifx_i2c_config.h.
#define IFX_I2C_LOG_ID_PL (0x00) |
Log ID number for physical layer.
Definition at line 126 of file ifx_i2c_config.h.
#define IFX_I2C_LOG_ID_PRL (0x03) |
Log ID number for presentation layer.
Definition at line 132 of file ifx_i2c_config.h.
#define IFX_I2C_LOG_ID_TL (0x02) |
Log ID number for transport layer.
Definition at line 130 of file ifx_i2c_config.h.
#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.
#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.
#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.
#define IFX_I2C_PRESENCE_BIT (0x00) |
Definition at line 149 of file ifx_i2c_config.h.
#define IFX_I2C_PRESENCE_BIT_CHECK (0x00) |
Definition at line 156 of file ifx_i2c_config.h.
#define IFX_I2C_PRL_HEADER_SIZE (0x00) |
Definition at line 151 of file ifx_i2c_config.h.
#define IFX_I2C_PRL_MAC_SIZE (0x00) |
Definition at line 150 of file ifx_i2c_config.h.
#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.
#define IFX_I2C_SESSION_CONTEXT_NONE (0x33) |
For no manage context operation.
Definition at line 166 of file ifx_i2c_config.h.
#define IFX_I2C_SESSION_CONTEXT_RESTORE (0x11) |
To restore saved secure session.
Definition at line 162 of file ifx_i2c_config.h.
#define IFX_I2C_SESSION_CONTEXT_SAVE (0x22) |
To store active secure session.
Definition at line 164 of file ifx_i2c_config.h.
#define IFX_I2C_SESSION_ERROR (0x0108) |
Protocol Stack: session error.
Definition at line 110 of file ifx_i2c_config.h.
#define IFX_I2C_SESSION_KEY_BUFFER_SIZE (0x28) |
Session key buffer size.
Definition at line 180 of file ifx_i2c_config.h.
#define IFX_I2C_STACK_BUSY (0x0001) |
Protocol Stack: Status codes busy.
Definition at line 100 of file ifx_i2c_config.h.
#define IFX_I2C_STACK_ERROR (0x0102) |
Protocol Stack: Status codes for error.
Definition at line 102 of file ifx_i2c_config.h.
#define IFX_I2C_STACK_MEM_ERROR (0x0104) |
Protocol Stack: Memory insufficient.
Definition at line 104 of file ifx_i2c_config.h.
#define IFX_I2C_STACK_SUCCESS (0x0000) |
Protocol Stack: Status codes for success.
Definition at line 98 of file ifx_i2c_config.h.
#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.
#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.
#define NO_PROTECTION (0x00) |
When data from master and slave is unprotected.
Definition at line 169 of file ifx_i2c_config.h.
#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.
#define PL_GUARD_TIME_INTERVAL_US (50U) |
Physical Layer: guard time interval in microseconds.
Definition at line 66 of file ifx_i2c_config.h.
#define PL_POLLING_INVERVAL_US (1000U) |
Physical Layer: polling interval in microseconds.
Definition at line 60 of file ifx_i2c_config.h.
#define PL_POLLING_MAX_CNT (200U) |
Physical layer: maximal attempts.
Definition at line 62 of file ifx_i2c_config.h.
#define PL_TRANS_TIMEOUT_MS (10U) |
Data link layer: Trans timeout in milliseconds.
Definition at line 87 of file ifx_i2c_config.h.
#define PROTOCOL_VERSION_PRE_SHARED_SECRET (0x01) |
Pre shared secret protocol version.
Definition at line 160 of file ifx_i2c_config.h.
#define RE_ESTABLISH (0x80) |
To re-establish secure channel.
Definition at line 177 of file ifx_i2c_config.h.
#define RESET_LOW_TIME_MSEC (2000U) |
Reset low time for GPIO pin toggling.
Definition at line 93 of file ifx_i2c_config.h.
#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.
#define STARTUP_TIME_MSEC (12000U) |
Start up time.
Definition at line 95 of file ifx_i2c_config.h.
#define TL_HEADER_SIZE (1U) |
Transport Layer: header size.
Definition at line 81 of file ifx_i2c_config.h.
#define TL_MAX_EXIT_TIMEOUT (180U) |
Transport layer: Maximum exit timeout in seconds.
Definition at line 90 of file ifx_i2c_config.h.
typedef struct ifx_i2c_context ifx_i2c_context_t |
IFX I2C context structure.
Definition at line 1 of file ifx_i2c_config.h.
typedef struct ifx_i2c_dl ifx_i2c_dl_t |
Datalink layer structure.
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.
typedef struct ifx_i2c_pl ifx_i2c_pl_t |
Physical layer structure.
typedef struct ifx_i2c_tl ifx_i2c_tl_t |
Transport layer structure.
|
extern |
IFX I2C Instance.