This file implements the wrapper API Layer for IFX I2C protocol v2.00. More...
Functions | |
optiga_lib_status_t | ifx_i2c_open (ifx_i2c_context_t *p_ctx) |
Initializes the IFX I2C protocol stack for a given context. More... | |
optiga_lib_status_t | ifx_i2c_reset (ifx_i2c_context_t *p_ctx, ifx_i2c_reset_type_t reset_type) |
Resets the I2C slave. More... | |
optiga_lib_status_t | ifx_i2c_transceive (ifx_i2c_context_t *p_ctx, const uint8_t *p_tx_data, uint16_t tx_data_length, uint8_t *p_rx_buffer, uint16_t *p_rx_buffer_len) |
Sends a command and receives a response for the command. More... | |
optiga_lib_status_t | ifx_i2c_close (ifx_i2c_context_t *p_ctx) |
Closes the IFX I2C protocol stack for a given context. More... | |
optiga_lib_status_t | ifx_i2c_set_slave_address (ifx_i2c_context_t *p_ctx, uint8_t slave_address, uint8_t persistent) |
Sets the slave address of the target device. More... | |
This file implements the wrapper API Layer for IFX I2C protocol v2.00.
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
optiga_lib_status_t ifx_i2c_close | ( | ifx_i2c_context_t * | p_ctx | ) |
Closes the IFX I2C protocol stack for a given context.
Closes the IFX I2C protocol stack for a given context.
[in,out] | p_ctx | Pointer to ifx_i2c_context_t, must not be NULL |
IFX_I2C_STACK_SUCCESS |
optiga_lib_status_t ifx_i2c_open | ( | ifx_i2c_context_t * | p_ctx | ) |
Initializes the IFX I2C protocol stack for a given context.
Initializes the IFX I2C protocol stack for the given context.
[in,out] | p_ctx | Pointer to ifx_i2c_context_t, must not be NULL |
IFX_I2C_STACK_SUCCESS | |
IFX_I2C_STACK_ERROR |
optiga_lib_status_t ifx_i2c_reset | ( | ifx_i2c_context_t * | p_ctx, |
ifx_i2c_reset_type_t | reset_type | ||
) |
Resets the I2C slave.
Resets the I2C slave and initializes the IFX I2C protocol stack for the given context.
[in,out] | p_ctx | Pointer to ifx_i2c_context_t, must not be NULL |
[in,out] | reset_type | type of reset |
IFX_I2C_STACK_SUCCESS | |
IFX_I2C_STACK_ERROR |
optiga_lib_status_t ifx_i2c_set_slave_address | ( | ifx_i2c_context_t * | p_ctx, |
uint8_t | slave_address, | ||
uint8_t | persistent | ||
) |
Sets the slave address of the target device.
Writes new I2C slave Address to the target device.
[in,out] | p_ctx | Pointer to ifx_i2c_context_t |
[in] | slave_address | Holds new slave address[7 Bit] to be set. |
[in] | persistent | 0 - To set the Slave address until next reset. Non-zero - To set the slave address to persistent memory. |
IFX_I2C_STACK_SUCCESS | |
IFX_I2C_STACK_ERROR |
optiga_lib_status_t ifx_i2c_transceive | ( | ifx_i2c_context_t * | p_ctx, |
const uint8_t * | p_tx_data, | ||
uint16_t | tx_data_length, | ||
uint8_t * | p_rx_buffer, | ||
uint16_t * | p_rx_buffer_len | ||
) |
Sends a command and receives a response for the command.
Sends a command and receives a response for the command.
[in,out] | p_ctx | Pointer to ifx_i2c_context_t, must not be NULL |
[in] | p_tx_data | Pointer to the write transmit buffer |
[in] | tx_data_length | Length of the write data buffer |
[in,out] | p_rx_buffer | Pointer to the receive data buffer |
[in,out] | p_rx_buffer_len | Pointer to the length of the receive data buffer |
IFX_I2C_STACK_SUCCESS | |
IFX_I2C_STACK_ERROR | |
IFX_I2C_STACK_MEM_ERROR | |
IFX_I2C_HANDSHAKE_ERROR | |
IFX_I2C_SESSION_ERROR |