50 explicit Channel(uint8_t _pin, int8_t _power,
bool _active_high)
80bool init(uint8_t _nchannels, Channel* _channels, uint8_t* _buf,
size_t _sz);
96 uint32_t warmup_ms = 100);
142int8_t
swap_buffer(uint8_t** buf,
size_t& sz,
size_t& ch_index);
150int8_t
drain_buffer(uint8_t** buf,
size_t& sz,
size_t& ch_index);
void sleep()
Turn off ADC and enter sleep mode.
Definition Adc.cpp:286
int8_t drain_buffer(uint8_t **buf, size_t &sz, size_t &ch_index)
NOT SAFE TO USE WHEN THE ADC IS ENABLED!
Definition Adc.cpp:182
const size_t MAX_CHANNEL_COUNT
Number of channels supported by the ADC (0 - 15).
Definition Adc.cpp:34
BitResolution
Supported bit resolutions for ADC sampling.
Definition Adc.h:13
uint32_t collected()
Definition Adc.cpp:326
uint32_t stop()
Stops ADC sampling and performs cleanup on registers.
Definition Adc.cpp:328
void on()
Activate internal board's ADC.
Definition Adc.cpp:279
AutotriggerSource
Potential sources for ADC interrupts to be triggered by.
Definition Adc.h:66
size_t bytes_per_sample(BitResolution res)
Definition Adc.cpp:519
bool init(uint8_t nchannels, Channel *channels, uint8_t *buf, size_t sz)
Initialize ADC module with these parameters for sampling.
Definition Adc.cpp:266
int8_t swap_buffer(uint8_t **buf, size_t &sz, size_t &ch_index)
Retrieve a buffer from the module belonging to a specific channel, writing the size and channel index...
Definition Adc.cpp:215
void off()
Turn off ADC.
Definition Adc.cpp:284
int8_t start(BitResolution res, uint32_t sample_rate, size_t ch_window_sz, uint32_t warmup_ms)
Start ADC sampling at a certain rate with a given bit resolution.
Definition Adc.cpp:291
Single ADC channel (pin + metadata).
Definition Adc.h:28
uint8_t pin
Pin number corresponding to the channel being read.
Definition Adc.h:32
Channel(uint8_t _pin, int8_t _power, bool _active_high)
Channel constructor.
Definition Adc.h:50
int8_t mux_mask()
Gets bit pattern for mux mask to use with ADC for channel.
Definition Adc.cpp:396
bool active_high
Boolean for if the power is active high or active high,.
Definition Adc.h:40
int8_t power
Power pin.
Definition Adc.h:36