PebbleOS
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions

Heart rate monitor implementation for the Goodix GH3x2x sensors. More...

Data Structures

struct  HRMDevice
 GH3x2x device. More...
 

Macros

#define HRM_PPG_CH_NUM   6
 Number of PPG channels.
 
#define HRM_PPG_FACTORY_TEST_FIFO_LEN   80
 Samples per channel averaged by the factory tests.
 

Enumerations

enum  GH3x2xFTType { HRM_FACTORY_TEST_NONE , HRM_FACTORY_TEST_CTR , HRM_FACTORY_TEST_LIGHT_LEAK , HRM_FACTORY_TEST_HSM }
 Factory test type. More...
 

Functions

bool gh3x2x_ble_data_recv (void *context)
 Queue tuning protocol data received over BLE for processing on the system task.
 
void gh3x2x_wear_evt_notify (bool is_wear)
 Report the wear detection state.
 
void gh3x2x_rawdata_notify (uint32_t *p_rawdata, uint32_t data_count)
 Feed raw PPG data to the factory tests.
 
void gh3x2x_start_ft_ctr (void)
 Start the CTR factory test on the system task.
 
void gh3x2x_start_ft_leakage (void)
 Start the light leakage factory test on the system task.
 
void gh3x2x_factory_test_disable ()
 Stop the running factory test on the system task.
 
void gh3x2x_set_work_mode (int32_t mode)
 Set the sampling functions used when the sensor is next enabled.
 

Detailed Description

Heart rate monitor implementation for the Goodix GH3x2x sensors.

Also exposes the hooks used by the vendor library and the manufacturing tests.


Data Structure Documentation

◆ HRMDevice

struct HRMDevice

GH3x2x device.

QEMU HRM device.

Data Fields
I2CSlavePort * i2c Sensor I2C port.
ExtiConfig int_exti Sensor interrupt line.
InputConfig int_input Sensor interrupt line, as an input.
OutputConfig reset_gpio Sensor reset line.
HRMDeviceState * state Driver runtime state.

Macro Definition Documentation

◆ HRM_PPG_CH_NUM

#define HRM_PPG_CH_NUM   6

Number of PPG channels.

◆ HRM_PPG_FACTORY_TEST_FIFO_LEN

#define HRM_PPG_FACTORY_TEST_FIFO_LEN   80

Samples per channel averaged by the factory tests.

Enumeration Type Documentation

◆ GH3x2xFTType

Factory test type.

Enumerator
HRM_FACTORY_TEST_NONE 

No test.

HRM_FACTORY_TEST_CTR 

CTR (LED-to-sensor coupling) test.

HRM_FACTORY_TEST_LIGHT_LEAK 

Light leakage test.

HRM_FACTORY_TEST_HSM 

Noise test.

Function Documentation

◆ gh3x2x_ble_data_recv()

bool gh3x2x_ble_data_recv ( void *  context)

Queue tuning protocol data received over BLE for processing on the system task.

Only with CONFIG_BT_GH3X2X_TUNING_SERVICE.

Parameters
contextHeap buffer holding a 32-bit length followed by the data; freed once processed.
Returns
True if queued.

◆ gh3x2x_factory_test_disable()

void gh3x2x_factory_test_disable ( )

Stop the running factory test on the system task.

MFG builds only.

◆ gh3x2x_rawdata_notify()

void gh3x2x_rawdata_notify ( uint32_t *  p_rawdata,
uint32_t  data_count 
)

Feed raw PPG data to the factory tests.

Does nothing unless a factory test is running (MFG builds only).

Parameters
p_rawdataRaw samples, interleaved over HRM_PPG_CH_NUM channels.
data_countNumber of values in p_rawdata.

◆ gh3x2x_set_work_mode()

void gh3x2x_set_work_mode ( int32_t  mode)

Set the sampling functions used when the sensor is next enabled.

Soft wear detection is always added. MFG builds only.

Parameters
modeBitmask of GH3X2X_FUNCTION_* values.

◆ gh3x2x_start_ft_ctr()

void gh3x2x_start_ft_ctr ( void  )

Start the CTR factory test on the system task.

Results are reported through the HRM manager as HRMFeature_CTR data. MFG builds only.

◆ gh3x2x_start_ft_leakage()

void gh3x2x_start_ft_leakage ( void  )

Start the light leakage factory test on the system task.

Results are reported through the HRM manager as HRMFeature_Leakage data. MFG builds only.

◆ gh3x2x_wear_evt_notify()

void gh3x2x_wear_evt_notify ( bool  is_wear)

Report the wear detection state.

Parameters
is_wearTrue if the watch is worn.