Skip to content

Commit

Permalink
stm32/f4/adc: DMA can always be used with ADC2
Browse files Browse the repository at this point in the history
I can't find any evidence in the manual to support this comment's claim.
  • Loading branch information
bgamari committed Nov 15, 2012
1 parent a43f1d0 commit 08a14a9
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions lib/stm32/f4/adc.c
Expand Up @@ -435,17 +435,12 @@ void adc_set_right_aligned(u32 adc)
/*-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------*/
/** @brief ADC Enable DMA Transfers /** @brief ADC Enable DMA Transfers
Only available for ADC1 through DMA1 channel1, and ADC3 through DMA2 channel5.
ADC2 will use DMA if it is set as slave in dual mode with ADC1 in DMA transfer
mode.
@param[in] adc Unsigned int32. ADC block register address base @ref adc_reg_base @param[in] adc Unsigned int32. ADC block register address base @ref adc_reg_base
*/ */


void adc_enable_dma(u32 adc) void adc_enable_dma(u32 adc)
{ {
if ((adc == ADC1) | (adc == ADC3)) ADC_CR2(adc) |= ADC_CR2_DMA;
ADC_CR2(adc) |= ADC_CR2_DMA;
} }


/*-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------*/
Expand All @@ -456,8 +451,7 @@ void adc_enable_dma(u32 adc)


void adc_disable_dma(u32 adc) void adc_disable_dma(u32 adc)
{ {
if ((adc == ADC1) | (adc == ADC3)) ADC_CR2(adc) &= ~ADC_CR2_DMA;
ADC_CR2(adc) &= ~ADC_CR2_DMA;
} }


/*-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------*/
Expand Down

0 comments on commit 08a14a9

Please sign in to comment.