* This file contains macros which are common to all library elements, and which may be useful in user code. It\r
* also includes other common headers, such as Atomic.h, FunctionAttributes.h and BoardTypes.h.\r
*/\r
+ \r
+/** @defgroup Group_Common Common Utility Headers - LUFA/Drivers/Common/Common.h\r
+ *\r
+ * Common utility headers containing macros, functions, enums and types which are common to all\r
+ * aspects of the library.\r
+ *\r
+ * @{\r
+ */\r
+\r
+/** @defgroup Group_Debugging Debugging Macros\r
+ *\r
+ * Macros for debugging use.\r
+ */\r
+ \r
+/** @defgroup Group_BitManip Endian and Bit Macros\r
+ *\r
+ * Functions for swapping endianness and reversing bit orders.\r
+ */\r
\r
#ifndef __COMMON_H__\r
#define __COMMON_H__\r
/** Defines a volatile NOP statement which cannot be optimized out by the compiler, and thus can always\r
* be set as a breakpoint in the resulting code. Useful for debugging purposes, where the optimizer\r
* removes/reorders code to the point where break points cannot reliably be set.\r
+ *\r
+ * \ingroup Group_Debugging\r
*/\r
#define JTAG_DEBUG_POINT() asm volatile ("NOP" ::)\r
\r
/** Defines an explicit JTAG break point in the resulting binary via the ASM BREAK statement. When\r
- * a JTAG is used, this causes the program execution to halt when reached until manually resumed. */\r
+ * a JTAG is used, this causes the program execution to halt when reached until manually resumed.\r
+ *\r
+ * \ingroup Group_Debugging\r
+ */\r
#define JTAG_DEBUG_BREAK() asm volatile ("BREAK" ::)\r
\r
- /** Macro for testing condition "x" and breaking via JTAG_DEBUG_BREAK() if the condition is false. */\r
+ /** Macro for testing condition "x" and breaking via JTAG_DEBUG_BREAK() if the condition is false.\r
+ *\r
+ * \ingroup Group_Debugging\r
+ */\r
#define JTAG_DEBUG_ASSERT(x) MACROS{ if (!(x)) { JTAG_DEBUG_BREAK(); } }MACROE\r
\r
/** Macro for testing condition "x" and writing debug data to the serial stream if false. As a\r
*\r
* The serial output takes the form "{FILENAME}: Function {FUNCTION NAME}, Line {LINE NUMBER}: Assertion\r
* {x} failed."\r
+ *\r
+ * \ingroup Group_Debugging\r
*/\r
#define SERIAL_STREAM_ASSERT(x) MACROS{ if (!(x)) { printf_P(PSTR("%s: Function \"%s\", Line %d: " \\r
"Assertion \"%s\" failed.\r\n"), \\r
/** Function to reverse the individual bits in a byte - i.e. bit 7 is moved to bit 0, bit 6 to bit 1,\r
* etc.\r
*\r
+ * \ingroup Group_BitManip\r
+ *\r
* \param Byte Byte of data whose bits are to be reversed\r
*/\r
static inline uint8_t BitReverse(uint8_t Byte) ATTR_WARN_UNUSED_RESULT ATTR_CONST;\r
\r
/** Function to reverse the byte ordering of the individual bytes in a 16 bit number.\r
*\r
+ * \ingroup Group_BitManip\r
+ *\r
* \param Word Word of data whose bytes are to be swapped\r
*/\r
static inline uint16_t SwapEndian_16(uint16_t Word) ATTR_WARN_UNUSED_RESULT ATTR_CONST;\r
\r
/** Function to reverse the byte ordering of the individual bytes in a 32 bit number.\r
*\r
+ * \ingroup Group_BitManip\r
+ *\r
* \param DWord Double word of data whose bytes are to be swapped\r
*/\r
static inline uint32_t SwapEndian_32(uint32_t DWord) ATTR_WARN_UNUSED_RESULT ATTR_CONST;\r
\r
/** Function to reverse the byte ordering of the individual bytes in a n byte number.\r
*\r
+ * \ingroup Group_BitManip\r
+ *\r
* \param Data Pointer to a number containing an even number of bytes to be reversed\r
* \param Bytes Length of the data in bytes\r
*/\r
}\r
\r
#endif\r
+\r
+/** @} */\r