2011-11-17 01:13 AM
Hi all,
I'm using StdPeriph lib and saw there is such code instm32f10x_adc.c:
#define CR2_EXTTRIG_SWSTART_Set ((uint32_t)0x00500000)
and /*** @brief Enables or disables the selected ADC software start conversion .* @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.* @param NewState: new state of the selected ADC software start conversion.* This parameter can be: ENABLE or DISABLE.* @retval None*/void ADC_SoftwareStartConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState){/* Check the parameters */assert_param(IS_ADC_ALL_PERIPH(ADCx));assert_param(IS_FUNCTIONAL_STATE(NewState));if (NewState != DISABLE){/* Enable the selected ADC conversion on external event and start the selectedADC conversion */ADCx->CR2 |= CR2_EXTTRIG_SWSTART_Set;}else{/* Disable the selected ADC conversion on external event and stop the selectedADC conversion */ADCx->CR2 &= CR2_EXTTRIG_SWSTART_Reset;}}IIRC, set the bit 20 will enable the external trigger. So, why enable the external trigger when ADC_SoftwareStart ?Thanks in advance.