Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-dev by
Diff: targets/hal/TARGET_NXP/TARGET_LPC15XX/analogin_api.c
- Revision:
- 73:5d67568caa8f
- Parent:
- 0:9b334a45a8ff
- Child:
- 144:ef7eb2e8f9f7
--- a/targets/hal/TARGET_NXP/TARGET_LPC15XX/analogin_api.c Thu Feb 25 10:15:11 2016 +0000 +++ b/targets/hal/TARGET_NXP/TARGET_LPC15XX/analogin_api.c Fri Feb 26 07:45:09 2016 +0000 @@ -77,10 +77,6 @@ LPC_SYSCON->SYSAHBCLKCTRL0 |= (1 << 28); } - // select IRC as asynchronous clock, divided by 1 - LPC_SYSCON->ADCASYNCCLKSEL = 0; - LPC_SYSCON->ADCASYNCCLKDIV = 1; - __IO LPC_ADC0_Type *adc_reg = (obj->adc < ADC1_0) ? (__IO LPC_ADC0_Type*)(LPC_ADC0) : (__IO LPC_ADC0_Type*)(LPC_ADC1); // determine the system clock divider for a 500kHz ADC clock during calibration @@ -90,8 +86,8 @@ adc_reg->CTRL = (1UL << 30) | (clkdiv & 0xFF); while ((adc_reg->CTRL & (1UL << 30)) != 0); - // switch to asynchronous mode - adc_reg->CTRL = (1UL << 8); + // Sampling clock: SystemClock divided by 1 + adc_reg->CTRL = 0; } static inline uint32_t adc_read(analogin_t *obj) {