aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/Peripheral/AT90USBXXX67
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-04-19 11:43:21 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-04-19 11:43:21 +0000
commit663f449c10b9a77a429aaa81066ce2b43ca6dc39 (patch)
tree3a6f06560fa24589836aaf9d2aa8747383913aae /LUFA/Drivers/Peripheral/AT90USBXXX67
parent32e735b2b2eefb74e0415a5826692f7ba8c0a984 (diff)
downloadlufa-663f449c10b9a77a429aaa81066ce2b43ca6dc39.tar.gz
lufa-663f449c10b9a77a429aaa81066ce2b43ca6dc39.tar.bz2
lufa-663f449c10b9a77a429aaa81066ce2b43ca6dc39.zip
Fixed incorrect HID interface class and subclass values in the Mouse and KeyboardMouse demos (thanks to Brian Dickman).
Capitolised the "Descriptor_Search" and "Descriptor_Search_Comp" prefixes of the values in the DSearch_Return_ErrorCodes_t and DSearch_Comp_Return_ErrorCodes_t enums. Minor documentation improvements.
Diffstat (limited to 'LUFA/Drivers/Peripheral/AT90USBXXX67')
-rw-r--r--LUFA/Drivers/Peripheral/AT90USBXXX67/ADC.h72
1 files changed, 46 insertions, 26 deletions
diff --git a/LUFA/Drivers/Peripheral/AT90USBXXX67/ADC.h b/LUFA/Drivers/Peripheral/AT90USBXXX67/ADC.h
index a5bf03734..494c1e478 100644
--- a/LUFA/Drivers/Peripheral/AT90USBXXX67/ADC.h
+++ b/LUFA/Drivers/Peripheral/AT90USBXXX67/ADC.h
@@ -62,32 +62,7 @@
#endif
/* Public Interface - May be used in end-application: */
- /* Macros: */
- /** Initializes the ADC, ready for conversions. This must be called before any other ADC operations.
- * The "mode" parameter should be a mask comprised of a conversion mode (free running or single) and
- * prescaler masks.
- */
- #define ADC_Init(mode) MACROS{ ADCSRA = ((1 << ADEN) | mode); }MACROE
-
- /** Turns off the ADC. If this is called, any further ADC operations will require a call to the
- * ADC_Init() macro before the ADC can be used again.
- */
- #define ADC_Off() MACROS{ ADCSRA = 0; }MACROE
-
- /** Indicates if the ADC is enabled. This macro will return boolean true if the ADC subsystem is
- * currently enabled, or false otherwise.
- */
- #define ADC_GetStatus() ((ADCSRA & (1 << ADEN)) ? true : false)
-
- /** Indicates if the current ADC conversion is completed, or still in progress. This returns boolean
- * false if the reading is still taking place, or true if the conversion is complete and ready to be
- * read out with ADC_GetResult().
- */
- #define ADC_IsReadingComplete() (!(ADCSRA & (1 << ADSC)))
-
- /** Returns the result of the last conversion, as a 16-bit wide integer. */
- #define ADC_GetResult() ADC
-
+ /* Macros: */
/** Reference mask, for using the voltage present at the AVR's AREF pin for the ADC reference. */
#define ADC_REFERENCE_AREF 0
@@ -134,6 +109,51 @@
/** Sets the ADC input clock to prescale by a factor of 128 the AVR's system clock. */
#define ADC_PRESCALE_128 ((1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0))
+ /* Pseudo-Function Macros: */
+ #if defined(__DOXYGEN__)
+ /** Initializes the ADC, ready for conversions. This must be called before any other ADC operations.
+ * The "mode" parameter should be a mask comprised of a conversion mode (free running or single) and
+ * prescaler masks.
+ *
+ * \param Mode Mask of ADC settings, including adjustment, prescale, mode and reference
+ */
+ static inline void ADC_Init(uint8_t Mode);
+
+ /** Turns off the ADC. If this is called, any further ADC operations will require a call to
+ * ADC_Init() before the ADC can be used again.
+ */
+ static inline void ADC_Off(void);
+
+ /** Indicates if the ADC is currently enabled.
+ *
+ * \return Boolean true if the ADC subsystem is currently enabled, false otherwise.
+ */
+ static inline bool ADC_GetStatus(void);
+
+ /** Indicates if the current ADC conversion is completed, or still in progress.
+ *
+ * \return Boolean false if the reading is still taking place, or true if the conversion is
+ * complete and ready to be read out with ADC_GetResult()
+ */
+ static inline bool ADC_IsReadingComplete(void);
+
+ /** Retrieves the conversion value of the last completed ADC conversion.
+ *
+ * \return The result of the last ADC conversion
+ */
+ static inline uint16_t ADC_GetResult(void);
+ #else
+ #define ADC_Init(mode) MACROS{ ADCSRA = ((1 << ADEN) | mode); }MACROE
+
+ #define ADC_Off() MACROS{ ADCSRA = 0; }MACROE
+
+ #define ADC_GetStatus() ((ADCSRA & (1 << ADEN)) ? true : false)
+
+ #define ADC_IsReadingComplete() (!(ADCSRA & (1 << ADSC)))
+
+ #define ADC_GetResult() ADC
+ #endif
+
/* Inline Functions: */
/** Configures the given ADC channel, ready for ADC conversions. This function sets the
* associated port pin as an input and disables the digital portion of the I/O to reduce