This fork of the MBED Library allows you to use counters on the external counter pins (15/16 for Timer 3, 29/30 for Timer 2) by switching internal timing functions in MBED to utilize Timer 0
Fork of mbed-src by
Revision 309:8f72041da6ba, committed 2014-09-05
- Comitter:
- mbed_official
- Date:
- Fri Sep 05 15:45:07 2014 +0100
- Parent:
- 308:29bf8b44dbf6
- Child:
- 310:1c287fe42d43
- Commit message:
- Synchronized with git revision 3a31537cfb1d117edbf4a79eb60d1db5f453d24f
Full URL: https://github.com/mbedmicro/mbed/commit/3a31537cfb1d117edbf4a79eb60d1db5f453d24f/
[NUCLEO_L152RE] Enable HSI clock for ADC
Changed in this revision
targets/hal/TARGET_STM/TARGET_NUCLEO_L152RE/analogin_api.c | Show annotated file Show diff for this revision Revisions of this file |
--- a/targets/hal/TARGET_STM/TARGET_NUCLEO_L152RE/analogin_api.c Fri Sep 05 15:30:07 2014 +0100 +++ b/targets/hal/TARGET_STM/TARGET_NUCLEO_L152RE/analogin_api.c Fri Sep 05 15:45:07 2014 +0100 @@ -81,6 +81,11 @@ // Get ADC registers structure address adc = (ADC_TypeDef *)(obj->adc); + // Enable the HSI + RCC_HSICmd(ENABLE); + // Wait until HSI oscillator is ready + while(RCC_GetFlagStatus(RCC_FLAG_HSIRDY) == RESET) {} + // Enable ADC clock RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1, ENABLE);