![]() |
NHS31xx SW API
|
The application can adapt the Event module to better fit the different application scenarios through the use of diversity flags in the form of defines below. Sensible defaults are chosen; to override the default settings, place the defines with their desired values in the application app_sel.h header file: the compiler will pick up your defines before parsing this file.
Additional notes regarding some flags:
These flags may be overridden/set:
These defines are fixed or derived from the above flags and may not be defined or redefined in an application:
Macros | |
#define | EVENT_EEPROM_FIRST_ROW (1024 / EEPROM_ROW_SIZE) |
#define | EVENT_EEPROM_LAST_ROW (EVENT_EEPROM_FIRST_ROW + (1024 / EEPROM_ROW_SIZE) - 1) |
#define | EVENT_EEPROM_ROW_COUNT (EVENT_EEPROM_LAST_ROW - EVENT_EEPROM_FIRST_ROW + 1) |
#define | EVENT_EEPROM_SIZE (EVENT_EEPROM_ROW_COUNT * EEPROM_ROW_SIZE) |
#define | EVENT_CB_SELF_DEFINED 1 |
#define | EVENT_CB DummyEventCb |
#define | EVENT_CB_OPENING_INDEX 0xFFFFFFFE |
#define | EVENT_CB_OPENING_CALL 0 |
#define | EVENT_CB_CLOSING_INDEX 0xFFFFFFFF |
#define | EVENT_CB_CLOSING_CALL 0 |
#define | EVENT_OVERHEAD_CHOICE_A 0x41 |
#define | EVENT_OVERHEAD_CHOICE_B 0x42 |
#define | EVENT_OVERHEAD_CHOICE_C 0x43 |
#define | EVENT_OVERHEAD_CHOICE_D 0x44 |
#define | EVENT_OVERHEAD_CHOICE_E 0x45 |
#define | EVENT_OVERHEAD_CHOICE EVENT_OVERHEAD_CHOICE_A |
#define | EVENT_OVERHEAD 6 |
#define EVENT_EEPROM_FIRST_ROW (1024 / EEPROM_ROW_SIZE) |
The first EEPROM row assigned for storing events. Starting from the first byte in this row, until the last byte in EVENT_EEPROM_LAST_ROW, the event bookkeeping module has full control: no other code may touch this EEPROM region.
#define EVENT_EEPROM_LAST_ROW (EVENT_EEPROM_FIRST_ROW + (1024 / EEPROM_ROW_SIZE) - 1) |
The last EEPROM row assigned for storing events. Starting from the first byte in EVENT_EEPROM_FIRST_ROW, until the last byte in this row, the event bookkeeping module has full control: no other code may touch this EEPROM region.
#define EVENT_EEPROM_ROW_COUNT (EVENT_EEPROM_LAST_ROW - EVENT_EEPROM_FIRST_ROW + 1) |
The number of EEPROM rows assigned for event bookkeeping.
#define EVENT_EEPROM_SIZE (EVENT_EEPROM_ROW_COUNT * EEPROM_ROW_SIZE) |
The size in bytes of the EEPROM region assigned for event bookkeeping.
#define EVENT_CB_SELF_DEFINED 1 |
Used internally to know when to use a dummy callback for this.
#define EVENT_CB DummyEventCb |
The name of the function - not a function pointer - of type pEvent_Cb_t that is able to receive the events requested by calling Event_GetByIndex, Event_GetByTime or Event_GetByTag.
#define EVENT_CB_OPENING_INDEX 0xFFFFFFFE |
Used as special index value when making an opening call.
#define EVENT_CB_OPENING_CALL 0 |
By default, the callback function defined by EVENT_CB or as set by Event_SetCb is called once per found event. Define this to have the event bookkeeping module call the callback function one extra time, before the first event is searched for and reported. This opening call then acts as a start-of-search signal to allow the application to prepare his activities.
0
, -1
, 0
, EVENT_CB_OPENING_INDEX, 0
for the arguments tag
, offset
, len
, index
, timestamp
, respectively. #define EVENT_CB_CLOSING_INDEX 0xFFFFFFFF |
Used as special index value when making an opening call.
#define EVENT_CB_CLOSING_CALL 0 |
By default, the callback function defined by EVENT_CB or as set by Event_SetCb is called once per found event. Define this to have the event bookkeeping module call the callback function one extra time, after all events have been searched for and reported. This last call then acts as an end-of-search signal to allow the application to conclude his activities.
0
, -1
, 0
, EVENT_CB_CLOSING_INDEX, 0
for the arguments tag
, offset
, len
, index
, timestamp
, respectively. #define EVENT_OVERHEAD_CHOICE_A 0x41 |
When EVENT_OVERHEAD_CHOICE is assigned this value, the overhead - defined in EVENT_OVERHEAD - is 6
This is the default value when EVENT_OVERHEAD_CHOICE is not defined in the application's app_sel.h
file.
#define EVENT_OVERHEAD_CHOICE_B 0x42 |
When EVENT_OVERHEAD_CHOICE is assigned this value, the overhead - defined in EVENT_OVERHEAD - is 5
The overhead - defined in EVENT_OVERHEAD - is 5
#define EVENT_OVERHEAD_CHOICE_C 0x43 |
When EVENT_OVERHEAD_CHOICE is assigned this value, the overhead - defined in EVENT_OVERHEAD - is 5
The overhead - defined in EVENT_OVERHEAD - is 5
#define EVENT_OVERHEAD_CHOICE_D 0x44 |
When EVENT_OVERHEAD_CHOICE is assigned this value, the overhead - defined in EVENT_OVERHEAD - is 4
The overhead - defined in EVENT_OVERHEAD - is 4
#define EVENT_OVERHEAD_CHOICE_E 0x45 |
When EVENT_OVERHEAD_CHOICE is assigned this value, the overhead - defined in EVENT_OVERHEAD - is 4
The overhead - defined in EVENT_OVERHEAD - is 4
#define EVENT_OVERHEAD_CHOICE EVENT_OVERHEAD_CHOICE_A |
For each event, a minimum number of bytes is required to correctly store the data. Depending on the needs of the application, this size can be reduced by assigning this define to one of the allowed choices:
index
passed to the caller upon retrieval - will always correctly reflect the timing order in which they occurred, regardless of the resolution of the timestamp. #define EVENT_OVERHEAD 6 |
The number of bytes that are required to be stored in excess of the extra optional data provided, per event. This value includes the space for the tag value and the timestamp. Use this value to estimate the number of events that can be stored.