add Chapter 15 - runtime observer implementation

This commit is contained in:
Amar Mahmutbegovic
2024-12-09 00:53:55 +01:00
parent b378383cf5
commit fb919233e2
1391 changed files with 1058445 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
#pragma once
#include <adc.hpp>
#include <units.hpp>
#include <stm32f0xx_hal.h>
#include <stm32f072xb.h>
namespace hal
{
class adc_stm32 : public adc{
public:
adc_stm32(units::voltage ref_voltage) : ref_voltage_(ref_voltage) {}
void init() override;
std::expected<units::voltage, adc::error> get_reading() override;
private:
ADC_HandleTypeDef adc_handle_;
units::voltage ref_voltage_;
};
};