![]() |
NHS31xx SW API
|
The Temperature Logger Demo Memory block gathers all accesses to data that must persist across active sessions. It will group access to:
It will maintain the current configuration, allowing access to the different parameters and states in SRAM, and ensuring the data will persist when going to Deep Power Down or Power-off states. To this end, it adds API to update the current state and convenience functions to quickly check for specific states.
Apart of the above, calls to the mentioned modules/block still need to be carried out by the application.
Data Structures | |
struct | MEMORY_CONFIG_T |
Macros | |
#define | MEMORY_FIRSTUNUSEDEEPROMOFFSET 36 |
#define | MEMORY_FIRSTUNUSEDEEPROMOFFSET 44 |
Functions | |
bool | Memory_Init (void) |
void | Memory_DeInit (void) |
const MEMORY_CONFIG_T * | Memory_GetConfig (void) |
bool | Memory_IsMonitoring (void) |
bool | Memory_IsFull (void) |
bool | Memory_BodOccurred (void) |
bool | Memory_IsReadyToStart (void) |
void | Memory_ResetConfig (const APP_MSG_CMD_SETCONFIG_T *pCmd) |
void | Memory_SetAttainedValue (int16_t value) |
void | Memory_AddToState (uint32_t events, bool ignoreWhenSet) |
void | Memory_RemoveFromState (uint32_t events) |
void | Memory_SetHumidityConfig (const APP_MSG_CMD_SETHUMIDITYCONFIG_T *pCmd) |
void | Memory_SetAttainedHumidityValue (uint16_t value) |
struct MEMORY_CONFIG_T |
Defines the constant configuration under which to operate; Also stores some data of the ongoing monitoring and logging session
Data Fields | ||
---|---|---|
APP_MSG_CMD_SETCONFIG_T | cmd |
As given by the tag reader. |
int16_t | attainedMinimum |
The absolute minimum value recorded in deci-Celsius degrees. |
int16_t | attainedMaximum |
The absolute maximum value recorded in deci-Celsius degrees. |
uint32_t | status |
An OR'd combination of APP_MSG_EVENT_T events that reflect the current state. |
uint32_t | validation |
A value solely read from and written to by validate.c file |
APP_MSG_CMD_SETHUMIDITYCONFIG_T | humidityConfig |
As given by the tag reader. |
uint16_t | attainedMinimumHumidity |
The absolute minimum value recorded in deci-Celsius degrees. |
uint16_t | attainedMaximumHumidity |
The absolute maximum value recorded in deci-Celsius degrees. |
#define MEMORY_FIRSTUNUSEDEEPROMOFFSET 36 |
The offset in EEPROM memory to the first unclaimed byte by this storage component. The EEPROM region from the very first byte up to (not including) this offset is under full control of this component and no other code is assumed to use it.
#define MEMORY_FIRSTUNUSEDEEPROMOFFSET 44 |
The offset in EEPROM memory to the first unclaimed byte by this storage component. The EEPROM region from the very first byte up to (not including) this offset is under full control of this component and no other code is assumed to use it.
bool Memory_Init | ( | void | ) |
Initialization function. Must be called first in this component.
false
is returned. When true
is returned, the contents that were set in NVM were read out and used. void Memory_DeInit | ( | void | ) |
De-Initializes the component.
const MEMORY_CONFIG_T * Memory_GetConfig | ( | void | ) |
Retrieve configuration.
bool Memory_IsMonitoring | ( | void | ) |
Helper function. Checks MEMORY_CONFIG_T.status solely.
true
if a new measurement will be made after some delay. There may be no measurements made yet. bool Memory_IsFull | ( | void | ) |
Helper function. Checks MEMORY_CONFIG_T.status solely.
true
if storage is full - based on the previous calls to Memory_AddToState - and no new measurement can be stored. bool Memory_BodOccurred | ( | void | ) |
Helper function. Checks MEMORY_CONFIG_T.status solely.
true
if a low battery voltage has been detected - using the bod HW block. bool Memory_IsReadyToStart | ( | void | ) |
Helper function. Checks MEMORY_CONFIG_T.status solely.
true
if a configuration is present but no measurement is available, nor is due. void Memory_ResetConfig | ( | const APP_MSG_CMD_SETCONFIG_T * | pCmd | ) |
Resets all parameters.
pCmd | : pointer to a structure where all new parameters are to be copied from. May be NULL . If equal to NULL , all values are reset to default values. |
void Memory_SetAttainedValue | ( | int16_t | value | ) |
Updates the attained extremities of the measured values. There is no update of MEMORY_CONFIG_T.status - Use Memory_AddToState.
value | The new value to compare against the current extremities. |
void Memory_AddToState | ( | uint32_t | events, |
bool | ignoreWhenSet | ||
) |
Updates MEMORY_CONFIG_T.status by adding bits to the bitmask.
events | An OR'd combination of APP_MSG_EVENT_T events that must be added. |
ignoreWhenSet |
|
void Memory_RemoveFromState | ( | uint32_t | events | ) |
Updates MEMORY_CONFIG_T.status by removing bits from the bitmask.
events | An OR'd combination of APP_MSG_EVENT_T events that must be removed. The bits that are not set in MEMORY_CONFIG_T.status are ignored. |
void Memory_SetHumidityConfig | ( | const APP_MSG_CMD_SETHUMIDITYCONFIG_T * | pCmd | ) |
Sets all humidity parameters.
pCmd | : pointer to a structure where all new humidity parameters are to be copied from. May be NULL . If equal to NULL , all humidity values are reset to default values. |
void Memory_SetAttainedHumidityValue | ( | uint16_t | value | ) |
Updates the attained extremities of the measured humidity values. There is no update of MEMORY_CONFIG_T.status - Use Memory_AddToState.
value | The new value to compare against the current extremities. |