FastAnalogIn
Fork of FastAnalogIn by
Revision 3:a9b753c25073, committed 2014-03-08
- Comitter:
- frankvnk
- Date:
- Sat Mar 08 16:01:36 2014 +0000
- Parent:
- 2:9b61d0792927
- Child:
- 4:cd84739f7640
- Commit message:
- Doxygen correction and removed obsolete code
Changed in this revision
FastAnalogIn.h | Show annotated file Show diff for this revision Revisions of this file |
FastAnalogIn_KLXX.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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) {
--- a/FastAnalogIn_KLXX.cpp Sat Mar 08 15:44:57 2014 +0000 +++ b/FastAnalogIn_KLXX.cpp Sat Mar 08 16:01:36 2014 +0000 @@ -6,14 +6,6 @@ #define MAX_FADC 6000000 #define CHANNELS_A_SHIFT 5 -/*typedef struct analogin_s fanalogin_t; - -void fanalogin_init (fanalogin_t *obj, PinName pin); -float fanalogin_read (fanalogin_t *obj); -uint16_t fanalogin_read_u16(fanalogin_t *obj); - -fanalogin_t _adc;*/ - FastAnalogIn::FastAnalogIn(PinName pin, bool enabled) { ADCnumber = (ADCName)pinmap_peripheral(pin, PinMap_ADC);