Allows Asynchronous reading from the analog pins to memory. Supports: K64F

Dependents:   MoppyController

Files at this revision

API Documentation at this revision

Comitter:
Condo2k4
Date:
Wed May 24 11:57:48 2017 +0000
Parent:
1:57441202d8d0
Commit message:
Fixes

Changed in this revision

asyncADC.cpp Show annotated file Show diff for this revision Revisions of this file
asyncADC.h Show annotated file Show diff for this revision Revisions of this file
diff -r 57441202d8d0 -r 754768be9b9a asyncADC.cpp
--- a/asyncADC.cpp	Wed May 03 12:48:31 2017 +0000
+++ b/asyncADC.cpp	Wed May 24 11:57:48 2017 +0000
@@ -21,8 +21,7 @@
     return i>=0 ? i : -i;
 }
 
-bool isPowerOfTwo(unsigned int x)
-{
+bool isPowerOfTwo(unsigned int x) {
     return (x != 0) && ((x & (x - 1)) == 0);
 }
 
@@ -185,7 +184,6 @@
     ADC16_EnableDMA(adc, true);
     
     adc16_channel_config_t channelConfig;
-    
     channelConfig.channelNumber = channel;
     channelConfig.enableInterruptOnConversionCompleted = false;
     channelConfig.enableDifferentialConversion = false;
diff -r 57441202d8d0 -r 754768be9b9a asyncADC.h
--- a/asyncADC.h	Wed May 03 12:48:31 2017 +0000
+++ b/asyncADC.h	Wed May 24 11:57:48 2017 +0000
@@ -29,7 +29,7 @@
 /*!
  * @brief Computes the nearest achievable frequency to the target frequency.
  * 
- * The integer sampling frequency is recommended for values over 10MHz.
+ * The integer sampling frequency is recommended for values over 10kHz.
  * 
  * @param targetFrequency The target frequency to achieve
  */
@@ -43,7 +43,7 @@
  * The read will fill the destination buffer and then terminate. A call to
  * terminateAsyncRead() can terminate the process early.
  * 
- * The integer sampling frequency is recommended for values over 10MHz.
+ * The integer sampling frequency is recommended for values over 10kHz.
  * 
  * @param source The source pin to read from. Must be Analog compatiable
  * @param destination A pointer to the destination array. Must be positive.
@@ -65,12 +65,12 @@
  * the destination buffer and repeat continuously until explicitly terminated by
  * a call to terminateAsyncRead().
  * 
- * The integer sampling frequency is recommended for values over 10MHz.
+ * The integer sampling frequency is recommended for values over 10kHz.
  * 
  * @brief Initiates an asynchronus analog read from 'source' to 'destination'
  * using the PDB to drive the Analog conversion and DMA to transfer the result
  * to the destination buffer. The integer sampling frequency is recommended for
- * values over 10MHz.
+ * values over 10kHz.
  * @param source The source pin to read from. Must be Analog compatiable
  * @param destination A pointer to the destination array.
  * @param destination A pointer to the destination array. Must be a positive