stm32: adc-v2: pull up single/continuous modes

This commit is contained in:
Karl Palsson
2015-10-17 01:48:07 +00:00
parent a89cd86454
commit 7231b9a691
6 changed files with 26 additions and 63 deletions

View File

@@ -113,3 +113,27 @@ void adc_power_off(uint32_t adc)
while (!adc_is_power_off(adc));
}
/**
* Enable Continuous Conversion Mode
* In this mode the ADC starts a new conversion of a single channel or a channel
* group immediately following completion of the previous channel group
* conversion.
*
* @param[in] adc ADC block register address base @ref adc_reg_base
*/
void adc_set_continuous_conversion_mode(uint32_t adc)
{
ADC_CFGR1(adc) |= ADC_CFGR1_CONT;
}
/**
* Enable Single Conversion Mode
* In this mode the ADC performs a conversion of one channel or a channel group
* and stops.
*
* @param[in] adc ADC block register address base @ref adc_reg_base
*/
void adc_set_single_conversion_mode(uint32_t adc)
{
ADC_CFGR1(adc) &= ~ADC_CFGR1_CONT;
}

View File

@@ -44,35 +44,6 @@
*
*@{*/
/*---------------------------------------------------------------------------*/
/** @brief ADC Enable Continuous Conversion Mode
*
* In this mode the ADC starts a new conversion of a single channel or a channel
* group immediately following completion of the previous channel group
* conversion.
*
* @param[in] adc Unsigned int32. ADC base address (@ref adc_reg_base)
*/
void adc_set_continuous_conversion_mode(uint32_t adc)
{
ADC_CFGR1(adc) |= ADC_CFGR1_CONT;
}
/*---------------------------------------------------------------------------*/
/** @brief ADC Enable Single Conversion Mode
*
* In this mode the ADC performs a conversion of one channel or a channel group
* and stops.
*
* @param[in] adc Unsigned int32. ADC base address (@ref adc_reg_base)
*/
void adc_set_single_conversion_mode(uint32_t adc)
{
ADC_CFGR1(adc) &= ~ADC_CFGR1_CONT;
}
/*---------------------------------------------------------------------------*/
/** @brief ADC Enable Discontinuous Mode for Regular Conversions
*

View File

@@ -540,36 +540,6 @@ void adc_disable_dma(uint32_t adc)
ADC_CFGR1(adc) &= ~ADC_CFGR1_DMAEN;
}
/*---------------------------------------------------------------------------*/
/** @brief ADC Enable Continuous Conversion Mode
*
* In this mode the ADC starts a new conversion of a single channel or a channel
* group immediately following completion of the previous channel group
* conversion.
*
* @param[in] adc Unsigned int32. ADC block register address base
* @ref adc_reg_base
*/
void adc_set_continuous_conversion_mode(uint32_t adc)
{
ADC_CFGR(adc) |= ADC_CFGR_CONT;
}
/*---------------------------------------------------------------------------*/
/** @brief ADC Enable Single Conversion Mode
*
* In this mode the ADC performs a conversion of one channel or a channel group
* and stops.
*
* @param[in] adc Unsigned int32. ADC block register address base
* @ref adc_reg_base
*/
void adc_set_single_conversion_mode(uint32_t adc)
{
ADC_CFGR(adc) &= ~ADC_CFGR_CONT;
}
/*---------------------------------------------------------------------------*/
/** @brief ADC Set the Sample Time for a Single Channel