mirror of https://github.com/ARMmbed/mbed-os.git
[NUCLEO_L152RE] Enable HSI clock for ADC
parent
4e3b149f79
commit
35660622d9
|
@ -81,6 +81,11 @@ void analogin_init(analogin_t *obj, PinName pin) {
|
|||
// 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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue