![]() |
NHS31xx SW API
|
The Therapy Adherence Therapy Component is responsible for managing the therapy adherence status. It makes use of:
Via the Therapy Component, other components can:
Modules | |
Sensing Component | |
Data Structures | |
struct | THERAPY_PILLREMOVAL_INFO_T |
Macros | |
#define | THERAPY_MAX_REMOVALS 36 |
Enumerations | |
enum | THERAPY_STATE_T { THERAPY_STATE_ID_NOTSTARTED = 0x10, THERAPY_STATE_ID_ONGOING = 0x11, THERAPY_STATE_ID_STOPPED = 0x12 } |
Functions | |
void | Therapy_Init (void) |
void | Therapy_DeInit (void) |
THERAPY_STATE_T | Therapy_GetState (void) |
uint32_t | Therapy_GetStartTime (void) |
uint32_t | Therapy_GetCheckPeriod (void) |
int | Therapy_GetInitialPillCount (void) |
int | Therapy_GetIntakeCount (void) |
uint32_t | Therapy_GetLastIntakeTime (void) |
void | Therapy_Start (uint32_t start, uint32_t interval) |
void | Therapy_Reset (void) |
void | Therapy_Stop (void) |
void | Therapy_Update (void) |
struct THERAPY_PILLREMOVAL_INFO_T |
All information required to be recorded when a pill removal occurs:, i.e. when a pill removal has been detected.
#define THERAPY_MAX_REMOVALS 36 |
Maximum pill removals to be tracked. This number is defined by HW. The maximum capacity is obtained by a 6x6 matrix. (GPIO)
enum THERAPY_STATE_T |
A list of all possible states a therapy can be in. As state data will be stored in EEPROM, make sure the reset value (0x00) is not a valid state id.
void Therapy_Init | ( | void | ) |
Init function for the therapy module. It makes sure that internal status info is retrieved from memory.
void Therapy_DeInit | ( | void | ) |
De-Init function for the therapy module. It makes sure that internal status info is stored in memory.
THERAPY_STATE_T Therapy_GetState | ( | void | ) |
Function to get the current state of the therapy.
uint32_t Therapy_GetStartTime | ( | void | ) |
Function to get the start time of the therapy (expressed in epoch seconds). .
uint32_t Therapy_GetCheckPeriod | ( | void | ) |
Function to get the period on which the therapy needs to be updated (pill removal check).
int Therapy_GetInitialPillCount | ( | void | ) |
Function to get the amount of pills present at start of therapy.
int Therapy_GetIntakeCount | ( | void | ) |
Function to get the amount of pill intakes currently recorded.
uint32_t Therapy_GetLastIntakeTime | ( | void | ) |
Function to get the last experienced pill removal time (expressed in epoch seconds).
void Therapy_Start | ( | uint32_t | start, |
uint32_t | interval | ||
) |
Starts a new therapy
start | : The time (expressed in epoch seconds) at which the therapy is started |
interval | : The interval at which an update of the therapy status is needed. |
void Therapy_Reset | ( | void | ) |
Resets the therapy (Pristine state) All Status data is reseted, Therapy state is set to THERAPY_STATE_ID_NOTSTARTED.
void Therapy_Stop | ( | void | ) |
Stops the therapy (All pills removed) Therapy state is set to THERAPY_STATE_ID_STOPPED, restarting the Therapy is not possible, this is since from the moment the Therapy is stopped knowledge of current time is lost.
void Therapy_Update | ( | void | ) |
Updates the therapy's status, it will check (via the sense module) if since the last call, extra pills where removed and will update its status accordingly. If all pills are taken, Therapy will be stopped THERAPY_STATE_ID_STOPPED