Vícekanálově čtení ADC

Ještě pro doplnění, ADC1 konfigurace:

[code]void ADC1_Configuration(void)
{
ADC_InitTypeDef ADC_InitStructure;

/* ADC1 DeInit */
ADC_DeInit(ADC1);

/* ADC1 Periph clock enable */
RCC->APB2ENR |= (1<<9);

/* Initialize ADC structure */
ADC_StructInit(&ADC_InitStructure);

/* Configure the ADC1 in continous mode withe a resolutuion equal to 12 bits */
ADC_InitStructure.ADC_Resolution = ADC_Resolution_12b;
ADC_InitStructure.ADC_ContinuousConvMode = ENABLE;
ADC_InitStructure.ADC_ExternalTrigConvEdge = ADC_ExternalTrigConvEdge_None;
ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;
ADC_InitStructure.ADC_ScanDirection = ADC_ScanDirection_Upward;
ADC_Init(ADC1, &ADC_InitStructure);

/* ADC Calibration */
ADC_GetCalibrationFactor(ADC1);

/* Enable ADC1 */
ADC_Cmd(ADC1, ENABLE);

/* Wait the ADCEN falg */
while(!ADC_GetFlagStatus(ADC1, ADC_FLAG_ADEN));

/* ADC1 regular Software Start Conv */
ADC_StartOfConversion(ADC1);
}[/code]