theCore C++ embedded framework
ecl::adc< dev > Class Template Reference

ADC peripheral class. More...

#include </home/travis/build/forGGe/theCore/platform/stm32/export/aux/adc.hpp>

Public Types

using sample_type = uint16_t
 Type of signle sample. Enough to hold sample values of given ADC. More...
 
template<typename Group >
using sample_array = std::array< sample_type, Group::template extractor< extractor >::conv_num()>
 Buffer required to hold all samples from given channel group. More...
 

Static Public Member Functions

static void init ()
 Initializes given ADC. More...
 
template<typename Group >
static void enable_channels (sample_array< Group > &out_samples)
 Configures ADC to work with given channels, in IRQ mode. More...
 
static err single ()
 Performs single conversion of the previously configured channels and waits till the end of the conversion. More...
 
static err single (const adc_evh &evh)
 Performs single conversion of the previously configured channels asynchronously. More...
 

Detailed Description

template<adc_dev dev>
class ecl::adc< dev >

ADC peripheral class.

Provides API to work with ADC on stm32 platform.

Template Parameters
devADC device to work with.

Member Typedef Documentation

◆ sample_type

template<adc_dev dev>
using ecl::adc< dev >::sample_type = uint16_t

Type of signle sample. Enough to hold sample values of given ADC.

◆ sample_array

template<adc_dev dev>
template<typename Group >
using ecl::adc< dev >::sample_array = std::array<sample_type, Group::template extractor<extractor>::conv_num()>

Buffer required to hold all samples from given channel group.

Todo:
replace it with array_span, array_view or simliar.
Template Parameters
GroupGroup of channels that will be converted and result will be stored in this buffer.

The documentation for this class was generated from the following file: