增加获取hrv接口
authorpenglei <1624952103@qq.com>
Mon, 27 Oct 2025 08:17:59 +0000 (16:17 +0800)
committerpenglei <1624952103@qq.com>
Mon, 27 Oct 2025 08:17:59 +0000 (16:17 +0800)
code/sdk/zhihui/drivers/ppg/hal/ppg_hal.c
code/sdk/zhihui/drivers/ppg/hal/ppg_hal.h
code/sdk/zhihui/drivers/ppg/hx3695/hx3695.c
code/sdk/zhihui/drivers/ppg/hx3695/hx3695.h

index 76f4df4..10b7b6f 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: penglei 1624952103@qq.com
  * @Date: 2024-03-13 15:08:38
  * @LastEditors: penglei 1624952103@qq.com
- * @LastEditTime: 2025-08-07 12:01:02
+ * @LastEditTime: 2025-10-27 16:05:36
  * @FilePath: /FD230/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_hal.c
  * @Description: 
  * 
@@ -101,6 +101,18 @@ uint8_t ppg_get_spo2(void)
     return spo2;
 }
 
+uint8_t ppg_get_hrv(void)
+{
+    uint8_t hrv = 0;
+#ifdef PPG_HX3695
+    hrv = hx3695_get_hrv();
+#elif defined PPG_PAH8009
+
+#endif
+    return hrv;
+}
+
+
 uint8_t ppg_get_wear_status(void)
 {
     uint8_t wear_status = 0;
index cdb034b..fe22e78 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: penglei 1624952103@qq.com
  * @Date: 2024-06-07 11:18:26
  * @LastEditors: penglei 1624952103@qq.com
- * @LastEditTime: 2025-07-28 16:41:38
+ * @LastEditTime: 2025-10-27 16:00:09
  * @FilePath: /FD230/code/sdk/drivers/peripheral/ppg/ppg/ppg_hal.h
  * @Description: 
  * 
@@ -64,6 +64,7 @@ void ppg_check_int(void);
 
 void ppg_set_factory_log_switch(uint8_t cmd);
 uint8_t ppg_get_factory_log_switch(void);
+uint8_t ppg_get_hrv(void);
 
 #ifdef __cplusplus
 #if __cplusplus
index 03fd50a..f0645a4 100644 (file)
@@ -53,6 +53,7 @@ static uint8_t hrs_ble_falg = 0;
 // static int history_wear_status = -1;\r
 static uint8_t wear_result = 0;\r
 static uint8_t spo2_ret = 0;\r
+static uint8_t hrv_ret = 0;\r
 static int32_t factory_data = 0;\r
 static uint8_t hx3695_chip_id = 0;\r
 #ifdef SUPPORT_CYWEE_SERVICE\r
@@ -1393,6 +1394,7 @@ void hx3695_alg_send_data(ppg_sensor_data_t *ppg_sensor_dat, WORK_MODE_T mode, u
                hrv_alg_results = tyhx_hrv_alg_send_bufdata(ppg_sensor_dat->led_data[0].data_val,data_count, gsen_data_x_fifo, gsen_data_y_fifo, gsen_data_z_fifo);\r
                        DEBUG_PRINTF("data_cnt:%d hrv_result:%d motion:%d p_m:%d screen_up:%d signal_quality:%d \r\n", hrv_alg_results.data_cnt,hrv_alg_results.hrv_result,hrv_alg_results.motion,hrv_alg_results.p_m,hrv_alg_results.screen_up,hrv_alg_results.signal_quality);\r
             // printf("hrv:%d\n",hrv_alg_results.hrv_result);\r
+            hrv_ret = hrv_alg_results.hrv_result;\r
                        break;\r
                }\r
                default:\r
@@ -1438,6 +1440,10 @@ uint8_t hx3695_get_spo2(void)
     return spo2_ret;\r
 }\r
 \r
+uint8_t hx3695_get_hrv(void)\r
+{\r
+    return hrv_ret;\r
+}\r
 \r
 uint8_t hx3695_get_wear_status(void)\r
 {\r
index 4402b85..5047667 100644 (file)
@@ -240,6 +240,7 @@ void hx3695_set_hrs_ble_swtich(uint8_t cmd);
 uint8_t hx3695_get_hrs_ble_swtich(void);\r
 uint8_t hx3695_get_hrs(void);\r
 uint8_t hx3695_get_spo2(void);\r
+uint8_t hx3695_get_hrv(void);\r
 uint8_t hx3695_get_wear_status(void);\r
 int32_t hx3695_get_factory_data(void);\r
 void hx3695_control(char *mode,uint8_t enable);\r