aboutsummaryrefslogtreecommitdiff
path: root/LUFA/Drivers/Board/Buttons.h
diff options
context:
space:
mode:
authorDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2010-12-26 14:25:34 +0000
committerDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2010-12-26 14:25:34 +0000
commitbeda2c5f54a97c4e76c648120d2212705189a906 (patch)
tree680767a0fba855e26799e392a59d4b0b6d8be4df /LUFA/Drivers/Board/Buttons.h
parent0a7816059e8606337381c8d9c70f3f0bb68da52e (diff)
Added basic driver example use code to the library documentation.
Made the USARTStream global public and documented in the SerialStream module, allowing for the serial USART stream to be accessed via its handle rather than via the implicit stdout and stdin streams. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1615 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'LUFA/Drivers/Board/Buttons.h')
-rw-r--r--LUFA/Drivers/Board/Buttons.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/LUFA/Drivers/Board/Buttons.h b/LUFA/Drivers/Board/Buttons.h
index d06781db..e112683a 100644
--- a/LUFA/Drivers/Board/Buttons.h
+++ b/LUFA/Drivers/Board/Buttons.h
@@ -60,6 +60,21 @@
*
* For possible BOARD makefile values, see \ref Group_BoardTypes.
*
+ * <b>Example Usage:</b>
+ * \code
+ * // Initialise the button driver before first use
+ * Buttons_Init();
+ *
+ * printf("Waiting for button press...\r\n");
+ *
+ * // Loop until a board button has been pressed
+ * uint8_t ButtonPress;
+ * while (!(ButtonPress = Buttons_GetStatus())) {};
+ *
+ * // Display which button was pressed (assuming two board buttons)
+ * printf("Button pressed: %s\r\n", (ButtonPress == BUTTONS_BUTTON1) ? "Button 1" : "Button 2");
+ * \endcode
+ *
* @{
*/