NHS31xx SW API

Detailed Description

This part is responsible for providing a normalized and simplified interface from the Sensing component to the principle depending implementation. The specific part is responsible for the measuring principle (implementation) and for the board setup.

Groups
The specific part defines the board setup, to do this , it divides the available pills into groups. A group is defined by its drive line, the number of available groups can be obtained by calling SenseSpecific_GetAmountOfGroups. For a specific group, the initial available pills can be obtained via SenseSpecific_InitialPillCount, the present pills can be obtained via SenseSpecific_GetPillsInGroup.

Modules

 Diversity settings for the GPIO sensing principle
 

Functions

void SenseSpecific_Init (void)
 
void SenseSpecific_DeInit (void)
 
int SenseSpecific_GetAmountOfGroups (void)
 
uint32_t SenseSpecific_GetPillsInGroup (int group, uint16_t *pStatus, bool calibrated)
 
int SenseSpecific_InitialPillCount (int group)
 
bool SenseSpecific_GroupPositional (int group)
 

Function Documentation

◆ SenseSpecific_Init()

void SenseSpecific_Init ( void  )

Function initializes all needed HW blocks.

◆ SenseSpecific_DeInit()

void SenseSpecific_DeInit ( void  )

Function DeInitializes all used HW blocks.

◆ SenseSpecific_GetAmountOfGroups()

int SenseSpecific_GetAmountOfGroups ( void  )

Function to get the number of groups from the specific implementation, needed to call SenseSpecific_GetPillsInGroup for each available group.

Returns
The number of groups available in the current setup (board/foil dependent).
Precondition
SenseSpecific_Init is called

◆ SenseSpecific_GetPillsInGroup()

uint32_t SenseSpecific_GetPillsInGroup ( int  group,
uint16_t *  pStatus,
bool  calibrated 
)

Function to get the pill bitmap of pills in a group. Depending on the sensing principal, the corresponding specific implementation will perform all needed to determine this value.

Parameters
group: The group number for which the pill value is asked.
pStatus[in/out] : A pointer to a status field to be used internally in this function. Its up to the specific implementation to decide whether this parameter is used or not, it can be used to store a calibration value. It's up to the higher level to make sure to preserve this value. It's up to the higher level(s) to make sure this field is preserved between two consecutive calls to SenseSpecific_GetPillsInGroup.
calibrated: Flag indicating whether the requested group is calibrated, iow.: pStatus holds a valid value. Only the very first time this function is called (at the beginning of the lifetime), this bool should be set false.
Returns
A bitmap with a set bit for each pill present in the group.

◆ SenseSpecific_InitialPillCount()

int SenseSpecific_InitialPillCount ( int  group)

Helper function returning the initial pill count of a specific group.

Parameters
group: Group of which the initial pill count is requested.
Returns
Initial number of pills for group

◆ SenseSpecific_GroupPositional()

bool SenseSpecific_GroupPositional ( int  group)

Helper function returning whether a specific group is positional.

Parameters
group: Group of which one likes to know if it is positional.
Returns
  • true if in group, pills are being monitored positional, this means that for each pill removal the sense module will know exactly which pill was removed, pills are monitored individually.
  • false, if for group only the amount of present/removed pills is known, pills are monitored as a group not individually.