diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2010-03-15 05:38:29 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2010-03-15 05:38:29 +0000 |
commit | b2bdfe437762a9a88b4de1cada7f794b255b0d97 (patch) | |
tree | 2cd59535488dacfc88fb608ca0ea72c89b52c732 /LUFA/Drivers/Peripheral/AVRU4U6U7 | |
parent | 4f9dd142e7691a88adae271433ff6850b55cbfbe (diff) | |
download | lufa-b2bdfe437762a9a88b4de1cada7f794b255b0d97.tar.gz lufa-b2bdfe437762a9a88b4de1cada7f794b255b0d97.tar.bz2 lufa-b2bdfe437762a9a88b4de1cada7f794b255b0d97.zip |
Improve documentation for the ADC and TWI drivers.
Diffstat (limited to 'LUFA/Drivers/Peripheral/AVRU4U6U7')
-rw-r--r-- | LUFA/Drivers/Peripheral/AVRU4U6U7/ADC.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/LUFA/Drivers/Peripheral/AVRU4U6U7/ADC.h b/LUFA/Drivers/Peripheral/AVRU4U6U7/ADC.h index 4b120aef6..9ab65af53 100644 --- a/LUFA/Drivers/Peripheral/AVRU4U6U7/ADC.h +++ b/LUFA/Drivers/Peripheral/AVRU4U6U7/ADC.h @@ -148,7 +148,7 @@ #define ADC_CHANNEL7 (0x07 << MUX0)
/** MUX mask define for the internal 1.1V bandgap channel of the ADC. See \ref ADC_StartReading and \ref ADC_GetChannelReading. */
- #define ADC_1100MV_BANDGAP 0x1E
+ #define ADC_1100MV_BANDGAP (0x1E << MUX0)
#if (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) || defined(__DOXYGEN__))
/** MUX mask define for the ADC8 channel of the ADC. See \ref ADC_StartReading and \ref ADC_GetChannelReading.
@@ -289,6 +289,10 @@ * Once executed, the conversion status can be determined via the \ref ADC_IsReadingComplete() macro and
* the result read via the \ref ADC_GetResult() macro.
*
+ * If the ADC has been initialized in free running mode, calling this function once will begin the repeated
+ * conversions. If the ADC is in single conversion mode (or the channel to convert from is to be changed),
+ * this function must be called each time a conversion is to take place.
+ *
* \param[in] MUXMask Mask comprising of an ADC channel mask, reference mask and adjustment mask
*/
static inline void ADC_StartReading(const uint16_t MUXMask)
@@ -308,6 +312,10 @@ /** Performs a complete single reading from channel, including a polling spin-loop to wait for the
* conversion to complete, and the returning of the converted value.
*
+ * \note For free running mode, the automated conversions should be initialized with a single call
+ * to \ref ADC_StartReading() to select the channel and begin the automated conversions, and
+ * the results read directly from the \ref ADC_GetResult() instead to reduce overhead.
+ *
* \param[in] MUXMask Mask comprising of an ADC channel mask, reference mask and adjustment mask
*/
static inline uint16_t ADC_GetChannelReading(const uint16_t MUXMask) ATTR_WARN_UNUSED_RESULT;
|