pinetime-zephyr

HX HRS3300

this driver does not exist, so it has been created. Still work in progress ….

there is a sample in this repository which can be copied to the zephyr samples directory

west build -p -b pinetime samples/sensor/hrs3300

Overview

The HX HRS3300 sensor is a heart rate sensor, it produces 2 values: ALS and HRS. Ambient LIGHT SENSOR and HEART RATE SENSOR. Which have to be processed by an algorithm. I have no knowledge of a good open source algorithm yet.

I have used the settings of an arduino port of this library.

image

Requirements

for this sensor does not exist any driver, so here’s what I did to create one under zephyr

adapt CMakeLists.txt

~/zephyrproject-2/zephyr/drivers/sensor add_subdirectory_ifdef(CONFIG_HRS3300 hrs3300)

adapt Kconfig

~/zephyrproject-2/zephyr/drivers/sensor

add yaml file

~/zephyrproject-2/zephyr/dts/bindings/sensor add hx,hrs3300.yaml

edit KConfig

source “drivers/sensor/hrs3300/Kconfig”

create driver

see under drivers/sensor/hrs3300

complement the pinetime.dts file with the following (under samples/sensor/bma280)

&i2c1 {
        hrs3300@44 {
                   compatible = "hx,hrs3300";
                   reg = <0x44>;
                   label = "HRS3300";
                   };
       };

Create a file: /dts/bindings/sensor/hx,hrs3300.yaml. Which contains:

compatible: "hx,hrs3300"
properties:

Building and Running

Todo

References

HRS3300 Heart Rate Sensor.pdf https://github.com/atc1441/HRS3300-Arduino-Library