From: penglei <1624952103@qq.com> Date: Mon, 27 Oct 2025 08:17:59 +0000 (+0800) Subject: 增加获取hrv接口 X-Git-Tag: V1.0.9_20251128_194606_LN~166^2~1 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=b19e9ba15534fadd2e8200fd58b0b9163cc12558;p=mirrors%2FFD230.git 增加获取hrv接口 --- diff --git a/code/sdk/zhihui/drivers/ppg/hal/ppg_hal.c b/code/sdk/zhihui/drivers/ppg/hal/ppg_hal.c index 76f4df4f7..10b7b6fbe 100644 --- a/code/sdk/zhihui/drivers/ppg/hal/ppg_hal.c +++ b/code/sdk/zhihui/drivers/ppg/hal/ppg_hal.c @@ -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; diff --git a/code/sdk/zhihui/drivers/ppg/hal/ppg_hal.h b/code/sdk/zhihui/drivers/ppg/hal/ppg_hal.h index cdb034bba..fe22e78c9 100644 --- a/code/sdk/zhihui/drivers/ppg/hal/ppg_hal.h +++ b/code/sdk/zhihui/drivers/ppg/hal/ppg_hal.h @@ -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 diff --git a/code/sdk/zhihui/drivers/ppg/hx3695/hx3695.c b/code/sdk/zhihui/drivers/ppg/hx3695/hx3695.c index 03fd50a30..f0645a4fb 100644 --- a/code/sdk/zhihui/drivers/ppg/hx3695/hx3695.c +++ b/code/sdk/zhihui/drivers/ppg/hx3695/hx3695.c @@ -53,6 +53,7 @@ static uint8_t hrs_ble_falg = 0; // static int history_wear_status = -1; static uint8_t wear_result = 0; static uint8_t spo2_ret = 0; +static uint8_t hrv_ret = 0; static int32_t factory_data = 0; static uint8_t hx3695_chip_id = 0; #ifdef SUPPORT_CYWEE_SERVICE @@ -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); 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); // printf("hrv:%d\n",hrv_alg_results.hrv_result); + hrv_ret = hrv_alg_results.hrv_result; break; } default: @@ -1438,6 +1440,10 @@ uint8_t hx3695_get_spo2(void) return spo2_ret; } +uint8_t hx3695_get_hrv(void) +{ + return hrv_ret; +} uint8_t hx3695_get_wear_status(void) { diff --git a/code/sdk/zhihui/drivers/ppg/hx3695/hx3695.h b/code/sdk/zhihui/drivers/ppg/hx3695/hx3695.h index 4402b853c..504766708 100644 --- a/code/sdk/zhihui/drivers/ppg/hx3695/hx3695.h +++ b/code/sdk/zhihui/drivers/ppg/hx3695/hx3695.h @@ -240,6 +240,7 @@ void hx3695_set_hrs_ble_swtich(uint8_t cmd); uint8_t hx3695_get_hrs_ble_swtich(void); uint8_t hx3695_get_hrs(void); uint8_t hx3695_get_spo2(void); +uint8_t hx3695_get_hrv(void); uint8_t hx3695_get_wear_status(void); int32_t hx3695_get_factory_data(void); void hx3695_control(char *mode,uint8_t enable);