Cordio Stack and Cordio Profiles  r2p3-02rel0
app_hw.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief Application framework hardware interfaces.
6  *
7  * Copyright (c) 2011-2018 Arm Ltd. All Rights Reserved.
8  * ARM Ltd. confidential and proprietary.
9  *
10  * IMPORTANT. Your use of this file is governed by a Software License Agreement
11  * ("Agreement") that must be accepted in order to download or otherwise receive a
12  * copy of this file. You may not use or copy this file for any purpose other than
13  * as described in the Agreement. If you do not agree to all of the terms of the
14  * Agreement do not use this file and delete all copies in your possession or control;
15  * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior
16  * to any use, copying or further distribution of this software.
17  */
18 /*************************************************************************************************/
19 #ifndef APP_HW_H
20 #define APP_HW_H
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 /*! \addtogroup APP_FRAMEWORK_HW_API
27  * \{ */
28 
29 /**************************************************************************************************
30  Data Types
31 **************************************************************************************************/
32 
33 /*! \brief Heart rate measurement structure */
34 typedef struct
35 {
36  uint16_t *pRrInterval; /*!< \brief Array of RR intervals */
37  uint8_t numIntervals; /*!< \brief Length of RR interval array */
38  uint16_t energyExp; /*!< \brief Energy expended value */
39  uint16_t heartRate; /*!< \brief Heart rate */
40  uint8_t flags; /*!< \brief Heart rate measurement flags */
41 } appHrm_t;
42 
43 /*! \brief Date and time structure */
44 typedef struct
45 {
46  uint16_t year; /*!< \brief Year */
47  uint8_t month; /*!< \brief Month */
48  uint8_t day; /*!< \brief Day */
49  uint8_t hour; /*!< \brief Hour */
50  uint8_t min; /*!< \brief Minutes */
51  uint8_t sec; /*!< \brief Seconds */
53 
54 /*! \brief Blood pressure measurement structure */
55 typedef struct
56 {
57  appDateTime_t timestamp; /*!< \brief Date-time */
58  uint16_t systolic; /*!< \brief Systolic pressure */
59  uint16_t diastolic; /*!< \brief Diastolic pressure */
60  uint16_t map; /*!< \brief Mean arterial pressure */
61  uint16_t pulseRate; /*!< \brief Pulse rate */
62  uint16_t measStatus; /*!< \brief Measurement status */
63  uint8_t flags; /*!< \brief Flags */
64  uint8_t userId; /*!< \brief User ID */
65 } appBpm_t;
66 
67 /*! \brief Weight scale measurement structure */
68 typedef struct
69 {
70  appDateTime_t timestamp; /*!< \brief Date-time */
71  uint16_t weight; /*!< \brief Weight */
72  uint8_t flags; /*!< \brief Weight measurement flags */
73 } appWsm_t;
74 
75 /*! \brief Temperature measurement structure */
76 typedef struct
77 {
78  appDateTime_t timestamp; /*!< \brief Date-time */
79  uint32_t temperature; /*!< \brief Temperature */
80  uint8_t flags; /*!< \brief Flags */
81  uint8_t tempType; /*!< \brief Temperature type */
82 } appTm_t;
83 
84 /*! \brief Pulse Oximeter continuous measurement structure */
85 typedef struct
86 {
87  uint8_t flags; /*!< \brief Flags */
88  uint16_t spo2; /*!< \brief SpO2PR-Spot-Check - SpO2 */
89  uint16_t pulseRate; /*!< \brief SpO2PR-Spot-Check - Pulse Rate */
90  uint16_t spo2Fast; /*!< \brief SpO2PR-Spot-Check Fast - SpO2 */
91  uint16_t pulseRateFast; /*!< \brief SpO2PR-Spot-Check Fast - Pulse Rate */
92  uint16_t spo2Slow; /*!< \brief SpO2PR-Spot-Check Slow - SpO2 */
93  uint16_t pulseRateSlow; /*!< \brief SpO2PR-Spot-Check Slow - Pulse Rate */
94  uint16_t measStatus; /*!< \brief Measurement Status */
95  uint32_t sensorStatus; /*!< \brief Device and Sensor Status */
96  uint16_t pulseAmpIndex; /*!< \brief Pulse Amplitude Index */
97 } appPlxCm_t;
98 
99 /*! \brief Pulse Oximeter spot check measurement structure */
100 typedef struct
101 {
102  uint8_t flags; /*!< \brief Flags */
103  uint16_t spo2; /*!< \brief SpO2PR-Spot-Check - SpO2 */
104  uint16_t pulseRate; /*!< \brief SpO2PR-Spot-Check - Pulse Rate */
105  appDateTime_t timestamp; /*!< \brief Timestamp */
106  uint16_t measStatus; /*!< \brief Measurement Status */
107  uint32_t sensorStatus; /*!< \brief Device and Sensor Status */
108  uint16_t pulseAmpIndex; /*!< \brief Pulse Amplitude Index */
109 } appPlxScm_t;
110 
111 /**************************************************************************************************
112  Function Declarations
113 **************************************************************************************************/
114 
115 /** \name App Hardware Interface
116  * Interface to emulated sensor of real world devices (e.g. battery, heart rate monitor,
117  * blood pressure sensor, etc.)
118  */
119 /**@{*/
120 
121 /*************************************************************************************************/
122 /*!
123  * \brief Read the battery level. The battery level value returned in pLevel is the
124  * percentage of remaining battery capacity (0-100%).
125  *
126  * \param pLevel Battery level return value.
127  *
128  * \return None.
129  */
130 /*************************************************************************************************/
131 void AppHwBattRead(uint8_t *pLevel);
132 
133 /*************************************************************************************************/
134 /*!
135  * \brief Set the battery level, for test purposes.
136  *
137  * \param level Battery level (0-100%).
138  *
139  * \return None.
140  */
141 /*************************************************************************************************/
142 void AppHwBattTest(uint8_t level);
143 
144 /*************************************************************************************************/
145 /*!
146  * \brief Perform a heart rate measurement. Return the heart rate along with any RR interval
147  * data.
148  *
149  * \param pHrm Heart rate measurement return value.
150  *
151  * \return None.
152  */
153 /*************************************************************************************************/
154 void AppHwHrmRead(appHrm_t *pHrm);
155 
156 /*************************************************************************************************/
157 /*!
158  * \brief Set the heart rate, for test purposes.
159  *
160  * \param heartRate Heart rate.
161  *
162  * \return None.
163  */
164 /*************************************************************************************************/
165 void AppHwHrmTest(uint8_t heartRate);
166 
167 /*************************************************************************************************/
168 /*!
169  * \brief Perform a blood pressure measurement. Return the measurement data.
170  *
171  * \param intermed TRUE if this is an intermediate measurement.
172  * \param pBpm Blood pressure measurement return value.
173  *
174  * \return None.
175  */
176 /*************************************************************************************************/
177 void AppHwBpmRead(bool_t intermed, appBpm_t *pBpm);
178 
179 /*************************************************************************************************/
180 /*!
181  * \brief Perform a weight scale measurement. Return the measurement data.
182  *
183  * \param pWsm Weight scale measurement return value.
184  *
185  * \return None.
186  */
187 /*************************************************************************************************/
188 void AppHwWsmRead(appWsm_t *pWsm);
189 
190 /*************************************************************************************************/
191 /*!
192  * \brief Perform a temperature measurement. Return the measurement data.
193  *
194  * \param intermed TRUE if this is an intermediate measurement.
195  * \param pTm Temperature measurement return value.
196  *
197  * \return None.
198  */
199 /*************************************************************************************************/
200 void AppHwTmRead(bool_t intermed, appTm_t *pTm);
201 
202 /*************************************************************************************************/
203 /*!
204  * \brief Set the temperature measurement units.
205  *
206  * \param units CH_TM_FLAG_UNITS_C or CH_TM_FLAG_UNITS_F.
207  *
208  * \return None.
209  */
210 /*************************************************************************************************/
211 void AppHwTmSetUnits(uint8_t units);
212 
213 
214 /*************************************************************************************************/
215 /*!
216  * \brief Set the weight measurement units.
217  *
218  * \param units CH_WSM_FLAG_UNITS_KG or CH_WSM_FLAG_UNITS_LBS.
219  *
220  * \return None.
221  */
222 /*************************************************************************************************/
223 void AppHwWmSetUnits(uint8_t units);
224 
225 /*************************************************************************************************/
226 /*!
227  * \brief Perform a pulse oximeter measurement.
228  *
229  * \param pPlxcm Pulse Oximeter measurement return value.
230  *
231  * \return None.
232  */
233 /*************************************************************************************************/
234 void AppHwPlxcmRead(appPlxCm_t *pPlxcm);
235 
236 
237 /*************************************************************************************************/
238 /*!
239  * \brief Perform a pulse oximeter spot check measurement.
240  *
241  * \param pPlxscm Pulse Oximeter measurement return value.
242  *
243  * \return None.
244  */
245 /*************************************************************************************************/
246 void AppHwPlxscmRead(appPlxScm_t *pPlxscm);
247 
248 /**@}*/
249 
250 /*! \} */ /*! APP_FRAMEWORK_HW_API */
251 
252 #ifdef __cplusplus
253 };
254 #endif
255 
256 #endif /* APP_HW_H */
Date and time structure.
Definition: app_hw.h:44
void AppHwPlxcmRead(appPlxCm_t *pPlxcm)
Perform a pulse oximeter measurement.
uint8_t userId
User ID.
Definition: app_hw.h:64
uint16_t pulseAmpIndex
Pulse Amplitude Index.
Definition: app_hw.h:108
appDateTime_t timestamp
Date-time.
Definition: app_hw.h:70
Blood pressure measurement structure.
Definition: app_hw.h:55
uint8_t month
Month.
Definition: app_hw.h:47
uint8_t flags
Flags.
Definition: app_hw.h:80
void AppHwBattRead(uint8_t *pLevel)
Read the battery level. The battery level value returned in pLevel is the percentage of remaining bat...
uint16_t spo2Fast
SpO2PR-Spot-Check Fast - SpO2.
Definition: app_hw.h:90
uint8_t bool_t
Boolean data type.
Definition: wsf_types.h:78
uint16_t measStatus
Measurement Status.
Definition: app_hw.h:106
uint16_t spo2Slow
SpO2PR-Spot-Check Slow - SpO2.
Definition: app_hw.h:92
uint16_t energyExp
Energy expended value.
Definition: app_hw.h:38
void AppHwTmSetUnits(uint8_t units)
Set the temperature measurement units.
void AppHwHrmRead(appHrm_t *pHrm)
Perform a heart rate measurement. Return the heart rate along with any RR interval data...
Heart rate measurement structure.
Definition: app_hw.h:34
uint16_t pulseRate
SpO2PR-Spot-Check - Pulse Rate.
Definition: app_hw.h:89
Pulse Oximeter continuous measurement structure.
Definition: app_hw.h:85
uint16_t pulseRate
SpO2PR-Spot-Check - Pulse Rate.
Definition: app_hw.h:104
uint8_t flags
Weight measurement flags.
Definition: app_hw.h:72
void AppHwTmRead(bool_t intermed, appTm_t *pTm)
Perform a temperature measurement. Return the measurement data.
uint16_t pulseRateFast
SpO2PR-Spot-Check Fast - Pulse Rate.
Definition: app_hw.h:91
uint8_t day
Day.
Definition: app_hw.h:48
Temperature measurement structure.
Definition: app_hw.h:76
uint16_t diastolic
Diastolic pressure.
Definition: app_hw.h:59
uint16_t spo2
SpO2PR-Spot-Check - SpO2.
Definition: app_hw.h:103
uint8_t hour
Hour.
Definition: app_hw.h:49
void AppHwHrmTest(uint8_t heartRate)
Set the heart rate, for test purposes.
uint16_t pulseRateSlow
SpO2PR-Spot-Check Slow - Pulse Rate.
Definition: app_hw.h:93
uint8_t flags
Flags.
Definition: app_hw.h:63
uint16_t heartRate
Heart rate.
Definition: app_hw.h:39
unsigned long uint32_t
Unsigned 32-bit value.
Definition: wsf_types.h:71
uint16_t pulseRate
Pulse rate.
Definition: app_hw.h:61
uint16_t map
Mean arterial pressure.
Definition: app_hw.h:60
void AppHwBattTest(uint8_t level)
Set the battery level, for test purposes.
uint16_t * pRrInterval
Array of RR intervals.
Definition: app_hw.h:36
uint8_t min
Minutes.
Definition: app_hw.h:50
appDateTime_t timestamp
Date-time.
Definition: app_hw.h:57
uint32_t sensorStatus
Device and Sensor Status.
Definition: app_hw.h:95
uint16_t weight
Weight.
Definition: app_hw.h:71
uint16_t spo2
SpO2PR-Spot-Check - SpO2.
Definition: app_hw.h:88
unsigned short uint16_t
Unsigned 16-bit value.
Definition: wsf_types.h:67
uint8_t flags
Heart rate measurement flags.
Definition: app_hw.h:40
uint16_t measStatus
Measurement status.
Definition: app_hw.h:62
void AppHwBpmRead(bool_t intermed, appBpm_t *pBpm)
Perform a blood pressure measurement. Return the measurement data.
uint8_t sec
Seconds.
Definition: app_hw.h:51
uint16_t measStatus
Measurement Status.
Definition: app_hw.h:94
void AppHwPlxscmRead(appPlxScm_t *pPlxscm)
Perform a pulse oximeter spot check measurement.
uint16_t year
Year.
Definition: app_hw.h:46
appDateTime_t timestamp
Date-time.
Definition: app_hw.h:78
void AppHwWsmRead(appWsm_t *pWsm)
Perform a weight scale measurement. Return the measurement data.
uint8_t tempType
Temperature type.
Definition: app_hw.h:81
void AppHwWmSetUnits(uint8_t units)
Set the weight measurement units.
uint8_t flags
Flags.
Definition: app_hw.h:87
uint32_t temperature
Temperature.
Definition: app_hw.h:79
Weight scale measurement structure.
Definition: app_hw.h:68
uint32_t sensorStatus
Device and Sensor Status.
Definition: app_hw.h:107
unsigned char uint8_t
Unsigned 8-bit value.
Definition: wsf_types.h:63
Pulse Oximeter spot check measurement structure.
Definition: app_hw.h:100
uint8_t numIntervals
Length of RR interval array.
Definition: app_hw.h:37
uint16_t systolic
Systolic pressure.
Definition: app_hw.h:58
uint16_t pulseAmpIndex
Pulse Amplitude Index.
Definition: app_hw.h:96
uint8_t flags
Flags.
Definition: app_hw.h:102
appDateTime_t timestamp
Timestamp.
Definition: app_hw.h:105