stm32: Fix typo in adc startup delay
Fix (harmless) typo and add comments on adc timing. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
8d93d1a8ef
commit
fc476f22b6
|
@ -34,6 +34,11 @@ static const uint8_t adc_pins[] = {
|
|||
#define CR2_FLAGS ADC_CR2_ADON
|
||||
#endif
|
||||
|
||||
// ADC timing:
|
||||
// stm32f103: ADC clock=9Mhz, Tconv=12.5, Tsamp=28.5, total=4.556us
|
||||
// stm32f407: ADC clock=21Mhz, Tconv=12, Tsamp=56, total=3.238us
|
||||
// stm32f446: ADC clock=22.5Mhz, Tconv=12, Tsamp=56, total=3.022us
|
||||
|
||||
struct gpio_adc
|
||||
gpio_adc_setup(uint32_t pin)
|
||||
{
|
||||
|
@ -72,7 +77,7 @@ gpio_adc_setup(uint32_t pin)
|
|||
|
||||
#if CONFIG_MACH_STM32F1
|
||||
// Perform calibration
|
||||
udelay(timer_from_us(1));
|
||||
udelay(10);
|
||||
adc->CR2 = ADC_CR2_CAL | CR2_FLAGS;
|
||||
while (adc->CR2 & ADC_CR2_CAL)
|
||||
;
|
||||
|
|
Loading…
Reference in New Issue