RISC-V/V203F6P6/termistor/adc.h
2025-01-29 09:59:36 +01:00

21 lines
498 B
C++

#ifndef ADCDMA_H
#define ADCDMA_H
#include <stdint.h>
#include "oneway.h"
class AdcDma {
static constexpr unsigned HALF_LEN = 0x80u;
static constexpr unsigned FULL_LEN = HALF_LEN * 2u;
uint16_t * pL;
uint16_t * pH;
uint16_t buffer [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 DmaInit ();
};
#endif // ADCDMA_H