-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpxialg.h
136 lines (115 loc) · 3.52 KB
/
pxialg.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#ifndef PXIALG_H__
#define PXIALG_H__
#include "stdint.h"
#define PXIALG_API
typedef enum {
FLAG_DATA_READY = 0,
FLAG_DATA_NOT_READY,
FLAG_DATA_LOSS,
FLAG_NO_TOUCH,
FLAG_DATA_ERROR,
FLAG_POOR_SIGNAL,
} PXI_STATUS_FLAG;
/**
* @brief When HRD and MEMS data are ready, call this function to do the algorithm processing
*
* @param[in] HRD_Data Pointer to the buffer where HRD data (13 Bytes) is stored.
* @param[in] MEMS_Data Pointer to the buffer where MEMS data (3*sizeof(float) Bytes) is stored.
*
* @return Return one of the PXI_STATUS_FLAG types.
*/
PXIALG_API int32_t PxiAlg_Process(unsigned char *HRD_Data, float *MEMS_Data);
/**
* @brief Call this function to get Heart Rate
*
* @param[out] hr Pointer to a float variable where heart rate is stored
*
* @return None
*/
PXIALG_API void PxiAlg_HrGet(float *hr);
/**
* @brief Call this function to determine the version of the algorithm
*
*
* @return Version of the algorithm
*/
PXIALG_API int32_t PxiAlg_Version(void);
/**
* @brief Call this funtion to get Ready_Flag
*
* @return Return Ready_Flag
*/
PXIALG_API unsigned char PxiAlg_GetReadyFlag(void);
/**
* @brief Call this funtion to get Motion_Flag
*
* @return Return Motion_Flag
*/
PXIALG_API unsigned char PxiAlg_GetMotionFlag(void);
/**
* @brief Call this function to notify algorithm the MEMS Scale of Motion Sensor
*
* @param[in] scale The MEMS Scale of Motion Sensor. Only 0(2G),1(4G~16G) are supported.
*
* @return 1 for success. 0 for failure.
*/
PXIALG_API uint8_t PxiAlg_SetMemsScale(int scale);
/**
* @brief Call this function to get PPG Signal Grade
*
* @param[out] grade Pointer to a float variable where signal grade is stored.
*
* @return Return 1 when Signal Grade is ready. Otherwise, return 0.
*/
PXIALG_API uint8_t PxiAlg_GetSigGrade(float *grade);
/**
* @brief Call this function to set PPG Signal Grade Threshold
*
* @param[in] threshold The PPG Signal Grade Threshold. Its value ranges from 0 to 100.
*
* @return 1 for success. 0 for failure.
*/
PXIALG_API uint8_t PxiAlg_SetSigGradeThrd(float thrd);
/**
* @brief Call this function to enable or disable fast output mode
*
* @param[in] en The flag of fast output mode.
*/
PXIALG_API void PxiAlg_EnableFastOutput(uint8_t en);
/**
* @brief Call this function to enable or disable motion mode
*
* @param[in] en The flag of motion mode.
*/
PXIALG_API void PxiAlg_EnableMotionMode(uint8_t en);
/**
* @brief Call this function to enable or disable auto mode
* @param[in] enable The flag of auto mode.
*/
PXIALG_API void PxiAlg_EnableAutoMode(uint8_t en);
/**
* @brief Call this function to open algorithm
*/
PXIALG_API void PxiAlg_Open(void);
/**
* @brief Call this function to close/reset algorithm
*/
PXIALG_API void PxiAlg_Close(void);
/**
* @brief Call this function to get the alarm flag of fast output
* @param[out] get the alarm flag of fast output
* @return Return 1 when the flag is set. Otherwise, return 0.
*/
PXIALG_API uint8_t PxiAlg_GetFastOutAlarmFlag(void);
/**
* @brief Call this function to enable or disable mems0 signal grade mode
* @param[in] 1 : enable. 0 : disable.
*/
PXIALG_API void PxiAlg_EnableMEMS0SigGrade(uint8_t en);
/**
* @brief Call this function to get the alarm flag of signal bad
* @param[out] get the alarm flag of bad signal
* @return Return 1 when the flag is set. Otherwise, return 0.
*/
PXIALG_API uint8_t PxiAlg_GetSignalBadAlarm();
#endif /* PXIALG_H__ */