RISC-V/V203F6P6/termistor/adc.h

22 lines
498 B
C
Raw Normal View History

2025-01-27 16:21:54 +01:00
#ifndef ADCDMA_H
#define ADCDMA_H
#include <stdint.h>
#include "oneway.h"
class AdcDma {
2025-01-29 09:59:36 +01:00
static constexpr unsigned HALF_LEN = 0x80u;
static constexpr unsigned FULL_LEN = HALF_LEN * 2u;
2025-01-27 16:21:54 +01:00
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; }
2025-01-29 09:59:36 +01:00
void send (const bool b);
protected:
void DmaInit ();
2025-01-27 16:21:54 +01:00
};
#endif // ADCDMA_H