* Note: the length is not fixed,which can be changed */ uint8_t cendricConfigDev[15] = { 0x08, 0x02, 0x04, 0x40, 0x21, 0x01, 0xD5, 0xFF, 0x10, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF }; uint8_t cendricConfigAdvanced[6] = { 0x03, 0xBB, 0xB3, 0xE5, 0x15, 0xF2 }; uint8_t cendricConfigDrv[14] = { 0xED, 0x02, 0x28, 0x44, 0xED, 0x28, 0xF0, 0x10, 0x82, 0x38, 0x3F, 0xEB, 0x30, 0xF0 }; uint8_t cendricImpLearning[5] = { 0x04, 0x01, 0x20, 0x04, 0x05 }; uint8_t cendricDiagResp[1] = { 0x02 }; uint8_t cendricClrRstnRst[1] = { 0x01 }; …… /* starts PKE LF frame transmission at tx1(High Power Mode) with 1Ap */ /* HPDR mode TX1-TX2 */ Cendric_CMD_CONFIG_DEVICE(1, cendricConfigDev, sizeof(cendricConfigDev)); /* This will bring the LF driver duty cycle closer to the target value of 40% */ Cendric_CMD_CONFIG_ADVANCED(1, cendricConfigAdvanced, sizeof(cendricConfigAdvanced)); /* set initial ZEFF = 10 Ohm, initial inductance value = 345uH */ Cendric_CMD_CONFIG_DRIVER(0, cendricConfigDrv, sizeof(cendricConfigDrv)); Cendric_CMD_NOP(0); Cenric_RESP(cendricRespData, CENDRIC_SPI_LENGTH); /* Antenna TX1 impedance learning (384us CW without regulation) */ Cendric_CMD_START_LF_TRANSMIT_DATA(1, cendricImpLearning, sizeof(cendricImpLearning)); /* Wait for IRQ in 50ms */ if( timeout == wait_Irq(50)) { return pkeTask_False; } Cendric_CMD_NOP(0); Cenric_RESP(cendricRespData, CENDRIC_SPI_LENGTH); /* get diagnostics information */ Cendric_CMD_GET_DEVICE_INFO(0, cendricDiagResp, sizeof(cendricDiagResp)); Cendric_CMD_NOP(0); Cenric_RESP(cendricRespData, CENDRIC_SPI_LENGTH); /* Wait at minimum 20ms between learning and 1st LF telegram */ Delay_ms(20); |