SI117XDRV 0.1

si117xdrv.h
Go to the documentation of this file.
1 /***************************************************************************/
16 #ifndef SI117x_DRIVER_H
17 #define SI117x_DRIVER_H
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22 #include <stdint.h>
23 #include <stdbool.h>
24 #include "si117x_types.h" //dlc: is si117x_types.h really needed?
25 #include "si117xdrv_config.h"
26
27 typedef int32_t Si117x_Ecode_t;
28
29 #define ECODE_SI117XDRV_OK 0
30 #define ECODE_SI117XDRV_QUEUE_FULL -1
31 #define ECODE_SI117XDRV_QUEUE_EMPTY -2
32 #define ECODE_SI117XDRV_ALL_QUEUES_USED -3
33 #define ECODE_SI117XDRV_PARAM_ERROR -4
34 #define ECODE_SI117XDRV_QUEUE_SIZE_ERROR -5
35 #define ECODE_SI117XDRV_RUNNING -6
36 #define ECODE_SI117XDRV_NOT_RUNNING -7
37 #define ECODE_SI117XDRV_ALL_CB_USED -8
38 #define ECODE_SI117XDRV_UNINITIALIZED -9
39
40 #ifndef NULL
41 #define NULL 0
42 #endif
43
44 #define SI117XDRV_UNINITIALIZED_QUEUE_ID 0xffff
45
46 typedef struct {
48 uint16_t sequence;
49 uint16_t timestamp;
50 uint8_t syncMessage;
51 int32_t ppg1;
52 int32_t ppg2;
53 int32_t ppg3;
54 int32_t ppg4;
55 } SI117XDRV_PPG24bSample_t;
56
57 #define SI117XDRV_PPG_24BIT_SAMPLE_SIZE_BYTES 21
58
59 typedef struct {
61 uint16_t sequence;
62 uint16_t timestamp;
63 uint8_t syncMessage;
64 int16_t ppg1;
65 int16_t ppg2;
66 int16_t ppg3;
67 int16_t ppg4;
68 } SI117XDRV_PPGSample_t;
69
70 #define SI117XDRV_PPG_SAMPLE_SIZE_BYTES 13
71
72 typedef struct {
74 uint16_t sequence;
75 uint16_t timestamp;
76 uint8_t syncMessage;
77 int32_t ecg;
78 } SI117XDRV_ECGSample_t;
79
80 #define SI117XDRV_ECG_SAMPLE_SIZE_BYTES 9
81
82 typedef struct {
84 uint16_t sequence;
85 uint16_t timestamp;
86 uint8_t syncMessage;
87 uint8_t data[4];
88 } SI117XDRV_ECGLDSample_t;
89
90 #define SI117XDRV_ECG_LD_SAMPLE_SIZE_BYTES 9
91
92 typedef struct {
94 uint16_t sequence;
95 uint16_t timestamp;
96 uint8_t syncMessage;
97 int32_t bioz;
98 } SI117XDRV_BIOZSample_t;
99
100 #define SI117XDRV_BIOZ_SAMPLE_SIZE_BYTES 9
101
102 typedef enum {
104 sample16bit = 0,
105 sample24bit = 1
106 } SI117XDRV_SampleSize_t;
107
109 typedef enum {
110 SynchModeNone = 0,
111 SynchModeAccel = 1,
112 SynchModeTriggerIn = 2,
113 SynchModeTriggerOut = 3,
114 SynchModeSi117xMaster = 4,
115 SynchModeSi117xSlave = 5
116 } SI117XDRV_SynchMode_t;
117
119 typedef enum {
120 MSPolarHighLowHigh = 0,
121 MSPolarLowHighLow = 1
122 } SI117XDRV_MSPolar_t;
123
124 #define SI117XDRV_TASK_PPG1_EN (1<<0)
125 #define SI117XDRV_TASK_PPG2_EN (1<<1)
126 #define SI117XDRV_TASK_PPG3_EN (1<<2)
127 #define SI117XDRV_TASK_PPG4_EN (1<<3)
128 #define SI117XDRV_TASK_BIOZ1_AC_EN (1<<4)
129 #define SI117XDRV_TASK_BIOZ_DC_EN (1<<5)
130 #define SI117XDRV_TASK_ECG_EN (1<<6)
131 #define SI117XDRV_TASK_ECG_LD_EN (1<<7)
132
133 #define SI117XDRV_IRQ_EN_FIFO (1<<0)
134 #define SI117XDRV_IRQ_EN_PPG1 (1<<1)
135 #define SI117XDRV_IRQ_EN_WD (1<<2)
136 #define SI117XDRV_IRQ_EN_LD (1<<3)
137
138 typedef struct {
140 uint32_t ppgSampleRateus;
141 uint32_t ecgSampleRateus;
142 uint32_t ecgldSampleRateus;
143 uint32_t biozSampleRateus;
144 uint32_t accelSyncRateus;
145 uint16_t fifo_int_level;
146 uint8_t taskEnable;
147 bool fifo_self_test;
148 bool fifo_disable;
149 SI117XDRV_SynchMode_t synch_mode;
150 SI117XDRV_MSPolar_t ms_polar;
151 SI117XDRV_SampleSize_t ppgSampleSize;
152 SI117XDRV_SampleSize_t ecgSampleSize;
153 SI117XDRV_SampleSize_t biozSampleSize;
154 uint8_t ppg_sw_avg;
155 uint8_t irq_enable;
156 }SI117XDRV_GlobalCfg_t;
157
159 #define SI117XDRV_DEFAULT_GLOBAL_CFG \
160 { 5000 , \
161 5000, \
162 0, \
163 0, \
164 0, \
165 128, \
166 0, \
167 false, \
168 false, \
169 SynchModeNone, \
170 MSPolarHighLowHigh, \
171 sample16bit, \
172 sample24bit, \
173 sample16bit, \
174 0, \
175 0 \
176 }
177
179 typedef struct {
180 uint8_t ecg_measconfig;
181 uint8_t ecg_adcconfig;
182 uint8_t ecg_feconfig;
183 } SI117XDRV_ECGCfg_t;
184
186 typedef struct {
187 uint8_t ecg_threshold;
188 uint8_t ecg_ldconfig;
189 uint8_t ecg_ld_freq_sel;
190 } SI117XDRV_ECGLDCfg_t;
191
193 #define SI117XDRV_DEFAULT_ECG_CFG \
194 { 0 , \
195 0x8, \
196 0, \
197 }
198
200 #define SI117XDRV_DEFAULT_ECG_LD_CFG \
201 { 0 , \
202 0, \
203 0, \
204 }
205
207 typedef struct
208 {
209 uint8_t ppg_led1_config;
210 uint8_t ppg_led2_config;
211 uint8_t ppg_led3_config;
212 uint8_t ppg_led4_config;
213 uint8_t ppg_mode;
214 uint8_t ppg_measconfig;
215 uint8_t ppg_adcconfig;
216 } SI117XDRV_PPGChannelCfg_t;
217
219 #define SI117XDRV_DEFAULT_PPG_CHANNEL_CFG \
220 { 0 , \
221 0, \
222 0, \
223 0, \
224 0xf, \
225 0x3, \
226 0x30, \
227 }
228
230 typedef struct
231 {
232 uint8_t ppg4_threshold;
233 SI117XDRV_PPGChannelCfg_t ppgCfg[4];
234 } SI117XDRV_PPGCfg_t;
235
237 #define SI117XDRV_DEFAULT_PPG_CFG \
238 { 0 , \
239 {SI117XDRV_DEFAULT_PPG_CHANNEL_CFG, \
240 SI117XDRV_DEFAULT_PPG_CHANNEL_CFG, \
241 SI117XDRV_DEFAULT_PPG_CHANNEL_CFG, \
242 SI117XDRV_DEFAULT_PPG_CHANNEL_CFG} \
243 }
244
246 typedef uint32_t SI117XDRV_DataQueueID_t;
247
248
250 typedef uint32_t SI117XDRV_DeviceSelect_t;
251 /***************************************************************************/
262 typedef void (*SI117XDRV_Callback_t)(SI117XDRV_DeviceSelect_t device, void *user);
263
264 /***************************************************************************/
281 typedef void (*SI117XDRV_AccelCallback_t)(SI117XDRV_DeviceSelect_t device, uint16_t ppgCount, void *user);
282
283 Si117x_Ecode_t SI117XDRV_LeadDetection (SI117XDRV_DeviceSelect_t device, bool *leadDetectStatus);
284 Si117x_Ecode_t SI117XDRV_WristDetection (SI117XDRV_DeviceSelect_t device, bool *wristDetectStatus);
285 Si117x_Ecode_t SI117XDRV_ClearWristDetection (SI117XDRV_DeviceSelect_t device);
286
287 /***************************************************************************/
290 Si117x_Ecode_t SI117XDRV_Allocate24bPPGDataQueue(SI117XDRV_DataQueueID_t *id, SI117XDRV_PPG24bSample_t *queueBuffer, int16_t queueSizeInBytes);
291 Si117x_Ecode_t SI117XDRV_AllocatePPGDataQueue(SI117XDRV_DataQueueID_t *id, SI117XDRV_PPGSample_t *queueBuffer, int16_t queueSizeInBytes);
292 Si117x_Ecode_t SI117XDRV_AllocateECGDataQueue(SI117XDRV_DataQueueID_t *id, SI117XDRV_ECGSample_t *queueBuffer, int16_t queueSizeInBytes);
293 Si117x_Ecode_t SI117XDRV_AllocateECGLDDataQueue(SI117XDRV_DataQueueID_t *id, SI117XDRV_ECGLDSample_t *queueBuffer, int16_t queueSizeInBytes);
294
295 Si117x_Ecode_t SI117XDRV_FreeDataQueue(SI117XDRV_DataQueueID_t id);
296
297 Si117x_Ecode_t SI117XDRV_ClearQueue (SI117XDRV_DataQueueID_t id);
298
299 uint16_t SI117XDRV_NumSamplesInQueue (SI117XDRV_DataQueueID_t id);
300
301 Si117x_Ecode_t SI117XDRV_Dequeue24bPPGSampleData (SI117XDRV_DataQueueID_t id, SI117XDRV_PPG24bSample_t *sample);
302
303 Si117x_Ecode_t SI117XDRV_DequeueECGSampleData (SI117XDRV_DataQueueID_t id, SI117XDRV_ECGSample_t *sample);
304
305 Si117x_Ecode_t SI117XDRV_DequeueECGLDSampleData (SI117XDRV_DataQueueID_t id, SI117XDRV_ECGLDSample_t *sample);
306
307 Si117x_Ecode_t SI117XDRV_DequeuePPGSampleData (SI117XDRV_DataQueueID_t id, SI117XDRV_PPGSample_t *sample);
308 //Si117x_Ecode_t SI117XDRV_DequeueBIOZSampleData (SI117XDRV_DataQueueID_t id,SI117XDRV_BIOZSample_t *sample);
309
310
311 /***************************************************************************/
314 Si117x_Ecode_t SI117XDRV_StartLegacyPPG (SI117XDRV_DeviceSelect_t device, uint8_t ppg_meascount, uint16_t measrate) ; //used with HRM algorithm (required for DC sense)
315 Si117x_Ecode_t SI117XDRV_StopLegacyPPG (SI117XDRV_DeviceSelect_t device); //restore previous state
316 Si117x_Ecode_t SI117XDRV_Stop (SI117XDRV_DeviceSelect_t device);
317 Si117x_Ecode_t SI117XDRV_Start (SI117XDRV_DeviceSelect_t device);
318 Si117x_Ecode_t SI117XDRV_SetPPGTaskEnable (SI117XDRV_DeviceSelect_t device, uint8_t ppgTasks); //returns an error if device is currently running
319 Si117x_Ecode_t SI117XDRV_SetECGTaskEnable (SI117XDRV_DeviceSelect_t device, uint8_t ecgTask);
320 Si117x_Ecode_t SI117XDRV_FifoFlush (SI117XDRV_DeviceSelect_t device);
321 /***************************************************************************/
326 /***************************************************************************/
329 Si117x_Ecode_t SI117XDRV_GetPartInfo (SI117XDRV_DeviceSelect_t device, uint8_t *id, uint8_t *rev, uint8_t *mfr_id, uint8_t *pkg_led_cfg);
330 Si117x_Ecode_t SI117XDRV_GetFifoIntLevel (SI117XDRV_DeviceSelect_t device, uint16_t *fifo_int_level);
331 Si117x_Ecode_t SI117XDRV_InitECG (SI117XDRV_DeviceSelect_t device, SI117XDRV_ECGCfg_t *ecgCfg);
332 Si117x_Ecode_t SI117XDRV_InitECGLD (SI117XDRV_DeviceSelect_t device, SI117XDRV_ECGLDCfg_t *ecgldCfg);
333 Si117x_Ecode_t SI117XDRV_InitPPG (SI117XDRV_DeviceSelect_t device, SI117XDRV_PPGCfg_t *ppgCfg);
334 Si117x_Ecode_t SI117XDRV_InitGlobal (SI117XDRV_DeviceSelect_t device, SI117XDRV_GlobalCfg_t *globalCfg);
335 Si117x_Ecode_t SI117XDRV_Reset (SI117XDRV_DeviceSelect_t device);
336 Si117x_Ecode_t SI117XDRV_WDIntConfig (SI117XDRV_DeviceSelect_t device, bool enable);
337 Si117x_Ecode_t SI117XDRV_FifoIntConfig (SI117XDRV_DeviceSelect_t device, bool enable);
338 Si117x_Ecode_t SI117XDRV_PPG1IntConfig (SI117XDRV_DeviceSelect_t device, bool enable);
339 Si117x_Ecode_t SI117XDRV_LDIntConfig (SI117XDRV_DeviceSelect_t device, bool enable);
340 /***************************************************************************/
343 Si117x_Ecode_t SI117XDRV_RegisterPreStartCallback (SI117XDRV_DeviceSelect_t device, SI117XDRV_Callback_t callback, void *user);
344 Si117x_Ecode_t SI117XDRV_RegisterAccelSyncCallback (SI117XDRV_DeviceSelect_t device, SI117XDRV_AccelCallback_t callback, void *user);
345 Si117x_Ecode_t SI117XDRV_RegisterPostStartCallback (SI117XDRV_DeviceSelect_t device, SI117XDRV_Callback_t callback, void *user);
346 Si117x_Ecode_t SI117XDRV_RegisterPreFifoFlushCallback (SI117XDRV_DeviceSelect_t device, SI117XDRV_Callback_t callback, void *user);
347 Si117x_Ecode_t SI117XDRV_RegisterPostFifoFlushCallback (SI117XDRV_DeviceSelect_t device, SI117XDRV_Callback_t callback, void *user);
348 Si117x_Ecode_t SI117XDRV_InitAPI (SI117XDRV_DeviceSelect_t device, HANDLE deviceHandle);
349
350
351 /***************************************************************************/
354 //void setFifoProcessingValues(int oversampling, uint8_t meas_cntl, uint8_t taskEnable, uint8_t ppg_measconfig0, uint8_t ppg_measconfig1, uint8_t ppg_measconfig2, uint8_t ppg_measconfig3 );//temporary function to get demo working
355 Si117x_Ecode_t SI117XDRV_ProcessLDInterrupt (SI117XDRV_DeviceSelect_t device);
356 Si117x_Ecode_t SI117XDRV_ProcessWDInterrupt (SI117XDRV_DeviceSelect_t device);
357 Si117x_Ecode_t SI117XDRV_ProcessFifoData(SI117XDRV_DeviceSelect_t device, uint8_t *fifoData, uint16_t fifo_length, uint16_t timestamp, uint16_t irqSequence); //dlc: These functions should return Si117x_Ecode_t
358 Si117x_Ecode_t SI117XDRV_InitializeSi117xFifoStateMachine(SI117XDRV_DeviceSelect_t device); // this is called by start function??
359 Si117x_Ecode_t SI117XDRV_ProcessPPGInterrupt (SI117XDRV_DeviceSelect_t device, uint8_t *fifoData, uint16_t timestamp, uint16_t irqSequence);
360
361 #ifdef __cplusplus
362 }
363 #endif
364
365 #endif //SI117x_DRIVER_H
SI117XDRV_PPG24bSample_t::ppg3
int32_t ppg3
ppg3 sample data
Definition: si117xdrv.h:53
SI117XDRV_DataQueueID_t
uint32_t SI117XDRV_DataQueueID_t
Queue ID.
Definition: si117xdrv.h:246
SI117XDRV_AllocateECGDataQueue
Si117x_Ecode_t SI117XDRV_AllocateECGDataQueue(SI117XDRV_DataQueueID_t *id, SI117XDRV_ECGSample_t *queueBuffer, int16_t queueSizeInBytes)
Allocate a fifo queue for ECG data.
Definition: si117xdrv.c:1409
SI117XDRV_GlobalCfg_t::ecgldSampleRateus
uint32_t ecgldSampleRateus
desired ECG LD sample rate us
Definition: si117xdrv.h:142
SI117XDRV_PPGSample_t::sequence
uint16_t sequence
irq sequence number
Definition: si117xdrv.h:61
MSPolarLowHighLow
low-high-low
Definition: si117xdrv.h:121
SI117XDRV_Reset
Si117x_Ecode_t SI117XDRV_Reset(SI117XDRV_DeviceSelect_t device)
Resets the Si117x.
Definition: si117xdrv.c:249
SI117XDRV_PPG24bSample_t::timestamp
uint16_t timestamp
irq timestamp
Definition: si117xdrv.h:49
SI117XDRV_GlobalCfg_t::biozSampleRateus
uint32_t biozSampleRateus
desired bioz sample rate in us
Definition: si117xdrv.h:143
SI117XDRV_GlobalCfg_t::ecgSampleSize
SI117XDRV_SampleSize_t ecgSampleSize
ecg sample size setting
Definition: si117xdrv.h:152
SI117XDRV_ClearWristDetection
Si117x_Ecode_t SI117XDRV_ClearWristDetection(SI117XDRV_DeviceSelect_t device)
wrist detection algorithm
Definition: si117xdrv.c:1994
SI117XDRV_InitPPG
Si117x_Ecode_t SI117XDRV_InitPPG(SI117XDRV_DeviceSelect_t device, SI117XDRV_PPGCfg_t *ppgCfg)
Configure PPG parameters.
Definition: si117xdrv.c:422
SI117XDRV_ECGLDSample_t::sequence
uint16_t sequence
irq sequence number
Definition: si117xdrv.h:84
SynchModeSi117xMaster
master
Definition: si117xdrv.h:114
SI117XDRV_PPGSample_t::timestamp
uint16_t timestamp
irq timestamp
Definition: si117xdrv.h:62
SI117XDRV_LeadDetection
Si117x_Ecode_t SI117XDRV_LeadDetection(SI117XDRV_DeviceSelect_t device, bool *leadDetectStatus)
Lead detection algorithm.
Definition: si117xdrv.c:1936
SI117XDRV_ProcessWDInterrupt
Si117x_Ecode_t SI117XDRV_ProcessWDInterrupt(SI117XDRV_DeviceSelect_t device)
wrist detection interrupt handler
Definition: si117xdrv.c:2024
SI117XDRV_MSPolar_t
SI117XDRV_MSPolar_t
MS pin polarity setting.
Definition: si117xdrv.h:119
sample16bit
16 bit data
Definition: si117xdrv.h:104
SI117XDRV_InitECG
Si117x_Ecode_t SI117XDRV_InitECG(SI117XDRV_DeviceSelect_t device, SI117XDRV_ECGCfg_t *ecgCfg)
Configure ECG parameters.
Definition: si117xdrv.c:363
SI117XDRV_ECGSample_t::sequence
uint16_t sequence
irq sequence number
Definition: si117xdrv.h:74
SI117XDRV_PPGSample_t::ppg1
int16_t ppg1
ppg1 sample data
Definition: si117xdrv.h:64
SI117XDRV_ProcessPPGInterrupt
Si117x_Ecode_t SI117XDRV_ProcessPPGInterrupt(SI117XDRV_DeviceSelect_t device, uint8_t *fifoData, uint16_t timestamp, uint16_t irqSequence)
PPG1 interrupt handler.
Definition: si117xdrv.c:2163
SI117XDRV_SetECGTaskEnable
Si117x_Ecode_t SI117XDRV_SetECGTaskEnable(SI117XDRV_DeviceSelect_t device, uint8_t ecgTask)
Configure ECG tasks.
Definition: si117xdrv.c:495
SI117XDRV_PPG1IntConfig
Si117x_Ecode_t SI117XDRV_PPG1IntConfig(SI117XDRV_DeviceSelect_t device, bool enable)
Enable/disable PPG interrupt.
Definition: si117xdrv.c:550
SI117XDRV_WDIntConfig
Si117x_Ecode_t SI117XDRV_WDIntConfig(SI117XDRV_DeviceSelect_t device, bool enable)
Enable/disable wrist detection interrupt.
Definition: si117xdrv.c:604
SI117XDRV_RegisterPreStartCallback
Si117x_Ecode_t SI117XDRV_RegisterPreStartCallback(SI117XDRV_DeviceSelect_t device, SI117XDRV_Callback_t callback, void *user)
Register a pre start callback.
Definition: si117xdrv.c:1133
SI117XDRV_ProcessFifoData
Si117x_Ecode_t SI117XDRV_ProcessFifoData(SI117XDRV_DeviceSelect_t device, uint8_t *fifoData, uint16_t fifo_length, uint16_t timestamp, uint16_t irqSequence)
FIFO interrupt handler.
Definition: si117xdrv.c:2230
SI117XDRV_DeviceSelect_t
uint32_t SI117XDRV_DeviceSelect_t
Device ID.
Definition: si117xdrv.h:250
SI117XDRV_PPG24bSample_t::syncMessage
uint8_t syncMessage
sync message received
Definition: si117xdrv.h:50
SI117XDRV_PPG24bSample_t::ppg2
int32_t ppg2
ppg2 sample data
Definition: si117xdrv.h:52
SI117XDRV_GlobalCfg_t::ms_polar
SI117XDRV_MSPolar_t ms_polar
ms pin polarity
Definition: si117xdrv.h:150
SI117XDRV_StopLegacyPPG
Si117x_Ecode_t SI117XDRV_StopLegacyPPG(SI117XDRV_DeviceSelect_t device)
Stop legacy PPG mode (restores ECG & BIOZ tasks as previously set)
Definition: si117xdrv.c:682
SI117XDRV_Start
Si117x_Ecode_t SI117XDRV_Start(SI117XDRV_DeviceSelect_t device)
Start running measurements with the current configuration.
Definition: si117xdrv.c:745
SI117XDRV_RegisterPreFifoFlushCallback
Si117x_Ecode_t SI117XDRV_RegisterPreFifoFlushCallback(SI117XDRV_DeviceSelect_t device, SI117XDRV_Callback_t callback, void *user)
Register a pre fifo flush callback.
Definition: si117xdrv.c:1201
SI117XDRV_InitGlobal
Si117x_Ecode_t SI117XDRV_InitGlobal(SI117XDRV_DeviceSelect_t device, SI117XDRV_GlobalCfg_t *globalCfg)
Configure global Si117x settings.
Definition: si117xdrv.c:887
SI117XDRV_GlobalCfg_t
Si117x global configuration.
Definition: si117xdrv.h:139
MSPolarHighLowHigh
high-low-high
Definition: si117xdrv.h:120
SI117XDRV_GlobalCfg_t::biozSampleSize
SI117XDRV_SampleSize_t biozSampleSize
bioz sample size setting
Definition: si117xdrv.h:153
SI117XDRV_WristDetection
Si117x_Ecode_t SI117XDRV_WristDetection(SI117XDRV_DeviceSelect_t device, bool *wristDetectStatus)
wrist detection algorithm
Definition: si117xdrv.c:1977
SI117XDRV_ECGCfg_t
Si117XDRV ECG configuration.
Definition: si117xdrv.h:179
SI117XDRV_PPG24bSample_t
PPG sample data typedef.
Definition: si117xdrv.h:47
SI117XDRV_LDIntConfig
Si117x_Ecode_t SI117XDRV_LDIntConfig(SI117XDRV_DeviceSelect_t device, bool enable)
Enable/disable lead detection interrupt.
Definition: si117xdrv.c:577
SI117XDRV_DequeuePPGSampleData
Si117x_Ecode_t SI117XDRV_DequeuePPGSampleData(SI117XDRV_DataQueueID_t id, SI117XDRV_PPGSample_t *sample)
Remove a 16bit PPG sample from the queue.
Definition: si117xdrv.c:1753
SI117XDRV_ECGSample_t::timestamp
uint16_t timestamp
irq timestamp
Definition: si117xdrv.h:75
SI117XDRV_InitECGLD
Si117x_Ecode_t SI117XDRV_InitECGLD(SI117XDRV_DeviceSelect_t device, SI117XDRV_ECGLDCfg_t *ecgldCfg)
Configure ECG LD parameters.
Definition: si117xdrv.c:393
SI117XDRV_ECGLDSample_t::timestamp
uint16_t timestamp
irq timestamp
Definition: si117xdrv.h:85
SI117XDRV_BIOZSample_t::syncMessage
uint8_t syncMessage
sync message received
Definition: si117xdrv.h:96
SI117XDRV_GlobalCfg_t::ppgSampleSize
SI117XDRV_SampleSize_t ppgSampleSize
ppg sample size setting
Definition: si117xdrv.h:151
SI117XDRV_RegisterPostFifoFlushCallback
Si117x_Ecode_t SI117XDRV_RegisterPostFifoFlushCallback(SI117XDRV_DeviceSelect_t device, SI117XDRV_Callback_t callback, void *user)
Register a post fifo flush callback.
Definition: si117xdrv.c:1234
SI117XDRV_PPG24bSample_t::ppg1
int32_t ppg1
ppg1 sample data
Definition: si117xdrv.h:51
SI117XDRV_PPGSample_t::ppg2
int16_t ppg2
ppg2 sample data
Definition: si117xdrv.h:65
SI117XDRV_FifoIntConfig
Si117x_Ecode_t SI117XDRV_FifoIntConfig(SI117XDRV_DeviceSelect_t device, bool enable)
Enable/disable fifo interrupt.
Definition: si117xdrv.c:523
SI117XDRV_GlobalCfg_t::ppgSampleRateus
uint32_t ppgSampleRateus
desired PPG sample rate in us
Definition: si117xdrv.h:140
sample24bit
24 bit data
Definition: si117xdrv.h:105
SI117XDRV_Dequeue24bPPGSampleData
Si117x_Ecode_t SI117XDRV_Dequeue24bPPGSampleData(SI117XDRV_DataQueueID_t id, SI117XDRV_PPG24bSample_t *sample)
Remove a PPG sample from the queue.
Definition: si117xdrv.c:1719
SI117XDRV_AllocatePPGDataQueue
Si117x_Ecode_t SI117XDRV_AllocatePPGDataQueue(SI117XDRV_DataQueueID_t *id, SI117XDRV_PPGSample_t *queueBuffer, int16_t queueSizeInBytes)
Allocate a fifo queue for 16 bit PPG data.
Definition: si117xdrv.c:1306
SI117XDRV_ECGLDSample_t
ECG sample data typedef.
Definition: si117xdrv.h:83
SI117XDRV_SampleSize_t
SI117XDRV_SampleSize_t
Sample size settings.
Definition: si117xdrv.h:103
SI117XDRV_GlobalCfg_t::fifo_self_test
bool fifo_self_test
enable fifo self test mode
Definition: si117xdrv.h:147
SI117XDRV_BIOZSample_t::bioz
int32_t bioz
bioz sample data
Definition: si117xdrv.h:97
SI117XDRV_FifoFlush
Si117x_Ecode_t SI117XDRV_FifoFlush(SI117XDRV_DeviceSelect_t device)
Flushes the Si117x fifo.
Definition: si117xdrv.c:231
SI117XDRV_PPG24bSample_t::ppg4
int32_t ppg4
ppg4 sample data
Definition: si117xdrv.h:54
Si117x_Ecode_t
int32_t Si117x_Ecode_t
SI117XDRV error code.
Definition: si117xdrv.h:27
SI117XDRV_AllocateECGLDDataQueue
Si117x_Ecode_t SI117XDRV_AllocateECGLDDataQueue(SI117XDRV_DataQueueID_t *id, SI117XDRV_ECGLDSample_t *queueBuffer, int16_t queueSizeInBytes)
Allocate a fifo queue for ECG data.
Definition: si117xdrv.c:1461
SI117XDRV_PPGSample_t
PPG 16bit sample data typedef. Use this data type to save memory.
Definition: si117xdrv.h:60
SI117XDRV_PPGSample_t::ppg4
int16_t ppg4
ppg4 sample data
Definition: si117xdrv.h:67
SI117XDRV_InitAPI
Si117x_Ecode_t SI117XDRV_InitAPI(SI117XDRV_DeviceSelect_t device, HANDLE deviceHandle)
Initializes API memory and device handle.
Definition: si117xdrv.c:1067
SI117XDRV_GlobalCfg_t::irq_enable
uint8_t irq_enable
irq enable setting
Definition: si117xdrv.h:155
SI117XDRV_DequeueECGSampleData
Si117x_Ecode_t SI117XDRV_DequeueECGSampleData(SI117XDRV_DataQueueID_t id, SI117XDRV_ECGSample_t *sample)
Remove an ECG sample from the queue.
Definition: si117xdrv.c:1887
SynchModeNone
None.
Definition: si117xdrv.h:110
SI117XDRV_GlobalCfg_t::synch_mode
SI117XDRV_SynchMode_t synch_mode
sync mode
Definition: si117xdrv.h:149
SI117XDRV_ECGLDCfg_t
Si117XDRV ECG LD configuration.
Definition: si117xdrv.h:186
SynchModeTriggerIn
Trigger in.
Definition: si117xdrv.h:112
SI117XDRV_GlobalCfg_t::fifo_disable
bool fifo_disable
disable fifo
Definition: si117xdrv.h:148
SI117XDRV_ECGSample_t::syncMessage
uint8_t syncMessage
sync message received
Definition: si117xdrv.h:76
SI117XDRV_ECGSample_t::ecg
int32_t ecg
ecg sample data
Definition: si117xdrv.h:77
SI117XDRV_ECGSample_t
ECG sample data typedef.
Definition: si117xdrv.h:73
SI117XDRV_GlobalCfg_t::taskEnable
uint8_t taskEnable
task enable
Definition: si117xdrv.h:146
SI117XDRV_SetPPGTaskEnable
Si117x_Ecode_t SI117XDRV_SetPPGTaskEnable(SI117XDRV_DeviceSelect_t device, uint8_t ppgTasks)
Configure PPG tasks.
Definition: si117xdrv.c:466
SI117XDRV_NumSamplesInQueue
uint16_t SI117XDRV_NumSamplesInQueue(SI117XDRV_DataQueueID_t id)
Get number of samples in the queue.
Definition: si117xdrv.c:1620
SI117XDRV_BIOZSample_t::sequence
uint16_t sequence
irq sequence number
Definition: si117xdrv.h:94
SI117XDRV_PPGSample_t::syncMessage
uint8_t syncMessage
sync message received
Definition: si117xdrv.h:63
SI117XDRV_ECGLDSample_t::syncMessage
uint8_t syncMessage
sync message received
Definition: si117xdrv.h:86
SI117XDRV_PPG24bSample_t::sequence
uint16_t sequence
irq sequence number
Definition: si117xdrv.h:48
SI117XDRV_PPGSample_t::ppg3
int16_t ppg3
ppg3 sample data
Definition: si117xdrv.h:66
SI117XDRV_GetPartInfo
Si117x_Ecode_t SI117XDRV_GetPartInfo(SI117XDRV_DeviceSelect_t device, uint8_t *id, uint8_t *rev, uint8_t *mfr_id, uint8_t *pkg_led_cfg)
Returns the part number read from the Si117x.
Definition: si117xdrv.c:322
SI117XDRV_Allocate24bPPGDataQueue
Si117x_Ecode_t SI117XDRV_Allocate24bPPGDataQueue(SI117XDRV_DataQueueID_t *id, SI117XDRV_PPG24bSample_t *queueBuffer, int16_t queueSizeInBytes)
Allocate a fifo queue for PPG data.
Definition: si117xdrv.c:1357
SI117XDRV_SynchMode_t
SI117XDRV_SynchMode_t
Sync configuration settings.
Definition: si117xdrv.h:109
SI117XDRV_Stop
Si117x_Ecode_t SI117XDRV_Stop(SI117XDRV_DeviceSelect_t device)
Stop running measurements in the Si117x.
Definition: si117xdrv.c:719
SI117XDRV_AccelCallback_t
void(* SI117XDRV_AccelCallback_t)(SI117XDRV_DeviceSelect_t device, uint16_t ppgCount, void *user)
Typedef for accel sync DLE message received event.
Definition: si117xdrv.h:281
SI117XDRV_BIOZSample_t::timestamp
uint16_t timestamp
irq timestamp
Definition: si117xdrv.h:95
SynchModeAccel
Accelerometer.
Definition: si117xdrv.h:111
SynchModeTriggerOut
Trigger out.
Definition: si117xdrv.h:113
SI117XDRV_GetFifoIntLevel
Si117x_Ecode_t SI117XDRV_GetFifoIntLevel(SI117XDRV_DeviceSelect_t device, uint16_t *fifo_int_level)
Returns the current fifo interrupt level the Si117x.
Definition: si117xdrv.c:346
SI117XDRV_InitializeSi117xFifoStateMachine
Si117x_Ecode_t SI117XDRV_InitializeSi117xFifoStateMachine(SI117XDRV_DeviceSelect_t device)
Initializes the FIFO processing state machine.
Definition: si117xdrv.c:2131
SI117XDRV_GlobalCfg_t::accelSyncRateus
uint32_t accelSyncRateus
accel synchronization period in us
Definition: si117xdrv.h:144
SI117XDRV_RegisterAccelSyncCallback
Si117x_Ecode_t SI117XDRV_RegisterAccelSyncCallback(SI117XDRV_DeviceSelect_t device, SI117XDRV_AccelCallback_t callback, void *user)
Register an accelerometer sync message callback.
Definition: si117xdrv.c:1099
SI117XDRV_GlobalCfg_t::ecgSampleRateus
uint32_t ecgSampleRateus
desired ECG sample rate in us
Definition: si117xdrv.h:141
SI117XDRV_DequeueECGLDSampleData
Si117x_Ecode_t SI117XDRV_DequeueECGLDSampleData(SI117XDRV_DataQueueID_t id, SI117XDRV_ECGLDSample_t *sample)
Remove an ECG LD sample from the queue.
Definition: si117xdrv.c:1855
SI117XDRV_Callback_t
void(* SI117XDRV_Callback_t)(SI117XDRV_DeviceSelect_t device, void *user)
Typedef for the user supplied callback function which is called when a specific event happens...
Definition: si117xdrv.h:262
SI117XDRV_FreeDataQueue
Si117x_Ecode_t SI117XDRV_FreeDataQueue(SI117XDRV_DataQueueID_t id)
De-allocate a fifo queue.
Definition: si117xdrv.c:1509
SI117XDRV_BIOZSample_t
bioz sample data typedef
Definition: si117xdrv.h:93
SI117XDRV_GlobalCfg_t::fifo_int_level
uint16_t fifo_int_level
fifo interrupt level
Definition: si117xdrv.h:145
SynchModeSi117xSlave
slave
Definition: si117xdrv.h:115
SI117XDRV_RegisterPostStartCallback
Si117x_Ecode_t SI117XDRV_RegisterPostStartCallback(SI117XDRV_DeviceSelect_t device, SI117XDRV_Callback_t callback, void *user)
Register a post start callback.
Definition: si117xdrv.c:1167
SI117XDRV_ProcessLDInterrupt
Si117x_Ecode_t SI117XDRV_ProcessLDInterrupt(SI117XDRV_DeviceSelect_t device)
lead detection interrupt handler
Definition: si117xdrv.c:2009
SI117XDRV_PPGChannelCfg_t
Si117XDRV one PPG channel configuration.
Definition: si117xdrv.h:207
SI117XDRV_StartLegacyPPG
Si117x_Ecode_t SI117XDRV_StartLegacyPPG(SI117XDRV_DeviceSelect_t device, uint8_t ppg_meascount, uint16_t measrate)
Start legacy PPG mode (ECG & BIOZ will be disabled before start) This function overwrites some config...
Definition: si117xdrv.c:636
SI117XDRV_ClearQueue
Si117x_Ecode_t SI117XDRV_ClearQueue(SI117XDRV_DataQueueID_t id)
Empty a fifo queue.
Definition: si117xdrv.c:1543
SI117XDRV_PPGCfg_t
Si117XDRV PPG configuration.
Definition: si117xdrv.h:230
SI117XDRV_GlobalCfg_t::ppg_sw_avg
uint8_t ppg_sw_avg
ppg sw avg setting
Definition: si117xdrv.h:154