Hello everyone,
I am trying to implement the OPTIGA Trust M from Infineon with the nrf9160. Unfortunately I encountered some problems regarding this topic.
I am trying to communicate with the Optiga Chip via I2C in Master Mode and I am trying to use the Optiga library acquired here: Library.
So far I successfully got the device binding for the I2C_1 with the following configurations:
prj.conf :
# Enable I2C/TWI CONFIG_I2C=y CONFIG_I2C_1=y
i2c-init:
optiga_pal_i2c_context_0.p_i2c_hw_config = device_get_binding("I2C_1"); optiga_pal_i2c_context_0.slave_address = 0x30; if (optiga_pal_i2c_context_0.p_i2c_hw_config == NULL) { printk("\nERROR: I2C device binding \n"); return; } ret = i2c_configure(optiga_pal_i2c_context_0.p_i2c_hw_config, (I2C_SPEED_FAST<<1) | I2C_MODE_MASTER); if(ret != PAL_I2C_EVENT_SUCCESS) { printk("\nERROR: I2C Master and Speed set failed.\n"); return; }
So far this seams to be working. Unfortunately the Optiga library needs certain callbacks, which are end_of_transmit and end_of_receive.
The drivers/i2c.h library only lists such callbacks for slave configuration, but not for the Master configuration.
So my question is if there are such callbacks for the I2C Master mode.
Best regards,
Andreas