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.

Fork of FastAnalogIn by Erik -

Obsolete!

Has been already merged with Erik's original repository => take the original!

  • Added support for LPC4088.
  • Fixed linker error (missing definition of static member "channel_usage")
Revision:
3:a9b753c25073
Parent:
2:9b61d0792927
Child:
4:cd84739f7640
diff -r 9b61d0792927 -r a9b753c25073 FastAnalogIn.h
--- a/FastAnalogIn.h	Sat Mar 08 15:44:57 2014 +0000
+++ b/FastAnalogIn.h	Sat Mar 08 16:01:36 2014 +0000
@@ -16,17 +16,20 @@
  * AnalogIn does a single conversion when you read a value (actually several conversions and it takes the median of that).
  * This library runns the ADC conversion automatically in the background.
  * When read is called, it immediatly returns the last sampled value.
- * Using more ADC pins in continuous mode will decrease the conversion rate.
+ *
+ * LPC1768
+ * Using more ADC pins in continuous mode will decrease the conversion rate (LPC1768).
  * If you need to sample one pin very fast and sometimes also need to do AD conversions on another pin,
  * you can disable the continuous conversion on that ADC channel and still read its value.
- * When continuous conversion is disabled, a read will block until the conversion is complete (much like the regular AnalogIn library does).
+ *
+ * KLXX
+ * Multiple Fast instances can be declared of which only ONE can be continuous (all others must be non-continuous).
+ *
+ * When continuous conversion is disabled, a read will block until the conversion is complete
+ * (much like the regular AnalogIn library does).
  * Each ADC channel can be enabled/disabled separately.
  *
- * IMPORTANT NOTES
- * ---------------
- * - When used with KLxx processors, this library can coexist with the regular AnalogIn library.
- * - When used with the LPC1768 processor, it does not play nicely with regular AnalogIn objects,
- *   so either use this library or AnalogIn, not both at the same time!!
+ * IMPORTANT : It does not play nicely with regular AnalogIn objects, so either use this library or AnalogIn, not both at the same time!!
  *
  * Example for the KLxx processors:
  * @code
@@ -34,8 +37,8 @@
  *
  * #include "mbed.h"
  *
- * FastAnalogIn temperature(PTC2); //Fast sampling on PTC2
- * AnalogIn speed(PTB3);           //Normal sampling on PTB3
+ * FastAnalogIn temperature(PTC2); //Fast continuous sampling on PTC2
+ * FastAnalogIn speed(PTB3, 0);    //Fast non-continuous sampling on PTB3
  *
  * int main() {
  *     while(1) {
@@ -51,7 +54,7 @@
  *
  * #include "mbed.h"
  *
- * AnalogIn temperature(p20);
+ * FastAnalogIn temperature(p20);
  *
  * int main() {
  *     while(1) {