Class similar to AnalogIn that uses burst mode to run continious background conversions so when the input is read, the last value can immediatly be returned. This slightly modified version allows NC pins.
Dependents: Pinscape_Controller
Fork of FastAnalogIn by
Diff: FastAnalogIn_LPC11UXX.cpp
- Revision:
- 10:afc3b84dbbd6
- Parent:
- 8:68082fdde730
diff -r 31184aa1449c -r afc3b84dbbd6 FastAnalogIn_LPC11UXX.cpp --- a/FastAnalogIn_LPC11UXX.cpp Sat Jul 12 10:39:37 2014 +0000 +++ b/FastAnalogIn_LPC11UXX.cpp Tue Nov 04 17:53:25 2014 +0000 @@ -45,7 +45,7 @@ uint32_t clkdiv = div_round_up(SystemCoreClock, MAX_ADC_CLK) - 1; - LPC_ADC->CR = (0 << 0) // no channels selected + LPC_ADC->CR = (LPC_ADC->CR & 0xFF) // keep current channels | (clkdiv << 8) // max of 4.5MHz | (1 << 16) // BURST = 1, hardware controlled | ( 0 << 17 ); // CLKS = 0, we stick to 10 bit mode