From 1a582815ba218d2a9047abae92b9f33a3301ffd5 Mon Sep 17 00:00:00 2001 From: Jean-François Milants Date: Sun, 10 Jan 2021 17:57:26 +0100 Subject: First implementation of the HR sensor using 100% foss code (ported from waspos) --- src/components/heartrate/Ppg.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/components/heartrate/Ppg.h (limited to 'src/components/heartrate/Ppg.h') diff --git a/src/components/heartrate/Ppg.h b/src/components/heartrate/Ppg.h new file mode 100644 index 00000000..846ade08 --- /dev/null +++ b/src/components/heartrate/Ppg.h @@ -0,0 +1,30 @@ +#pragma once + +#include +#include "Biquad.h" +#include "Ptagc.h" + +namespace Pinetime { + namespace Controllers { + class Ppg { + public: + explicit Ppg(float spl); + + int Preprocess(float spl); + float HeartRate(); + + void SetOffset(uint16_t i); + + private: + std::array data; + size_t dataIndex = 0; + float offset; + Biquad hpf; + Ptagc agc; + Biquad lpf; + + + float ProcessHeartRate(); + }; + } +} \ No newline at end of file -- cgit v1.2.3-70-g09d2