Rohit Grover / Mbed 2 deprecated BLE_HeartRate_Pixart

Dependencies:   BLE_API mbed nRF51822 paw8001motion25_nrf51_mbed_keil

Fork of BLE_HeartRate by Bluetooth Low Energy

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers pxialg.h Source File

pxialg.h

00001 #ifndef PXIALG_H__
00002 #define PXIALG_H__
00003 #include "stdint.h"
00004 
00005 #define PXIALG_API
00006 
00007 typedef enum {
00008     FLAG_DATA_READY = 0,
00009     FLAG_DATA_NOT_READY,
00010     FLAG_DATA_LOSS,
00011     FLAG_NO_TOUCH,
00012     FLAG_DATA_ERROR,
00013     FLAG_POOR_SIGNAL,
00014 } PXI_STATUS_FLAG;
00015 
00016 /**
00017  * @brief When HRD and MEMS data are ready, call this function to do the algorithm processing
00018  *
00019  * @param[in] HRD_Data   Pointer to the buffer where HRD data (13 Bytes) is stored.
00020  * @param[in] MEMS_Data  Pointer to the buffer where MEMS data (3*sizeof(float) Bytes) is stored.
00021  *
00022  * @return Return one of the PXI_STATUS_FLAG types.
00023  */
00024 PXIALG_API int32_t PxiAlg_Process(unsigned char *HRD_Data, float *MEMS_Data);
00025 
00026 /**
00027  * @brief Call this function to get Heart Rate
00028  *
00029  * @param[out] hr   Pointer to a float variable where heart rate is stored
00030  *
00031  * @return None
00032  */
00033 PXIALG_API void PxiAlg_HrGet(float *hr);
00034 
00035 /**
00036  * @brief Call this function to determine the version of the algorithm
00037  *
00038  *
00039  * @return Version of the algorithm
00040  */
00041 PXIALG_API int32_t PxiAlg_Version(void);
00042 
00043 /**
00044  * @brief Call this funtion to get Ready_Flag
00045  *
00046  * @return Return Ready_Flag
00047  */
00048 PXIALG_API unsigned char PxiAlg_GetReadyFlag(void);
00049 
00050 /**
00051  * @brief Call this funtion to get Motion_Flag
00052  *
00053  * @return Return Motion_Flag
00054  */
00055 PXIALG_API unsigned char PxiAlg_GetMotionFlag(void);
00056 
00057 /**
00058  * @brief Call this function to notify algorithm the MEMS Scale of Motion Sensor
00059  *
00060  * @param[in] scale The MEMS Scale of Motion Sensor. Only 0(2G),1(4G~16G) are supported.
00061  *
00062  * @return 1 for success. 0 for failure.
00063  */
00064 PXIALG_API uint8_t PxiAlg_SetMemsScale(int scale);
00065 
00066 /**
00067  * @brief Call this function to get PPG Signal Grade
00068  *
00069  * @param[out] grade    Pointer to a float variable where signal grade is stored.
00070  *
00071  * @return  Return 1 when Signal Grade is ready. Otherwise, return 0.
00072  */
00073 PXIALG_API uint8_t PxiAlg_GetSigGrade(float *grade);
00074 
00075 /**
00076  * @brief Call this function to set PPG Signal Grade Threshold
00077  *
00078  * @param[in] threshold The PPG Signal Grade Threshold. Its value ranges from 0 to 100.
00079  *
00080  * @return 1 for success. 0 for failure.
00081  */
00082 PXIALG_API uint8_t PxiAlg_SetSigGradeThrd(float thrd);
00083 
00084 /**
00085  * @brief Call this function to enable or disable fast output mode
00086  *
00087  * @param[in] en The flag of fast output mode.
00088  */
00089 PXIALG_API void PxiAlg_EnableFastOutput(uint8_t en);
00090 
00091 /**
00092  * @brief Call this function to enable or disable motion mode
00093  *
00094  * @param[in] en The flag of motion mode.
00095  */
00096 PXIALG_API void PxiAlg_EnableMotionMode(uint8_t en);
00097 
00098 /**
00099  * @brief Call this function to open algorithm
00100  */
00101 PXIALG_API void PxiAlg_Open(void);
00102 
00103 /**
00104  * @brief Call this function to close algorithm
00105  */
00106 PXIALG_API void PxiAlg_Close(void);
00107 
00108 #endif /* PXIALG_H__ */