24 lines
548 B
C
24 lines
548 B
C
|
#ifndef ADCDMA_H
|
||
|
#define ADCDMA_H
|
||
|
#include <stdint.h>
|
||
|
#include "oneway.h"
|
||
|
#include "config.h"
|
||
|
|
||
|
class AdcDma {
|
||
|
static constexpr unsigned ADC_HALF_LEN = 1u << FFTORDER;
|
||
|
static constexpr unsigned ADC_FULL_LEN = ADC_HALF_LEN * 2u;
|
||
|
|
||
|
uint16_t * pL;
|
||
|
uint16_t * pH;
|
||
|
uint16_t buffer [ADC_FULL_LEN];
|
||
|
OneWay<uint16_t> * dst;
|
||
|
public:
|
||
|
explicit AdcDma () noexcept;
|
||
|
void attach (OneWay<uint16_t> & d) { dst = & d; }
|
||
|
void send (const bool b);
|
||
|
protected:
|
||
|
void Dma1Ch1Init ();
|
||
|
};
|
||
|
|
||
|
#endif // ADCDMA_H
|