10#ifndef INC_MYSENSORS_BASE_H_
11#define INC_MYSENSORS_BASE_H_
26#define SYSTEMPARAMS_SIGN "MTTV"
31#define SZ_SYSTEMPARAMS 90
34#define SYSTEMPARAMS_STRUCTVER 1
37#define SYSTEMPARAMS_APPVER00 0x01
40#define SYSTEMPARAMS_APPVER01 0x01
43#define SYSTEMPARAMS_DEFAULTALTITUDE 300
46#define SYSTEMPARAMS_MINSENSORTIME 30000
49#define SYSTEMPARAMS_DEFAULTSENSORTIME 60*1000*10
52#define SYSTEMPARAMS_MAXSENSORTIME 60*1000*60*18
59#define SYSTEMPARAMS_MINTIME2OFF 10000
63#define SYSTEMPARAMS_MINLORAWANPORT 1
66#define SYSTEMPARAMS_DEFAULTLORAWANPORT 2
69#define SYSTEMPARAMS_MAXLORAWANPORT 223
73#define SYSTEM_APP_EUI 00,00,00,00,00,00,00,00
76#define SYSTEM_APP_KEY AB,CD,EF,01,02,03,10,11,12,05,06,07,EF,EF,EF,EF
79#define SYSTEM_APP_DevEUI0 0x45
81#define SYSTEM_APP_DevEUI1 0x87
83#define SYSTEM_APP_DevEUI2 0xF2
269#define systemParams_Log(...)
281 #define SIZE_SHT45 sizeof(tmphm_sht45_t)
286#ifdef SENSOR_AMB_TSL2591
288 #define SIZE_TSL2591 sizeof(amb_tsl2591_t)
290 #define SIZE_TSL2591 0
293#ifdef SENSOR_BAR_ILS22QS
295 #define SIZE_ILS22QS sizeof(bar_ils22qs_t)
297 #define SIZE_ILS22QS 0
300#ifdef SENSOR_BAR_BMP585
302 #define SIZE_BMP585 sizeof(bar_bmp585_t)
304 #define SIZE_BMP585 0
309 #define SIZE_SCD41 sizeof(scd41_t)
316 #define SIZE_SPS30 sizeof(sps30_t)
329#define SENSORS_DATASIZE (\
void sensorsBase_StartTimerToOff()
start timer to off the function is called from PWR_EnterStopMode - timer is started
systemParams_t _systemParams
uint8_t * systemParams_getAppKey()
Return a pointer to the AppKey stored in _systemParams. Used by the LoRaWAN stack to derive session k...
void systemParams_SetCRCSystemParams()
Recalculate and store the CRC in _systemParams.Crc. Call this after modifying any field of _systemPar...
systemParams_Sensors_t
Bitmask of sensor modules that are enabled / available for data collection. Used in systemParams_t....
uint8_t systemParams_CalculateCrc(uint8_t *data, uint8_t len)
Calculate a CRC-8 checksum (Sensirion polynomial) over a byte buffer. Used to validate sensor I2C res...
uint8_t * systemParams_getAppEUI()
Return a pointer to the AppEUI (JoinEUI) stored in _systemParams. Used by the LoRaWAN stack during th...
uint8_t * systemParams_getAppDevEUI()
Return a pointer to the DevEUI stored in _systemParams. The DevEUI is auto-generated from the chip UI...
void sensorsBase_StopTimerToOff()
stop timer to off the function is called from PWR_ExitStopMode - the timer value is checked and the P...
uint8_t systemParams_CheckCRC(const systemParams_t *par)
Verify the CRC field of a systemParams_t structure.
void systemParams_Log(const char *info)
Log the current _systemParams fields to the UART debug output.
void systemParams_Correction()
Clamp all RW fields of _systemParams to their valid ranges. Called after loading parameters from NFC ...
void sensorsBase_Init()
Initialization of base sensor data structure.
uint8_t systemParams_IsSensorAvaiable(systemParams_Sensors_t sensorType)
Check whether a particular sensor is enabled in _systemParams.AvailableSensors.
System configuration parameters – persisted in NFC EEPROM at address 0. The structure contains all mo...
uint8_t SensAvailableSensors
uint8_t HWBatteryLevelStatus
uint8_t MemsStoreSensorData
uint16_t MemsCurrentCountSensorData
uint8_t SensSendInOnePacket
uint32_t SensTimeoutMeasure
uint8_t LoRaAdaptiveDataRate
uint16_t MemsMaxSensorData
uint8_t LoRaRepeatTryConnect