stm32f3: adc: Add support for sequence completion flags
The f3 adc has separate bits for end of conversion and end of sequence. Support those fully, with the regular enable/disable irq methods, and the flag checking methods. Discovered in github bug: #493
This commit is contained in:
@@ -366,6 +366,31 @@ void adc_disable_eoc_interrupt_injected(uint32_t adc)
|
||||
ADC_IER(adc) &= ~ADC_IER_JEOCIE;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/** @brief ADC Enable Injected End-Of-Sequence Interrupt
|
||||
*
|
||||
* @param[in] adc Unsigned int32. ADC block register address base @ref
|
||||
* adc_reg_base
|
||||
*/
|
||||
|
||||
void adc_enable_eos_interrupt_injected(uint32_t adc)
|
||||
{
|
||||
ADC_IER(adc) |= ADC_IER_JEOSIE;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/** @brief ADC Disable Injected End-Of-Sequence Interrupt
|
||||
*
|
||||
* @param[in] adc Unsigned int32. ADC block register address base @ref
|
||||
* adc_reg_base
|
||||
*/
|
||||
|
||||
void adc_disable_eos_interrupt_injected(uint32_t adc)
|
||||
{
|
||||
ADC_IER(adc) &= ~ADC_IER_JEOSIE;
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/** @brief ADC Enable Analog Watchdog Interrupt
|
||||
*
|
||||
@@ -418,6 +443,31 @@ void adc_disable_eoc_interrupt(uint32_t adc)
|
||||
ADC_IER(adc) &= ~ADC_IER_EOCIE;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/** @brief ADC Enable Regular End-Of-Sequence Interrupt
|
||||
*
|
||||
* @param[in] adc Unsigned int32. ADC block register address base @ref
|
||||
* adc_reg_base
|
||||
*/
|
||||
|
||||
void adc_enable_eos_interrupt(uint32_t adc)
|
||||
{
|
||||
ADC_IER(adc) |= ADC_IER_EOSIE;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/** @brief ADC Disable Regular End-Of-Sequence Interrupt
|
||||
*
|
||||
* @param[in] adc Unsigned int32. ADC block register address base @ref
|
||||
* adc_reg_base
|
||||
*/
|
||||
|
||||
void adc_disable_eos_interrupt(uint32_t adc)
|
||||
{
|
||||
ADC_IER(adc) &= ~ADC_IER_EOSIE;
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/** @brief ADC Software Triggered Conversion on Regular Channels
|
||||
*
|
||||
@@ -743,6 +793,37 @@ bool adc_eoc_injected(uint32_t adc)
|
||||
return ADC_ISR(adc) & ADC_ISR_JEOC;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/** @brief ADC Read the End-of-Sequence Flag for Regular Conversions
|
||||
*
|
||||
* This flag is set after all channels of an regular group have been
|
||||
* converted.
|
||||
*
|
||||
* @param[in] adc Unsigned int32. ADC block register address base
|
||||
* @ref adc_reg_base
|
||||
* @returns bool. End of conversion flag.
|
||||
*/
|
||||
bool adc_eos(uint32_t adc)
|
||||
{
|
||||
return ADC_ISR(adc) & ADC_ISR_EOS;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/** @brief ADC Read the End-of-Sequence Flag for Injected Conversions
|
||||
*
|
||||
* This flag is set after all channels of an injected group have been
|
||||
* converted.
|
||||
*
|
||||
* @param[in] adc Unsigned int32. ADC block register address base
|
||||
* @ref adc_reg_base
|
||||
* @returns bool. End of conversion flag.
|
||||
*/
|
||||
bool adc_eos_injected(uint32_t adc)
|
||||
{
|
||||
return ADC_ISR(adc) & ADC_ISR_JEOS;
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/** @brief ADC Read from the Regular Conversion Result Register
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user