The Infineon I2C Protocol Stack library enables communication with Infineon OPTIGA™ Trust X products. The protocol stack consists of three layers that relate to the ISO OSI (Open Systems Interconnection) model: transport, data link and physical. Beneath is a host-specific platform abstraction layer (PAL), which interfaces to a host's I2C driver or I2C peripheral.
The transport layer provides a single transceiver interface to send an application protocol data unit (APDU) to a device, and to subsequently retrieve the response APDU. The layer is responsible for chaining, i.e., fragmenting APDUs larger than the maximum packet size, and reassembling received packets back into APDUs.
Therefore, the TL provides a single transceive function to asynchronously send an APDU and receive the respective response APDU: ifx_i2c_tl_transceive().
The transport layer must be initialized by the higher layer using the ifx_i2c_tl_init() function.
The data link layer provides error correction on top of the physical layer's raw transmission facility.
Therefore, the DL provides two functions to asynchronously send and receive error-free data frames:
The data link layer must be initialized by the higher layer using the ifx_i2c_dl_init() function.
The physical layer provides two functions to asynchronously send and receive raw data frames:
Internally, the PL accesses registers on the Trust X device:
The physical layer is intended to be initialized by the higher layer using the ifx_i2c_pl_init() function.
The PAL separates hardware-specific APIs and module interfaces from the portable and platform-independent implementation of the Infineon I2C Protocol Stack Library.
The nRF52-specific implementation of the Infineon I2C PAL module can be found in the following files:
pal_gpio.c
pal_i2c.c
pal_ifx_i2c_config.c
pal_os_event.c
pal_os_timer.c
The PAL implementation for nRF52 uses the TWI transaction manager (nrf_twi_mngr.h
) as interface to the I2C hardware.