|
L14-Click 1.0
STM32WLE5CC LoRaWAN Sensor Platform
|
Go to the source code of this file.
Enumerations | |
| enum | sens_ProcessDef_t { SENS_BEGIN = 0 , SENS_INIT , SENS_START , SENS_READ , SENS_STOP , SENS_DATAREADY , SENS_SERVICE , SENS_END , SENS_DONE } |
| State machine states for the sensor reading process. More... | |
Functions | |
| void | sensors_Init (I2C_HandleTypeDef *hi2c) |
| Initialization of all sensors, must be called before for store of hi2c handler. | |
| void | sensorsSeq_Init (uint32_t sensortAppBit, uint32_t mylorawanAppBit) |
| the sensors sequencer initialization and set the process in sequencer | |
| void | sensors_CopyToBck () |
| The copying data from current sensors buffer to backUp - _bck_XXXXX. | |
| uint8_t * | sensors_CayennelFromBckData (uint8_t *sizeOut) |
| collecting sensor data into CayenneLppGetBuffer buffer for sending them via LoRa the methods works with _bck_XXXXX senzor, not with real | |
| void | sensors_WriteFromBckToDataBlock (mems_DataBlock_t *data) |
| filling the data block from sensor data - store to memory the methods works with _bck_XXXXX senzor, not with real at the begin is writte the timeout of sensor measuring in minutes * 100 | |
| uint8_t | sensors_ReadToBckFromDataBlock (const mems_DataBlock_t *data) |
| reading from memory block and filling specified sensor from memory - ready for sensors_CayennelData the methods works with _bck_XXXXX senzor, not with real | |
| void | sensors_Retiming () |
| the System goes to OFF mode - retiming of timer sensor reading | |
| void | i2c_OnOff (uint8_t onOff) |
| possible to I2C turn on/off - cumulative | |
| void | sensors_Start () |
| |
| sens_ProcessDef_t | sensors_Work () |
| |
| enum sens_ProcessDef_t |
State machine states for the sensor reading process.
The state machine is driven either by the sequencer (timer-based) or by direct polling via sensors_Start() / sensors_Work(). It progresses sequentially through the states; completion is signalled when SENS_DONE is returned.
Definition at line 25 of file mysensors.h.
| void i2c_OnOff | ( | uint8_t | onOff | ) |
possible to I2C turn on/off - cumulative
Definition at line 184 of file mysensors.c.
References _i2cOnOff, MX_I2C2_DeInit(), and MX_I2C2_Init().
Referenced by main(), nfc_FactoryReset(), nfc_ReadSystemParams(), nfc_WriteSystemParams(), and sensors_Work().
| uint8_t * sensors_CayennelFromBckData | ( | uint8_t * | sizeOut | ) |
collecting sensor data into CayenneLppGetBuffer buffer for sending them via LoRa the methods works with _bck_XXXXX senzor, not with real
| sizeOut | - the size(bytes) in buffer, the size is max 254, uint8_t is enough |
| address | of buffer or null, if no data |
Definition at line 469 of file mysensors.c.
References _bck_amb_tsl2591Data, _bck_bar_bmp585Data, _bck_bar_ils22qsData, _bck_scd41Data, _bck_sps30Data, _bck_tmphm_sht45Data, _sensorMeasureTime, CayenneLppAddBarometricPressure(), CayenneLppAddConcentration(), CayenneLppAddLuminosity(), CayenneLppAddMeasureInterval(), CayenneLppAddParticulateMatter_1_0(), CayenneLppAddParticulateMatter_2_5(), CayenneLppAddRelativeHumidity(), CayenneLppAddTemperature(), CayenneLppAddVoltage(), CayenneLppGetBuffer(), CayenneLppGetSize(), CayenneLppReset(), and GetBatteryLevel().
Referenced by myloraWan_PrepareSendingBuffer().
| void sensors_CopyToBck | ( | ) |
The copying data from current sensors buffer to backUp - _bck_XXXXX.
Definition at line 447 of file mysensors.c.
References _amb_tsl2591Data, _bar_bmp585Data, _bar_ils22qsData, _bck_amb_tsl2591Data, _bck_bar_bmp585Data, _bck_bar_ils22qsData, _bck_scd41Data, _bck_sps30Data, _bck_tmphm_sht45Data, _scd41Data, _sps30Data, and _tmphm_sht45Data.
Referenced by myloraWan_MeasureFinish().
| void sensors_Init | ( | I2C_HandleTypeDef * | hi2c | ) |
Initialization of all sensors, must be called before for store of hi2c handler.
| hi2c |
Definition at line 399 of file mysensors.c.
References _hi2c, _sensors, getCount_Sensors(), SENS_GRP_ALL, sensors_OnOff(), systemParams_IsSensorAvaiable(), and writeLog().
Referenced by main(), and sensors_Work().
| uint8_t sensors_ReadToBckFromDataBlock | ( | const mems_DataBlock_t * | data | ) |
reading from memory block and filling specified sensor from memory - ready for sensors_CayennelData the methods works with _bck_XXXXX senzor, not with real
| size | of total read from data block, 0 - if is other than expected data |
Definition at line 575 of file mysensors.c.
References _bck_amb_tsl2591Data, _bck_bar_bmp585Data, _bck_bar_ils22qsData, _bck_scd41Data, _bck_sps30Data, _bck_tmphm_sht45Data, _sensorMeasureTime, mems_DataBlock_t::Data, MEMS_DATATYPE_SENSOR, and mems_DataBlock_t::Type.
Referenced by myloraWan_PrepareSendingBuffer().
| void sensors_Retiming | ( | ) |
the System goes to OFF mode - retiming of timer sensor reading
Definition at line 424 of file mysensors.c.
References _sensorTimerReading, and _systemParams.
Referenced by sensorsBase_StopTimerToOff().
| void sensors_Start | ( | ) |
Definition at line 319 of file mysensors.c.
References _groupInxTiming, _groupReadCount, _processDef, _processDelay, SENS_BEGIN, sensors_NextGroup(), and sleeper_SetSleepMS().
Referenced by tasksensors_OnTimeout().
| sens_ProcessDef_t sensors_Work | ( | ) |
| SENS_DONE | - process of reading finished, otherwise current state of status machine |
Definition at line 328 of file mysensors.c.
References _groupInxTiming, _groupReadCount, _groupTiming, _processDef, _processDelay, i2c_OnOff(), SENS_BEGIN, SENS_DATAREADY, SENS_DONE, SENS_END, SENS_INIT, SENS_READ, SENS_SERVICE, SENS_START, SENS_STOP, sensors_Init(), sensors_NextGroup(), sensors_OnOff(), sensors_Read(), sensors_Service(), sleeper_IsElapsed(), sleeper_Next(), sleeper_SetSleepMS(), and togle_LedOff().
Referenced by tasksensors_Work().
| void sensors_WriteFromBckToDataBlock | ( | mems_DataBlock_t * | data | ) |
filling the data block from sensor data - store to memory the methods works with _bck_XXXXX senzor, not with real at the begin is writte the timeout of sensor measuring in minutes * 100
Definition at line 530 of file mysensors.c.
References _bck_amb_tsl2591Data, _bck_bar_bmp585Data, _bck_bar_ils22qsData, _bck_scd41Data, _bck_sps30Data, _bck_tmphm_sht45Data, _sensorMeasureTime, _systemParams, mems_DataBlock_t::Data, Error_Handler(), MEMS_DATATYPE_SENSOR, SENSORS_DATASIZE, mems_DataBlock_t::Size, mems_DataBlock_t::Type, and writeLog().
Referenced by myloraWan_MeasureFinish().
| void sensorsSeq_Init | ( | uint32_t | sensortAppBit, |
| uint32_t | mylorawanAppBit ) |
the sensors sequencer initialization and set the process in sequencer
| sensortAppBit | - bit for task |
| mylorawanAppBit | - bit for event firing |
the sensors sequencer initialization and set the process in sequencer
Definition at line 436 of file mysensors.c.
References _mylorawanSeqID, _sensorSeqID, _sensorTimerReading, _systemParams, tasksensors_OnTimeout(), and tasksensors_Work().
Referenced by main().