libxr  1.0
Want to be the best embedded framework
Loading...
Searching...
No Matches
stm32_dac.hpp
1#include "main.h"
2
3#if defined(HAL_DAC_MODULE_ENABLED)
4
5#ifdef DAC
6#undef DAC
7#endif
8
9#include "dac.hpp"
10
11namespace LibXR
12{
13
19class STM32DAC : public DAC
20{
21 public:
26 STM32DAC(DAC_HandleTypeDef* hdac, uint32_t channel, float init_voltage = 0.0f,
27 float vref = 3.3f);
28
37 ErrorCode Write(float voltage) override;
38
39 private:
40 DAC_HandleTypeDef* hdac_;
41 uint32_t channel_;
42 float vref_;
43 uint32_t align_;
44 uint16_t resolution_;
45};
46
47} // namespace LibXR
48
49#endif
LibXR 命名空间
Definition ch32_gpio.hpp:9