|
L14-Click 1.0
STM32WLE5CC LoRaWAN Sensor Platform
|
#include "nfc.h"#include "nfc_st25dv16kc.h"#include "mysensors.h"#include "mysensors_base.h"#include "main.h"#include <string.h>Go to the source code of this file.
Macros | |
| #define | NFC_ADDR 0 |
| #define | NFC_INIT nfc_st25dv16kc_Init |
| #define | NFC_IS nfc_st25dv16kc_Is |
| #define | NFC_READ nfc_st25dv16kc_ReadEEPROM |
| #define | NFC_ON nfc_st25dv16kc_On |
| #define | NFC_OFF nfc_st25dv16kc_Off |
| #define | NFC_WRITE nfc_st25dv16kc_WriteEEPROM |
| #define | NFC_MAILBOX nfc_st25dv16kc_ProcessMailBox |
Functions | |
| static HAL_StatusTypeDef | nfc_ReadSystemParamsToBck (I2C_HandleTypeDef *hi2c) |
| reading data from NFC to _systemParamsBck | |
| HAL_StatusTypeDef | nfc_Init (I2C_HandleTypeDef *hi2c) |
| NFC initialization and read NFC tag systemParams from addr 0. If data there are not valid, the default data is written. | |
| HAL_StatusTypeDef | nfc_WriteSystemParams (I2C_HandleTypeDef *hi2c) |
| Write system params to NFC. | |
| HAL_StatusTypeDef | nfc_FactoryReset (I2C_HandleTypeDef *hi2c) |
| reset NFC data to factory - default state | |
| HAL_StatusTypeDef | nfc_ReadSystemParams (I2C_HandleTypeDef *hi2c) |
| reading _systemParams from NFC - all data will be rewrite in _systemParams | |
| HAL_StatusTypeDef | nfc_ProcessMailBox (I2C_HandleTypeDef *hi2c) |
| processing if NFC INT is fired | |
Variables | |
| static systemParams_t | _systemParamsBck = {} |
| #define NFC_ADDR 0 |
Definition at line 15 of file nfc.c.
Referenced by nfc_FactoryReset(), nfc_ReadSystemParamsToBck(), and nfc_WriteSystemParams().
| #define NFC_INIT nfc_st25dv16kc_Init |
Definition at line 30 of file nfc.c.
Referenced by nfc_Init().
| #define NFC_IS nfc_st25dv16kc_Is |
Definition at line 31 of file nfc.c.
Referenced by nfc_FactoryReset(), nfc_ReadSystemParams(), nfc_ReadSystemParamsToBck(), and nfc_WriteSystemParams().
| #define NFC_MAILBOX nfc_st25dv16kc_ProcessMailBox |
Definition at line 36 of file nfc.c.
Referenced by nfc_ProcessMailBox().
| #define NFC_OFF nfc_st25dv16kc_Off |
Definition at line 34 of file nfc.c.
Referenced by nfc_FactoryReset(), and nfc_WriteSystemParams().
| #define NFC_ON nfc_st25dv16kc_On |
Definition at line 33 of file nfc.c.
Referenced by nfc_FactoryReset(), and nfc_WriteSystemParams().
| #define NFC_READ nfc_st25dv16kc_ReadEEPROM |
Definition at line 32 of file nfc.c.
Referenced by nfc_ReadSystemParamsToBck().
| #define NFC_WRITE nfc_st25dv16kc_WriteEEPROM |
Definition at line 35 of file nfc.c.
Referenced by nfc_FactoryReset(), and nfc_WriteSystemParams().
| HAL_StatusTypeDef nfc_FactoryReset | ( | I2C_HandleTypeDef * | hi2c | ) |
reset NFC data to factory - default state
| status |
Definition at line 121 of file nfc.c.
References _tryInit, i2c_OnOff(), NFC_ADDR, NFC_IS, NFC_OFF, NFC_ON, and NFC_WRITE.
Referenced by checkResetRestart().
| HAL_StatusTypeDef nfc_Init | ( | I2C_HandleTypeDef * | hi2c | ) |
NFC initialization and read NFC tag systemParams from addr 0. If data there are not valid, the default data is written.
| status | HAL_OK, HAL_ERROR |
Definition at line 71 of file nfc.c.
References _systemParams, _systemParamsBck, NFC_INIT, nfc_ReadSystemParamsToBck(), nfc_WriteSystemParams(), systemParams_Correction(), and writeLog().
Referenced by main().
| HAL_StatusTypeDef nfc_ProcessMailBox | ( | I2C_HandleTypeDef * | hi2c | ) |
| HAL_StatusTypeDef nfc_ReadSystemParams | ( | I2C_HandleTypeDef * | hi2c | ) |
reading _systemParams from NFC - all data will be rewrite in _systemParams
| status |
Definition at line 140 of file nfc.c.
References _systemParams, _systemParamsBck, _tryInit, i2c_OnOff(), NFC_IS, and nfc_ReadSystemParamsToBck().
Referenced by checkResetRestart(), and main().
|
static |
reading data from NFC to _systemParamsBck
| HAL_OK | - the block has beep OK, HAL_ERROR NFC chip read error, HAL_TIMEOUT - CRC non valid, HAL_BUSY - the sign/version is not valid |
Definition at line 44 of file nfc.c.
References _systemParamsBck, _tryInit, NFC_ADDR, NFC_IS, NFC_READ, SYSTEMPARAMS_APPVER01, systemParams_CheckCRC(), and SYSTEMPARAMS_SIGN.
Referenced by nfc_Init(), and nfc_ReadSystemParams().
| HAL_StatusTypeDef nfc_WriteSystemParams | ( | I2C_HandleTypeDef * | hi2c | ) |
Write system params to NFC.
| status |
Definition at line 101 of file nfc.c.
References _systemParams, _tryInit, i2c_OnOff(), NFC_ADDR, NFC_IS, NFC_OFF, NFC_ON, NFC_WRITE, and systemParams_SetCRCSystemParams().
Referenced by checkResetRestart(), main(), and nfc_Init().
|
static |
Definition at line 17 of file nfc.c.
Referenced by nfc_Init(), nfc_ReadSystemParams(), and nfc_ReadSystemParamsToBck().