#include <modm/driver/adc/adc_sampler.hpp>
|
typedef uint16_t | DataType |
| this type is chosen automatically, it may be uint8_t, uint16_t or uint32_t
|
|
template<class AdcInterrupt, uint8_t Channels, uint32_t Oversamples = 1>
class modm::AdcSampler< AdcInterrupt, Channels, Oversamples >
- Template Parameters
-
AdcInterrupt | a class implementing the AdcInterrupt interface |
Channels | number of ADC channels connected to sensor(s) >= 1 |
Oversamples | # of samples to average for each channel |
- Author
- Niklas Hauser
template<class AdcInterrupt , uint8_t Channels, uint32_t Oversamples = 1>
- Returns
- pointer to first element of 16bit result array
template<class AdcInterrupt , uint8_t Channels, uint32_t Oversamples = 1>
static void modm::AdcSampler< AdcInterrupt, Channels, Oversamples >::initialize |
( |
const Channel * |
mapping, |
|
|
DataType * |
data |
|
) |
| |
|
static |
- Parameters
-
mapping | array of length Channels containing the channel-to-data mapping |
data | array of length Channels containing the results |
template<class AdcInterrupt , uint8_t Channels, uint32_t Oversamples = 1>
static bool modm::AdcSampler< AdcInterrupt, Channels, Oversamples >::isReadoutFinished |
( |
| ) |
|
|
static |
- Returns
true
if sampling finshed, false
if sampling is currently on-going
- Warning
- The class adds and divides the oversamples in-place, so the data is invalid while
isReadoutFinished()
returns false!
template<class AdcInterrupt , uint8_t Channels, uint32_t Oversamples = 1>
static bool modm::AdcSampler< AdcInterrupt, Channels, Oversamples >::startReadout |
( |
| ) |
|
|
static |
Starts the ADC readout routine and buffers the results
- Returns
false
when a readout is in progress, true
otherwise
The documentation for this class was generated from the following file: