diff options
Diffstat (limited to 'LUFA/Drivers/Board/USBKEY')
-rw-r--r-- | LUFA/Drivers/Board/USBKEY/Buttons.h (renamed from LUFA/Drivers/Board/USBKEY/HWB.h) | 30 | ||||
-rw-r--r-- | LUFA/Drivers/Board/USBKEY/Dataflash.h | 2 |
2 files changed, 18 insertions, 14 deletions
diff --git a/LUFA/Drivers/Board/USBKEY/HWB.h b/LUFA/Drivers/Board/USBKEY/Buttons.h index 13af186a0..78c5b5662 100644 --- a/LUFA/Drivers/Board/USBKEY/HWB.h +++ b/LUFA/Drivers/Board/USBKEY/Buttons.h @@ -30,14 +30,14 @@ /** \file
*
- * Board specific HWB driver header for the USBKEY.
+ * Board specific Buttons driver header for the USBKEY.
*
- * \note This file should not be included directly. It is automatically included as needed by the HWB driver
- * dispatch header located in LUFA/Drivers/Board/HWB.h.
+ * \note This file should not be included directly. It is automatically included as needed by the Buttons driver
+ * dispatch header located in LUFA/Drivers/Board/Buttons.h.
*/
-#ifndef __HWB_USBKEY_H__
-#define __HWB_USBKEY_H__
+#ifndef __BUTTONS_USBKEY_H__
+#define __BUTTONS_USBKEY_H__
/* Includes: */
#include <avr/io.h>
@@ -51,23 +51,27 @@ #endif
/* Preprocessor Checks: */
- #if !defined(INCLUDE_FROM_HWB_H)
- #error Do not include this file directly. Include LUFA/Drivers/Board/HWB.h instead.
+ #if !defined(INCLUDE_FROM_BUTTONS_H)
+ #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif
/* Public Interface - May be used in end-application: */
+ /* Macros: */
+ /** Button mask for the first button on the board. */
+ #define BUTTONS_BUTTON1 (1 << 2)
+
/* Inline Functions: */
#if !defined(__DOXYGEN__)
- static inline void HWB_Init(void)
+ static inline void Buttons_Init(void)
{
- DDRE &= ~(1 << 2);
- PORTE |= (1 << 2);
+ DDRE &= ~BUTTONS_BUTTON1;
+ PORTE |= BUTTONS_BUTTON1;
}
- static inline bool HWB_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
- static inline bool HWB_GetStatus(void)
+ static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
+ static inline uint8_t Buttons_GetStatus(void)
{
- return (!(PINE & (1 << 2)));
+ return ((PINE & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1);
}
#endif
diff --git a/LUFA/Drivers/Board/USBKEY/Dataflash.h b/LUFA/Drivers/Board/USBKEY/Dataflash.h index cae62fd49..d4bfdc943 100644 --- a/LUFA/Drivers/Board/USBKEY/Dataflash.h +++ b/LUFA/Drivers/Board/USBKEY/Dataflash.h @@ -30,7 +30,7 @@ /** \file
*
- * Board specific HWB driver header for the STK525.
+ * Board specific Dataflash driver header for the STK525.
*
* \note This file should not be included directly. It is automatically included as needed by the dataflash driver
* dispatch header located in LUFA/Drivers/Board/Dataflash.h.
|