Document CDC Host class driver functions and enums.
[pub/USBasp.git] / LUFA / Drivers / Peripheral / AT90USBXXX67 / ADC.h
index 358629c..4110a50 100644 (file)
                                 *  The "mode" parameter should be a mask comprised of a conversion mode (free running or single) and\r
                                 *  prescaler masks.\r
                                 *\r
-                                *  \param Mode  Mask of ADC settings, including adjustment, prescale, mode and reference\r
+                                *  \param[in] Mode  Mask of ADC settings, including adjustment, prescale, mode and reference\r
                                 */\r
                                static inline void ADC_Init(uint8_t Mode);\r
                                \r
                         *  associated port pin as an input and disables the digital portion of the I/O to reduce\r
                         *  power consumption.\r
                         *\r
-                        *  \param Channel  ADC channel number to set up for conversions\r
+                        *  \param[in] Channel  ADC channel number to set up for conversions\r
                         */\r
                        static inline void ADC_SetupChannel(const uint8_t Channel)\r
                        {\r
+                               #if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || \\r
+                                        defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB647__) || \\r
+                                        defined(__AVR_ATmega32U6__))                           \r
                                DDRF  &= ~(1 << Channel);\r
                                DIDR0 |=  (1 << Channel);\r
+                               #elif (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__))\r
+                               if (Channel < 8)\r
+                               {\r
+                                       DDRF  &= ~(1 << Channel);\r
+                                       DIDR0 |=  (1 << Channel);\r
+                               }\r
+                               else if (Channel == 8)\r
+                               {\r
+                                       DDRD  &= ~(1 << 4);\r
+                                       DIDR2 |=  (1 << 0);\r
+                               }\r
+                               else if (Channel < 11)\r
+                               {\r
+                                       DDRD  &= ~(1 << (Channel - 3));\r
+                                       DIDR2 |=  (1 << (Channel - 8));\r
+                               }\r
+                               else\r
+                               {\r
+                                       DDRB  &= ~(1 << (Channel - 7));\r
+                                       DIDR2 |=  (1 << (Channel - 8));\r
+                               }\r
+                               #endif\r
                        }\r
                        \r
                        /** Starts the reading of the given channel, but does not wait until the conversion has completed.\r
                         *  Once executed, the conversion status can be determined via the \ref ADC_IsReadingComplete() macro and\r
                         *  the result read via the \ref ADC_GetResult() macro.\r
                         *\r
-                        *  \param MUXMask  Mask comprising of an ADC channel number, reference mask and adjustment mask\r
+                        *  \param[in] MUXMask  Mask comprising of an ADC channel number, reference mask and adjustment mask\r
                         */\r
                        static inline void ADC_StartReading(const uint8_t MUXMask)\r
                        {\r
                        /** Performs a complete single reading from channel, including a polling spinloop to wait for the\r
                         *  conversion to complete, and the returning of the converted value.\r
                         *\r
-                        *  \param MUXMask  Mask comprising of an ADC channel number, reference mask and adjustment mask\r
+                        *  \param[in] MUXMask  Mask comprising of an ADC channel number, reference mask and adjustment mask\r
                         */\r
                        static inline uint16_t ADC_GetChannelReading(const uint8_t MUXMask) ATTR_WARN_UNUSED_RESULT;\r
                        static inline uint16_t ADC_GetChannelReading(const uint8_t MUXMask)\r