From b2bdfe437762a9a88b4de1cada7f794b255b0d97 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Mon, 15 Mar 2010 05:38:29 +0000 Subject: Improve documentation for the ADC and TWI drivers. --- LUFA/Drivers/Peripheral/AVRU4U6U7/ADC.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'LUFA/Drivers/Peripheral/AVRU4U6U7') 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; -- cgit v1.2.3