theCore C++ embedded framework
|
Data Structures | |
struct | ecl::channel_group< trig, chans > |
Channels grouped together along with an external trigger. More... | |
struct | ecl::channel_group_sw_trigger< chans > |
Channels grouped together, conversion triggered by software. More... | |
struct | ecl::channel_group_exti_trigger< edge, chans > |
Channels grouped together, conversion triggered by EXTI line. More... | |
struct | ecl::adc_cfg< dev > |
ADC configuration prototype. More... | |
struct | ecl::extractor< chs > |
Extracts information of the given channel group. More... | |
class | ecl::adc_irq_dispatcher |
ADC interrupts helper. More... | |
class | ecl::adc< dev > |
ADC peripheral class. More... | |
class | ecl::mgmt_configurator< dev, mode > |
Management configurator class. More... | |
class | ecl::mgmt_configurator< dev, adc_mgmt_mode::irq > |
Configurator for ADC IRQ mode. More... | |
class | ecl::mgmt_configurator< dev, adc_mgmt_mode::dma > |
Configurator for ADC DMA mode. More... | |
Typedefs | |
using | ecl::adc_evh = std::function< void(adc_event)> |
ADC event handler. Event code signifies result of a conversion. More... | |
Enumerations | |
enum | ecl::adc_mgmt_mode { ecl::adc_mgmt_mode::dma, ecl::adc_mgmt_mode::irq } |
ADC management mode. More... | |
enum | ecl::adc_trigger { ecl::adc_trigger::t1_cc1 = ADC_ExternalTrigConv_T1_CC1, ecl::adc_trigger::t1_cc2 = ADC_ExternalTrigConv_T1_CC2, ecl::adc_trigger::t1_cc3 = ADC_ExternalTrigConv_T1_CC3, ecl::adc_trigger::t2_cc2 = ADC_ExternalTrigConv_T2_CC2, ecl::adc_trigger::t2_cc3 = ADC_ExternalTrigConv_T2_CC3, ecl::adc_trigger::t2_cc4 = ADC_ExternalTrigConv_T2_CC4, ecl::adc_trigger::t2_trgo = ADC_ExternalTrigConv_T2_TRGO, ecl::adc_trigger::t3_cc1 = ADC_ExternalTrigConv_T3_CC1, ecl::adc_trigger::t3_trgo = ADC_ExternalTrigConv_T3_TRGO, ecl::adc_trigger::t4_cc4 = ADC_ExternalTrigConv_T4_CC4, ecl::adc_trigger::t5_cc1 = ADC_ExternalTrigConv_T5_CC1, ecl::adc_trigger::t5_cc2 = ADC_ExternalTrigConv_T5_CC2, ecl::adc_trigger::t5_cc3 = ADC_ExternalTrigConv_T5_CC3, ecl::adc_trigger::t8_cc1 = ADC_ExternalTrigConv_T8_CC1, ecl::adc_trigger::t8_trgo = ADC_ExternalTrigConv_T8_TRGO } |
The external event used to trigger the start of conversion of a group. More... | |
enum | ecl::adc_trigger_edge { ecl::adc_trigger_edge::rising = ADC_ExternalTrigConvEdge_Rising, ecl::adc_trigger_edge::falling = ADC_ExternalTrigConvEdge_Falling, ecl::adc_trigger_edge::both = ADC_ExternalTrigConvEdge_RisingFalling } |
The external trigger edge in case of EXTI line used as a trigger. More... | |
enum | ecl::adc_channel { ecl::adc_channel::ch0 = ADC_Channel_0, ecl::adc_channel::ch1 = ADC_Channel_1, ecl::adc_channel::ch2 = ADC_Channel_2, ecl::adc_channel::ch3 = ADC_Channel_3, ecl::adc_channel::ch4 = ADC_Channel_4, ecl::adc_channel::ch5 = ADC_Channel_5, ecl::adc_channel::ch6 = ADC_Channel_6, ecl::adc_channel::ch7 = ADC_Channel_7, ecl::adc_channel::ch8 = ADC_Channel_8, ecl::adc_channel::ch9 = ADC_Channel_9, ecl::adc_channel::ch10 = ADC_Channel_10, ecl::adc_channel::ch11 = ADC_Channel_11, ecl::adc_channel::ch12 = ADC_Channel_12, ecl::adc_channel::ch13 = ADC_Channel_13, ecl::adc_channel::ch14 = ADC_Channel_14, ecl::adc_channel::ch15 = ADC_Channel_15, ecl::adc_channel::ch16 = ADC_Channel_16, ecl::adc_channel::ch17 = ADC_Channel_17, ecl::adc_channel::ch18 = ADC_Channel_18 } |
ADC possible channels. More... | |
Functions | |
static adc_irq_dispatcher & | ecl::adc_irq_dispatcher::get_instance () |
Gets dispatcher instance. More... | |
template<adc_dev dev> | |
void | ecl::adc_irq_dispatcher::subscribe (const adc_evh &h) |
Subscribes for ADC events and registers given handler handler. More... | |
template<adc_dev dev> | |
void | ecl::adc_irq_dispatcher::unsubscribe () |
Unsubscribes from ADC events and deregisters event handler. More... | |
static void | ecl::mgmt_configurator< dev, adc_mgmt_mode::irq >::init () |
Initializes ADC to work in the IRQ mode. More... | |
template<typename Group > | |
static void | ecl::mgmt_configurator< dev, adc_mgmt_mode::irq >::enable_channels (typename adc< dev >::template sample_array< Group > &out_samples) |
Enables IRQ mode for given channels. More... | |
static void | ecl::mgmt_configurator< dev, adc_mgmt_mode::irq >::single (const adc_evh &evh) |
Performs IRQ configuration for single-mode async conversion. More... | |
static void | ecl::mgmt_configurator< dev, adc_mgmt_mode::dma >::init () |
Initializes ADC to work in the DMA mode. More... | |
template<typename Group > | |
static void | ecl::mgmt_configurator< dev, adc_mgmt_mode::dma >::enable_channels (typename adc< dev >::template sample_array< Group > &out_samples) |
Enables DMA mode for given channels. More... | |
static void | ecl::mgmt_configurator< dev, adc_mgmt_mode::dma >::single (const adc_evh &evh) |
Performs DMA configuration for single-mode async conversion. More... | |
static void | ecl::adc< dev >::init () |
Initializes given ADC. More... | |
template<typename Group > | |
static void | ecl::adc< dev >::enable_channels (sample_array< Group > &out_samples) |
Configures ADC to work with given channels, in IRQ mode. More... | |
static err | ecl::adc< dev >::single () |
Performs single conversion of the previously configured channels and waits till the end of the conversion. More... | |
static err | ecl::adc< dev >::single (const adc_evh &evh) |
Performs single conversion of the previously configured channels asynchronously. More... | |
using ecl::adc_evh = typedef std::function<void(adc_event)> |
ADC event handler. Event code signifies result of a conversion.
|
strong |
|
strong |
|
strong |
|
strong |
|
inlinestatic |
Gets dispatcher instance.
|
inline |
Subscribes for ADC events and registers given handler handler.
adc | ADC device for which event handler should be registered. |
[in] | h | ADC event handler. |
|
inline |
Unsubscribes from ADC events and deregisters event handler.
adc | ADC device for which events should be disabled. |
|
static |
Initializes ADC to work in the IRQ mode.
|
static |
Enables IRQ mode for given channels.
|
static |
Performs IRQ configuration for single-mode async conversion.
|
static |
Initializes ADC to work in the DMA mode.
|
static |
Enables DMA mode for given channels.
|
static |
Performs DMA configuration for single-mode async conversion.
|
static |
Initializes given ADC.
|
static |
Configures ADC to work with given channels, in IRQ mode.
[in,out] | out_samples | Samples array that will be populated with target samples. Should not be destroyed until conversion of given channels will complete. |
Performs single conversion of the previously configured channels and waits till the end of the conversion.
Results will be saved to a buffer previously passed with enable_channels(). If external trigger is selected then conversion will start after trigger will hit. Otherwise, conversion will be immediately triggered by software.
ecl::err::ok | Channels are converted and data is stored in the buffer. |
Performs single conversion of the previously configured channels asynchronously.
After end of conversion event handler will be called. In case of successfull conversion results will be saved to a buffer previously passed with enable_channels(). If external trigger is selected then conversion will start after trigger will hit. Otherwise, conversion will be immediately triggered by software.
ecl::err::ok | Channels conversion is pending. |