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
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.
for this sensor does not exist any driver, so here’s what I did to create one under zephyr
~/zephyrproject-2/zephyr/drivers/sensor add_subdirectory_ifdef(CONFIG_HRS3300 hrs3300)
~/zephyrproject-2/zephyr/drivers/sensor
~/zephyrproject-2/zephyr/dts/bindings/sensor add hx,hrs3300.yaml
source “drivers/sensor/hrs3300/Kconfig”
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:
- algorithm for heartrate
- power saving
- switching off/on mechanism
HRS3300 Heart Rate Sensor.pdf https://github.com/atc1441/HRS3300-Arduino-Library