Commit 4134a69a authored by Clément Foucher's avatar Clément Foucher
Browse files

Add ADC discontinuous mode interface to HwConfig.

parent 52cf5ace
......@@ -247,6 +247,11 @@ void HardwareConfiguration::configureAdcTriggerSource(uint8_t adc_number, adc_ev
configure_adc_trigger_source(adc_number, trigger_source);
}
void HardwareConfiguration::configureAdcDiscontinuousMode(uint8_t adc_number, uint32_t dicontinuous_count)
{
configure_adc_discontinuous_mode(adc_number, dicontinuous_count);
}
void HardwareConfiguration::configureAdcDefaultAllMeasurements()
{
configure_adc_default_all_measurements();
......
......@@ -106,6 +106,7 @@ public:
static void configureAdc12DualMode(uint8_t dual_mode);
static int8_t configureAdcChannels(uint8_t adc_number, const char* channel_list[], uint8_t channel_count);
static void configureAdcTriggerSource(uint8_t adc_number, adc_ev_src_t trigger_source);
static void configureAdcDiscontinuousMode(uint8_t adc_number, uint32_t dicontinuous_count);
static void configureAdcDefaultAllMeasurements();
};
......
......@@ -108,6 +108,22 @@ void configure_adc_trigger_source(uint8_t adc_number, adc_ev_src_t trigger_sourc
adc_configure_trigger_source(adc_number, trigger_source);
}
void configure_adc_discontinuous_mode(uint8_t adc_number, uint32_t dicontinuous_count)
{
/////
// Make sure module is initialized
if (initialized == 0)
{
_initialize();
}
/////
// Proceed
adc_configure_discontinuous_mode(adc_number, dicontinuous_count);
}
void configure_adc_default_all_measurements()
{
uint8_t number_of_channels_adc1 = 3;
......
......@@ -82,6 +82,16 @@ int8_t configure_adc_channels(uint8_t adc_number, const char* channel_list[], ui
*/
void configure_adc_trigger_source(uint8_t adc_number, adc_ev_src_t trigger_source);
/**
* Registers the discontinuous count for an ADC.
* It will be applied when ADC is started.
*
* @param adc_number Number of the ADC to configure.
* @param dicontinuous_count Number of channels to acquire on each
* trigger event. 0 to disable discontinuous mode (default).
*/
void configure_adc_discontinuous_mode(uint8_t adc_number, uint32_t dicontinuous_count);
/**
* This function is used to configure all ADC channels in default configuration.
* Channels will be attributed as follows:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment