19#ifdef INC_NFC_ST25R3_H_
20#define NFC_INIT nfc_st25r3_Init
21#define NFC_IS nfc_st25r3_Is
22#define NFC_READ nfc_st25r3_ReadEEPROM
23#define NFC_ON nfc_st25r3_On
24#define NFC_OFF nfc_st25r3_Off
25#define NFC_WRITE nfc_st25r3_WriteEEPROM
26#define NFC_MAILBOX nfc_st25r3_ProcessMailBox
29#ifdef INC_NFC_ST25DV16KC_H_
30#define NFC_INIT nfc_st25dv16kc_Init
31#define NFC_IS nfc_st25dv16kc_Is
32#define NFC_READ nfc_st25dv16kc_ReadEEPROM
33#define NFC_ON nfc_st25dv16kc_On
34#define NFC_OFF nfc_st25dv16kc_Off
35#define NFC_WRITE nfc_st25dv16kc_WriteEEPROM
36#define NFC_MAILBOX nfc_st25dv16kc_ProcessMailBox
46 HAL_StatusTypeDef status = HAL_ERROR;
71HAL_StatusTypeDef
nfc_Init(I2C_HandleTypeDef *hi2c)
73 HAL_StatusTypeDef status =
NFC_INIT(hi2c);
84 writeLog(
"nfc_ReadSystemParams, ok");
87 writeLog(
"nfc_ReadSystemParams, CRC non valid");
91 writeLog(
"nfc_ReadSystemParams, sign non valid");
103 HAL_StatusTypeDef status = HAL_ERROR;
111 if (status == HAL_OK)
123 HAL_StatusTypeDef status = HAL_ERROR;
129 if (status == HAL_OK)
131 const char buf[] =
"XXXX";
142 HAL_StatusTypeDef status = HAL_ERROR;
: Header for main.c file. This file contains the common defines of the application.
void writeLog(const char *format,...)
Format and send a log message over UART (printf-style). Available only when WRITELOG is defined; comp...
void i2c_OnOff(uint8_t onOff)
possible to I2C turn on/off - cumulative
systemParams_t _systemParams
void systemParams_SetCRCSystemParams()
Recalculate and store the CRC in _systemParams.Crc. Call this after modifying any field of _systemPar...
uint8_t systemParams_CheckCRC(const systemParams_t *par)
Verify the CRC field of a systemParams_t structure.
#define SYSTEMPARAMS_SIGN
4-byte ASCII signature stored at offset 0 of systemParams_t to validate data integrity.
#define SYSTEMPARAMS_APPVER01
Application firmware major version number (plain integer) - check of validity struct together with SY...
void systemParams_Correction()
Clamp all RW fields of _systemParams to their valid ranges. Called after loading parameters from NFC ...
static HAL_StatusTypeDef nfc_ReadSystemParamsToBck(I2C_HandleTypeDef *hi2c)
reading data from NFC to _systemParamsBck
HAL_StatusTypeDef nfc_WriteSystemParams(I2C_HandleTypeDef *hi2c)
Write system params to NFC.
HAL_StatusTypeDef nfc_ProcessMailBox(I2C_HandleTypeDef *hi2c)
processing if NFC INT is fired
HAL_StatusTypeDef nfc_ReadSystemParams(I2C_HandleTypeDef *hi2c)
reading _systemParams from NFC - all data will be rewrite in _systemParams
HAL_StatusTypeDef nfc_FactoryReset(I2C_HandleTypeDef *hi2c)
reset NFC data to factory - default state
static systemParams_t _systemParamsBck
HAL_StatusTypeDef nfc_Init(I2C_HandleTypeDef *hi2c)
NFC initialization and read NFC tag systemParams from addr 0. If data there are not valid,...
System configuration parameters – persisted in NFC EEPROM at address 0. The structure contains all mo...