20#ifdef INC_NFC_ST25R3_H_
21#define NFC_INIT nfc_st25r3_Init
22#define NFC_IS nfc_st25r3_Is
23#define NFC_READ nfc_st25r3_ReadEEPROM
24#define NFC_ON nfc_st25r3_On
25#define NFC_OFF nfc_st25r3_Off
26#define NFC_WRITE nfc_st25r3_WriteEEPROM
27#define NFC_MAILBOX nfc_st25r3_ProcessMailBox
30#ifdef INC_NFC_ST25DV16KC_H_
31#define NFC_INIT nfc_st25dv16kc_Init
32#define NFC_IS nfc_st25dv16kc_Is
33#define NFC_READ nfc_st25dv16kc_ReadEEPROM
34#define NFC_ON nfc_st25dv16kc_On
35#define NFC_OFF nfc_st25dv16kc_Off
36#define NFC_WRITE nfc_st25dv16kc_WriteEEPROM
37#define NFC_MAILBOX nfc_st25dv16kc_ProcessMailBox
47 HAL_StatusTypeDef status = HAL_ERROR;
74 HAL_StatusTypeDef status = HAL_ERROR;
93 HAL_StatusTypeDef status = HAL_ERROR;
111 HAL_StatusTypeDef status =
NFC_INIT(hi2c);
113 if (status == HAL_OK)
122 writeLog(
"nfc_ReadSystemParams, ok");
125 writeLog(
"sensorsBase_CheckCRCMeasureNFC, CRC non valid");
131 writeLog(
"nfc_ReadSystemParams, CRC non valid");
137 writeLog(
"nfc_ReadSystemParams, sign non valid");
151 HAL_StatusTypeDef status = HAL_ERROR;
159 if (status == HAL_OK)
171 HAL_StatusTypeDef status = HAL_ERROR;
177 if (status == HAL_OK)
179 const char buf[] =
"XXXX";
191 HAL_StatusTypeDef status = HAL_ERROR;
210 HAL_StatusTypeDef status = HAL_ERROR;
222 writeLog(
"nfc_WriteMeasureData, CRC non valid");
239 writeLog(
"nfc_WriteMeasureData: %s", (status == HAL_OK) ?
"OK" :
"failed");
: 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...
#define INX_GET(nInx, nMax)
The circular index GET - for circular queue both direction Example usage:
void i2c_OnOff(uint8_t onOff)
possible to I2C turn on/off - cumulative
systemParams_t _systemParams
void sensorsBase_SetCRCMeasureNFC()
Recalculate and store the CRC in _measureNFC.Crc. Call this after modifying any field of _measureNFC ...
void systemParams_SetCRCSystemParams()
Recalculate and store the CRC in _systemParams.Crc. Call this after modifying any field of _systemPar...
void sensorsBase_MeasureNFCInit()
the default initialization of _measureNFC struct
uint8_t sensorsBase_CheckCRCMeasureNFC()
Verify the CRC field of a _measureNFC structure.
systemParams_t _systemParamsBck
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 ...
#define MEASUREDATANFC_ADDR
The address, on which is the begin of measured data in NFC. The address is modulo 4,...
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.
static HAL_StatusTypeDef nfc_ReadMeasureNFC(I2C_HandleTypeDef *hi2c)
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
static HAL_StatusTypeDef nfc_WriteMeasureNFC(I2C_HandleTypeDef *hi2c)
HAL_StatusTypeDef nfc_FactoryReset(I2C_HandleTypeDef *hi2c)
reset NFC data to factory - default state
HAL_StatusTypeDef nfc_Init(I2C_HandleTypeDef *hi2c)
NFC initialization and read NFC tag systemParams from addr 0. If data there are not valid,...
HAL_StatusTypeDef nfc_WriteMeasureData(I2C_HandleTypeDef *hi2c, const measureDataNFC_t *data)
write the measure data paylod in measureDataNFC_t to NFC on next free position - in circular queue
block of one measure data in CayennelLPP payload format The Data field contains the same payload as i...
the control block of NFC on address MEASUREDATANFC_ADDR where are stored the last measure data The EE...