mcu_hi3321_watch/tjd/driver/ppg/ppg_drv_gh3011.h
2025-05-26 20:15:20 +08:00

52 lines
1.7 KiB
C

/*----------------------------------------------------------------------------
* Copyright (c) Fenda Technologies Co., Ltd. 2021. All rights reserved.
*
* Description: ppg_drv_gh3011.h
*
* Author: shey.tanxiaoyu
*
* Create: 2022-04-20
*--------------------------------------------------------------------------*/
#ifndef __PPG_DRV_GH3011__H
#define __PPG_DRV_GH3011__H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define GH3011_DEV_ID 0x31
typedef enum {
GH3011_RUN_MODE_UNKNOW, //unknow
GH3011_RUN_MODE_WEAR, //ir
GH3011_RUN_MODE_HR, //green led
GH3011_RUN_MODE_HR_ADT, //green led and ir
GH3011_RUN_MODE_SPO2, //red led
GH3011_RUN_MODE_SPO2_ADT, //red led and ir
GH3011_RUN_MODE_HRV, //green led
GH3011_RUN_MODE_HRV_ADT, //green led and ir
GH3011_RUN_MODE_BP_ADT, //green led and ir
GH3011_RUN_MODE_FACT_LED_IR, //factory ir
GH3011_RUN_MODE_FACT_LED_GREED, //factory green
GH3011_RUN_MODE_FACT_LED_RED, //factory red
} GH3011_RUN_MODE;
int32_t drv_gh3011_init(void);
int32_t drv_gh3011_get_chip_id(uint16_t *chip_id);
int32_t drv_gh3011_get_run_mode(uint8_t *run_mode); //GH3011_RUN_MODE
int32_t drv_gh3011_open(GH3011_RUN_MODE run_mode, void (*p_callback)(void));
void drv_gh3011_close(void);
void drv_gh3011_read(int32_t read_buf[][2], uint16_t *read_len);
void drv_gh3011_current_set(uint16_t cur0, uint16_t cur1, uint16_t cur2);
void drv_gh3011_current_get(uint16_t *cur0, uint16_t *cur1, uint16_t *cur2);
#ifdef __cplusplus
}
#endif
#endif /* __PPG_DRV_GH3011__H */