From c2f78a00b71a2cedb5086585a1b3fc464e9d3076 Mon Sep 17 00:00:00 2001 From: penglei <1624952103@qq.com> Date: Thu, 10 Jul 2025 17:19:51 +0800 Subject: [PATCH] =?utf8?q?=E4=BC=98=E5=8C=96=E5=8E=9F=E5=83=8F=E5=BF=83?= =?utf8?q?=E7=8E=87=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../drivers/boards/brandy_evb/board_config/board_w9.h | 2 +- code/sdk/drivers/peripheral/ppg/hal/ppg_hal.c | 4 ++-- code/sdk/drivers/peripheral/ppg/hal/ppg_hal.h | 6 +++--- .../ppg/pah8009/algorithm/pah_hr/V303009/pxialg.h | 4 ++-- .../algorithm/pah_hr/V303009/test_library_HRD.c | 11 ++++++++--- .../peripheral/ppg/pah8009/sensor/pah800x_main.c | 11 ++++++----- .../peripheral/ppg/pah8009/sensor/pah800x_main.h | 6 +++--- 7 files changed, 25 insertions(+), 19 deletions(-) diff --git a/code/sdk/drivers/boards/brandy_evb/board_config/board_w9.h b/code/sdk/drivers/boards/brandy_evb/board_config/board_w9.h index e42d63cbd..7921e4de3 100644 --- a/code/sdk/drivers/boards/brandy_evb/board_config/board_w9.h +++ b/code/sdk/drivers/boards/brandy_evb/board_config/board_w9.h @@ -343,7 +343,7 @@ const hal_gpio_config_t g_gpio_function_config[PIN_MAX_NUMBER] = { #endif #endif #ifdef ROTARYENCODER_MIXO - // { S_AGPIO_L0, HAL_GPIO_DIRECTION_INPUT, NULL, GPIO_INTERRUPT_DEDGE, mixo_int_callback}, + // { S_AGPIO_L0, HAL_GPIO_DIRECTION_INPUT, NULL, GPIO_INTERRUPT_FALLING_EDGE, mixo_int_callback}, #endif }; /** diff --git a/code/sdk/drivers/peripheral/ppg/hal/ppg_hal.c b/code/sdk/drivers/peripheral/ppg/hal/ppg_hal.c index a523acfdd..65b7e207a 100644 --- a/code/sdk/drivers/peripheral/ppg/hal/ppg_hal.c +++ b/code/sdk/drivers/peripheral/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-06-25 15:10:29 + * @LastEditTime: 2025-07-10 17:18:40 * @FilePath: /FD230/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_hal.c * @Description: * @@ -113,7 +113,7 @@ uint16_t ppg_get_chip_id(void) #elif defined PPG_GH3X2X // chip_id = GH3X2X_AFE_GetChipId(); #endif - ppg_power_off(); + ppg_power_off(); return chip_id; } diff --git a/code/sdk/drivers/peripheral/ppg/hal/ppg_hal.h b/code/sdk/drivers/peripheral/ppg/hal/ppg_hal.h index 8cda8ad72..e2b9ebc31 100644 --- a/code/sdk/drivers/peripheral/ppg/hal/ppg_hal.h +++ b/code/sdk/drivers/peripheral/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-06-09 11:26:55 + * @LastEditTime: 2025-07-09 16:12:34 * @FilePath: /FD230/code/sdk/drivers/peripheral/ppg/ppg/ppg_hal.h * @Description: * @@ -17,7 +17,7 @@ extern "C" { #endif /* __cplusplus */ #include "stdint.h" -#include "tyhx_hrs_custom.h" + #define AGC_TIMER_MODE 0 #define HRS_TIMER_MODE 1 @@ -28,7 +28,7 @@ extern "C" { #elif defined PPG_PAH8009 #define PPG_CHIP_ID 0x8008 #elif defined PPG_GH3X2X -#define PPG_CHIP_ID GH3X2X_CHIP_ID +#define PPG_CHIP_ID 0x3 #else #define PPG_CHIP_ID 0 #endif diff --git a/code/sdk/drivers/peripheral/ppg/pah8009/algorithm/pah_hr/V303009/pxialg.h b/code/sdk/drivers/peripheral/ppg/pah8009/algorithm/pah_hr/V303009/pxialg.h index ac2b98c25..bada56bbf 100644 --- a/code/sdk/drivers/peripheral/ppg/pah8009/algorithm/pah_hr/V303009/pxialg.h +++ b/code/sdk/drivers/peripheral/ppg/pah8009/algorithm/pah_hr/V303009/pxialg.h @@ -689,8 +689,8 @@ PXIALG_API uint8_t PxiAlg_DecodeProcess(uint32_t data, int touch_flag, float tim PXIALG_API uint8_t PxiAlg_Entrance_0(pah8series_data_t *pah8series_data); PXIALG_API uint8_t PxiAlg_Entrance(pah8series_data_t *pah8series_data); PXIALG_API uint8_t PxiAlg_EntranceD(pah8series_data_t *pah8series_data); -PXIALG_API uint32_t PxiAlg_Query_Mem_Size(); -PXIALG_API uint8_t PxiAlg_GetHrUpdateFlag(); +PXIALG_API uint32_t PxiAlg_Query_Mem_Size(void); +PXIALG_API uint8_t PxiAlg_GetHrUpdateFlag(void); PXIALG_API void PxiAlg_SetData_Seg(pah8series_data_t *pah8series_data); PXIALG_API uint8_t PxiAlg_Process_Seg(uint8_t *is_finished); diff --git a/code/sdk/drivers/peripheral/ppg/pah8009/algorithm/pah_hr/V303009/test_library_HRD.c b/code/sdk/drivers/peripheral/ppg/pah8009/algorithm/pah_hr/V303009/test_library_HRD.c index 4cecb6b98..204d61376 100644 --- a/code/sdk/drivers/peripheral/ppg/pah8009/algorithm/pah_hr/V303009/test_library_HRD.c +++ b/code/sdk/drivers/peripheral/ppg/pah8009/algorithm/pah_hr/V303009/test_library_HRD.c @@ -5,12 +5,12 @@ #include "pah800x_main.h" #include "pah800x_bsp.h" #include +#include "pxialg.h" +#include "pxivar.h" + //#include "nrf_delay.h" #define array_szie(arr) (sizeof(arr) / sizeof(arr[0])) - - - void test_library_HRD(void) { int i = 0; @@ -110,3 +110,8 @@ void test_library_HRD(void) return; } + +void log_printf(char *s, float f) +{ + printf("%s: %f\n", s, f); +} \ No newline at end of file diff --git a/code/sdk/drivers/peripheral/ppg/pah8009/sensor/pah800x_main.c b/code/sdk/drivers/peripheral/ppg/pah8009/sensor/pah800x_main.c index e5d067957..068b25500 100644 --- a/code/sdk/drivers/peripheral/ppg/pah8009/sensor/pah800x_main.c +++ b/code/sdk/drivers/peripheral/ppg/pah8009/sensor/pah800x_main.c @@ -347,8 +347,9 @@ void pah_sensor_stop(void) { touch_sensor_disable(); } - pah_800x_deinit(&_main.pah_800x); - + pah_800x_deinit(&_main.pah_800x); + + hr = 0; } void ppg_interrupt_handle(void) @@ -1701,9 +1702,9 @@ void pah8009_control(char *mode,uint8_t enable) work_mode = 2; } else if (strcmp(mode, "leaklight") == 0) { // md = FT_LEAK_LIGHT_MODE; - factory_test_mode(factory_test_leak_light_target_sample, 0, 0, 0, 0); - // extern void test_library_HRD(void); - // test_library_HRD(); + // factory_test_mode(factory_test_leak_light_target_sample, 0, 0, 0, 0); + extern void test_library_HRD(void); + test_library_HRD(); } else if (strcmp(mode, "wear") == 0) { pah_sensor_init(diw_4mm_g_ir_hrd); touch_only_sensor_start(); diff --git a/code/sdk/drivers/peripheral/ppg/pah8009/sensor/pah800x_main.h b/code/sdk/drivers/peripheral/ppg/pah8009/sensor/pah800x_main.h index 2e51b953c..8445abe1a 100644 --- a/code/sdk/drivers/peripheral/ppg/pah8009/sensor/pah800x_main.h +++ b/code/sdk/drivers/peripheral/ppg/pah8009/sensor/pah800x_main.h @@ -9,13 +9,13 @@ //static hr algotirhm -// #include "pxialg.h" +#include "pxialg.h" // spo2 algorithm -// #include "pxialg_spo2.h" +#include "pxialg_spo2.h" // Stress algorithm -// #include "pxialg_hrv.h" +#include "pxialg_hrv.h" #ifdef PPG_MEMS_Synchronize //MEMS-INT #include "pxi_interp.h" -- 2.17.1