blob: b948ab27c305719752a8008d990ffc7e746ee05a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
#ifndef CM3CPP_ADC_DMA_H_
#define CM3CPP_ADC_DMA_H_
#include <cm3cpp_config.h>
#include <cstring>
#include <libopencm3/stm32/dma.h>
#include "cm3cpp_adc.h"
#include "private/assert.h"
namespace cm3cpp {
namespace adc {
class AdcDma
{
public:
struct DmaConf
{
uint32_t number;
uint32_t stream;
uint32_t channel;
};
struct AdcConf
{
Adc::Number number;
Adc::Channel* channels;
uint8_t channels_count;
};
AdcDma(DmaConf dma, AdcConf adc, bool is_temp_sensor);
CM3CPP_EXPLISIT_DESTRUCTOR(AdcDma)
uint16_t get_value(uint8_t index);
private:
Adc* _adc;
uint16_t* _data;
};
} // namespace adc
} // namespace cm3cpp
#endif /* CM3CPP_ADC_DMA_H_ */
|