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;
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;
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;
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];
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;
99 
100 #define SI117XDRV_BIOZ_SAMPLE_SIZE_BYTES 9
101 
102 typedef enum {
107 
109 typedef enum {
117 
119 typedef enum {
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;
154  uint8_t ppg_sw_avg;
155  uint8_t irq_enable;
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;
184 
186 typedef struct {
187  uint8_t ecg_threshold;
188  uint8_t ecg_ldconfig;
189  uint8_t ecg_ld_freq_sel;
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;
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];
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
int32_t ppg3
ppg3 sample data
Definition: si117xdrv.h:53
uint32_t SI117XDRV_DataQueueID_t
Queue ID.
Definition: si117xdrv.h:246
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
uint32_t ecgldSampleRateus
desired ECG LD sample rate us
Definition: si117xdrv.h:142
uint16_t sequence
irq sequence number
Definition: si117xdrv.h:61
low-high-low
Definition: si117xdrv.h:121
Si117x_Ecode_t SI117XDRV_Reset(SI117XDRV_DeviceSelect_t device)
Resets the Si117x.
Definition: si117xdrv.c:249
uint16_t timestamp
irq timestamp
Definition: si117xdrv.h:49
uint32_t biozSampleRateus
desired bioz sample rate in us
Definition: si117xdrv.h:143
SI117XDRV_SampleSize_t ecgSampleSize
ecg sample size setting
Definition: si117xdrv.h:152
Si117x_Ecode_t SI117XDRV_ClearWristDetection(SI117XDRV_DeviceSelect_t device)
wrist detection algorithm
Definition: si117xdrv.c:1994
Si117x_Ecode_t SI117XDRV_InitPPG(SI117XDRV_DeviceSelect_t device, SI117XDRV_PPGCfg_t *ppgCfg)
Configure PPG parameters.
Definition: si117xdrv.c:422
uint16_t sequence
irq sequence number
Definition: si117xdrv.h:84
uint16_t timestamp
irq timestamp
Definition: si117xdrv.h:62
Si117x_Ecode_t SI117XDRV_LeadDetection(SI117XDRV_DeviceSelect_t device, bool *leadDetectStatus)
Lead detection algorithm.
Definition: si117xdrv.c:1936
Si117x_Ecode_t SI117XDRV_ProcessWDInterrupt(SI117XDRV_DeviceSelect_t device)
wrist detection interrupt handler
Definition: si117xdrv.c:2024
SI117XDRV_MSPolar_t
MS pin polarity setting.
Definition: si117xdrv.h:119
16 bit data
Definition: si117xdrv.h:104
Si117x_Ecode_t SI117XDRV_InitECG(SI117XDRV_DeviceSelect_t device, SI117XDRV_ECGCfg_t *ecgCfg)
Configure ECG parameters.
Definition: si117xdrv.c:363
uint16_t sequence
irq sequence number
Definition: si117xdrv.h:74
int16_t ppg1
ppg1 sample data
Definition: si117xdrv.h:64
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
Si117x_Ecode_t SI117XDRV_SetECGTaskEnable(SI117XDRV_DeviceSelect_t device, uint8_t ecgTask)
Configure ECG tasks.
Definition: si117xdrv.c:495
Si117x_Ecode_t SI117XDRV_PPG1IntConfig(SI117XDRV_DeviceSelect_t device, bool enable)
Enable/disable PPG interrupt.
Definition: si117xdrv.c:550
Si117x_Ecode_t SI117XDRV_WDIntConfig(SI117XDRV_DeviceSelect_t device, bool enable)
Enable/disable wrist detection interrupt.
Definition: si117xdrv.c:604
Si117x_Ecode_t SI117XDRV_RegisterPreStartCallback(SI117XDRV_DeviceSelect_t device, SI117XDRV_Callback_t callback, void *user)
Register a pre start callback.
Definition: si117xdrv.c:1133
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
uint32_t SI117XDRV_DeviceSelect_t
Device ID.
Definition: si117xdrv.h:250
uint8_t syncMessage
sync message received
Definition: si117xdrv.h:50
int32_t ppg2
ppg2 sample data
Definition: si117xdrv.h:52
SI117XDRV_MSPolar_t ms_polar
ms pin polarity
Definition: si117xdrv.h:150
Si117x_Ecode_t SI117XDRV_StopLegacyPPG(SI117XDRV_DeviceSelect_t device)
Stop legacy PPG mode (restores ECG & BIOZ tasks as previously set)
Definition: si117xdrv.c:682
Si117x_Ecode_t SI117XDRV_Start(SI117XDRV_DeviceSelect_t device)
Start running measurements with the current configuration.
Definition: si117xdrv.c:745
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
Si117x_Ecode_t SI117XDRV_InitGlobal(SI117XDRV_DeviceSelect_t device, SI117XDRV_GlobalCfg_t *globalCfg)
Configure global Si117x settings.
Definition: si117xdrv.c:887
Si117x global configuration.
Definition: si117xdrv.h:139
high-low-high
Definition: si117xdrv.h:120
SI117XDRV_SampleSize_t biozSampleSize
bioz sample size setting
Definition: si117xdrv.h:153
Si117x_Ecode_t SI117XDRV_WristDetection(SI117XDRV_DeviceSelect_t device, bool *wristDetectStatus)
wrist detection algorithm
Definition: si117xdrv.c:1977
Si117XDRV ECG configuration.
Definition: si117xdrv.h:179
PPG sample data typedef.
Definition: si117xdrv.h:47
Si117x_Ecode_t SI117XDRV_LDIntConfig(SI117XDRV_DeviceSelect_t device, bool enable)
Enable/disable lead detection interrupt.
Definition: si117xdrv.c:577
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
uint16_t timestamp
irq timestamp
Definition: si117xdrv.h:75
Si117x_Ecode_t SI117XDRV_InitECGLD(SI117XDRV_DeviceSelect_t device, SI117XDRV_ECGLDCfg_t *ecgldCfg)
Configure ECG LD parameters.
Definition: si117xdrv.c:393
uint16_t timestamp
irq timestamp
Definition: si117xdrv.h:85
uint8_t syncMessage
sync message received
Definition: si117xdrv.h:96
SI117XDRV_SampleSize_t ppgSampleSize
ppg sample size setting
Definition: si117xdrv.h:151
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
int32_t ppg1
ppg1 sample data
Definition: si117xdrv.h:51
int16_t ppg2
ppg2 sample data
Definition: si117xdrv.h:65
Si117x_Ecode_t SI117XDRV_FifoIntConfig(SI117XDRV_DeviceSelect_t device, bool enable)
Enable/disable fifo interrupt.
Definition: si117xdrv.c:523
uint32_t ppgSampleRateus
desired PPG sample rate in us
Definition: si117xdrv.h:140
24 bit data
Definition: si117xdrv.h:105
Si117x_Ecode_t SI117XDRV_Dequeue24bPPGSampleData(SI117XDRV_DataQueueID_t id, SI117XDRV_PPG24bSample_t *sample)
Remove a PPG sample from the queue.
Definition: si117xdrv.c:1719
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
ECG sample data typedef.
Definition: si117xdrv.h:83
SI117XDRV_SampleSize_t
Sample size settings.
Definition: si117xdrv.h:103
bool fifo_self_test
enable fifo self test mode
Definition: si117xdrv.h:147
int32_t bioz
bioz sample data
Definition: si117xdrv.h:97
Si117x_Ecode_t SI117XDRV_FifoFlush(SI117XDRV_DeviceSelect_t device)
Flushes the Si117x fifo.
Definition: si117xdrv.c:231
int32_t ppg4
ppg4 sample data
Definition: si117xdrv.h:54
int32_t Si117x_Ecode_t
SI117XDRV error code.
Definition: si117xdrv.h:27
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
PPG 16bit sample data typedef. Use this data type to save memory.
Definition: si117xdrv.h:60
int16_t ppg4
ppg4 sample data
Definition: si117xdrv.h:67
Si117x_Ecode_t SI117XDRV_InitAPI(SI117XDRV_DeviceSelect_t device, HANDLE deviceHandle)
Initializes API memory and device handle.
Definition: si117xdrv.c:1067
uint8_t irq_enable
irq enable setting
Definition: si117xdrv.h:155
Si117x_Ecode_t SI117XDRV_DequeueECGSampleData(SI117XDRV_DataQueueID_t id, SI117XDRV_ECGSample_t *sample)
Remove an ECG sample from the queue.
Definition: si117xdrv.c:1887
SI117XDRV_SynchMode_t synch_mode
sync mode
Definition: si117xdrv.h:149
Si117XDRV ECG LD configuration.
Definition: si117xdrv.h:186
Trigger in.
Definition: si117xdrv.h:112
bool fifo_disable
disable fifo
Definition: si117xdrv.h:148
uint8_t syncMessage
sync message received
Definition: si117xdrv.h:76
int32_t ecg
ecg sample data
Definition: si117xdrv.h:77
ECG sample data typedef.
Definition: si117xdrv.h:73
uint8_t taskEnable
task enable
Definition: si117xdrv.h:146
Si117x_Ecode_t SI117XDRV_SetPPGTaskEnable(SI117XDRV_DeviceSelect_t device, uint8_t ppgTasks)
Configure PPG tasks.
Definition: si117xdrv.c:466
uint16_t SI117XDRV_NumSamplesInQueue(SI117XDRV_DataQueueID_t id)
Get number of samples in the queue.
Definition: si117xdrv.c:1620
uint16_t sequence
irq sequence number
Definition: si117xdrv.h:94
uint8_t syncMessage
sync message received
Definition: si117xdrv.h:63
uint8_t syncMessage
sync message received
Definition: si117xdrv.h:86
uint16_t sequence
irq sequence number
Definition: si117xdrv.h:48
int16_t ppg3
ppg3 sample data
Definition: si117xdrv.h:66
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
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
Sync configuration settings.
Definition: si117xdrv.h:109
Si117x_Ecode_t SI117XDRV_Stop(SI117XDRV_DeviceSelect_t device)
Stop running measurements in the Si117x.
Definition: si117xdrv.c:719
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
uint16_t timestamp
irq timestamp
Definition: si117xdrv.h:95
Accelerometer.
Definition: si117xdrv.h:111
Trigger out.
Definition: si117xdrv.h:113
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
Si117x_Ecode_t SI117XDRV_InitializeSi117xFifoStateMachine(SI117XDRV_DeviceSelect_t device)
Initializes the FIFO processing state machine.
Definition: si117xdrv.c:2131
uint32_t accelSyncRateus
accel synchronization period in us
Definition: si117xdrv.h:144
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
uint32_t ecgSampleRateus
desired ECG sample rate in us
Definition: si117xdrv.h:141
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
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
Si117x_Ecode_t SI117XDRV_FreeDataQueue(SI117XDRV_DataQueueID_t id)
De-allocate a fifo queue.
Definition: si117xdrv.c:1509
bioz sample data typedef
Definition: si117xdrv.h:93
uint16_t fifo_int_level
fifo interrupt level
Definition: si117xdrv.h:145
Si117x_Ecode_t SI117XDRV_RegisterPostStartCallback(SI117XDRV_DeviceSelect_t device, SI117XDRV_Callback_t callback, void *user)
Register a post start callback.
Definition: si117xdrv.c:1167
Si117x_Ecode_t SI117XDRV_ProcessLDInterrupt(SI117XDRV_DeviceSelect_t device)
lead detection interrupt handler
Definition: si117xdrv.c:2009
Si117XDRV one PPG channel configuration.
Definition: si117xdrv.h:207
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
Si117x_Ecode_t SI117XDRV_ClearQueue(SI117XDRV_DataQueueID_t id)
Empty a fifo queue.
Definition: si117xdrv.c:1543
Si117XDRV PPG configuration.
Definition: si117xdrv.h:230
uint8_t ppg_sw_avg
ppg sw avg setting
Definition: si117xdrv.h:154