Hallo Daniel,
Thank you very much for the configuration
I did configuration and send the first packet like below
const lpi2c_master_user_config_t lpi2c1_MasterConfig0 = {
.slaveAddress = 72U,
.is10bitAddr = false,
.operatingMode = LPI2C_FAST_MODE,
.baudRate = 400000U,
.transferType = LPI2C_USING_INTERRUPTS,
.dmaChannel = 0U,
.masterCallback = NULL,
.callbackParam = NULL,
};
/* Allocate memory for the LPI2C driver state structure */
lpi2c_master_state_t lpi2c1MasterState;
/* Initialize LPI2C Master configuration
* - Slave address 0x48
* - Fast operating mode, 400 KHz SCL frequency
* - See LPI2C components for configuration details
*/
LPI2C_DRV_MasterInit(INST_LPI2C1, &lpi2c1_MasterConfig0, &lpi2c1MasterState);
Enable_Crypto();
uint32_t bytesRem;
status_t txStatus;
#if 1
uint8_t reset_packet[5] = { //for soft reset request
0x5A, // NAD
0xCF, // PCB for reset
0x00, // LEN is 0 no INF
0x37, // CRC 1
0x7F // CRC 2
};
LPI2C_DRV_MasterSendData(INST_LPI2C1,reset_packet,sizeof(reset_packet),true);
OS_Delay(100); // waited 300msec
txStatus = LPI2C_DRV_MasterGetTransferStatus(INST_LPI2C1,&bytesRem);
if(txStatus != STATUS_SUCCESS)
{
printf("******* I2C Data sent failed %d %d*****\n", txStatus, bytesRem );
}
else
{
printf("####### Data sent succesfully #######\n");
}
I am able to send the data and hopefully it soft resets the SE050.
Now I want to read data(version) from SE050 so, please help me here what payload should I send??
can I also send immediately another send request with this data
uint8_t versionPacket[] = { 0x5A, // NAD
0x20, // PCB
0x05, // LEN
0x80, // CLA
0x04, // INS
0x00, // P1
0x20, // P2
//0x00, // Lc
0x09, // Le
0x66, // CRC1
0xAA //CRC2
};
Best Regards,
Sai
@danielmartynek @Kan_Li