PebbleOS
Loading...
Searching...
No Matches
Modules | Functions
Heart rate monitor

Heart rate monitor (HRM) driver interface. More...

Modules

 GH3x2x
 Heart rate monitor implementation for the Goodix GH3x2x sensors.
 
 QEMU HRM
 Heart rate monitor implementation for QEMU, which emulates no heart rate sensor.
 

Functions

void hrm_init (HRMDevice *dev)
 Initialize the HRM.
 
bool hrm_enable (HRMDevice *dev, HRMFeature features, bool low_latency)
 Enable the HRM.
 
void hrm_disable (HRMDevice *dev)
 Disable the HRM.
 
bool hrm_is_enabled (HRMDevice *dev)
 Check whether the HRM is enabled.
 
void hrm_set_activity_scene (HRMDevice *dev, HRMActivityScene scene)
 Tell the HRM which activity is in progress.
 

Detailed Description

Heart rate monitor (HRM) driver interface.

Used by the HRM manager service; the driver reports readings back to it with hrm_manager_new_data_cb(). The per-implementation HRMDevice definitions live in the HRM driver subgroups.

hrm_init(HRM);
if (hrm_enable(HRM, HRMFeature_BPM, true)) {
...
}
bool hrm_enable(HRMDevice *dev, HRMFeature features, bool low_latency)
Enable the HRM.
void hrm_init(HRMDevice *dev)
Initialize the HRM.
void hrm_disable(HRMDevice *dev)
Disable the HRM.
@ HRMFeature_BPM
Heart rate, in beats per minute.
Definition hrm_manager.h:90

Function Documentation

◆ hrm_disable()

void hrm_disable ( HRMDevice *  dev)

Disable the HRM.

Parameters
devHRM device.

◆ hrm_enable()

bool hrm_enable ( HRMDevice *  dev,
HRMFeature  features,
bool  low_latency 
)

Enable the HRM.

Samples the PPG functions needed for the requested features.

Parameters
devHRM device.
featuresBitmask of HRMFeature values to collect.
low_latencyTrue for live sessions that need prompt updates (workout, foreground app); false for background logging, where the FIFO can be drained less often to save wakeups since only the final reading matters.
Returns
True if enabled, false if initialization failed.

◆ hrm_init()

void hrm_init ( HRMDevice *  dev)

Initialize the HRM.

Parameters
devHRM device.

◆ hrm_is_enabled()

bool hrm_is_enabled ( HRMDevice *  dev)

Check whether the HRM is enabled.

Parameters
devHRM device.
Returns
True if enabled.

◆ hrm_set_activity_scene()

void hrm_set_activity_scene ( HRMDevice *  dev,
HRMActivityScene  scene 
)

Tell the HRM which activity is in progress.

Lets the algorithm use a motion-appropriate mode. Safe to call at any time and idempotent.

Parameters
devHRM device.
sceneCurrent activity.