aboutsummaryrefslogtreecommitdiff
path: root/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h
diff options
context:
space:
mode:
authorDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2012-02-19 17:03:08 +0000
committerDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2012-02-19 17:03:08 +0000
commitc83edc6f4d3f447b5e4328a1f02fdc17b1bd5683 (patch)
treea7d8c567e10aded4d5d45f41cc63b234a7e78aad /LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h
parent9b0c63fa0a32478a8f5bdd90a9ab4a23a19cb1f0 (diff)
Add tag for the 120219 release.LUFA-120219
git-svn-id: http://lufa-lib.googlecode.com/svn/tags/LUFA-120219@2061 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h')
-rw-r--r--LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h36
1 files changed, 23 insertions, 13 deletions
diff --git a/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h b/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h
index 1665fa4b..d4e20840 100644
--- a/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h
+++ b/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h
@@ -1,18 +1,18 @@
/*
LUFA Library
- Copyright (C) Dean Camera, 2011.
+ Copyright (C) Dean Camera, 2012.
dean [at] fourwalledcubicle [dot] com
- www.fourwalledcubicle.com
+ www.lufa-lib.org
*/
/*
- Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+ Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, and distribute this software
- and its documentation for any purpose and without fee is hereby
- granted, provided that the above copyright notice appear in all
- copies and that both that the copyright notice and this
+ Permission to use, copy, modify, distribute, and sell this
+ software and its documentation for any purpose is hereby granted
+ without fee, provided that the above copyright notice appear in
+ all copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
@@ -76,18 +76,28 @@
#if !defined(__DOXYGEN__)
static inline void Buttons_Init(void)
{
- PORTE_OUTCLR = BUTTONS_BUTTON1;
- PORTF_OUTCLR = (BUTTONS_BUTTON2 | BUTTONS_BUTTON3);
+ PORTE.OUTCLR = BUTTONS_BUTTON1;
+ PORTE.PIN5CTRL = (PORT_OPC_PULLUP_gc | PORT_INVEN_bm);
- PORTE_PIN5CTRL = PORT_OPC_PULLUP_gc;
- PORTF_PIN1CTRL = PORT_OPC_PULLUP_gc;
- PORTF_PIN2CTRL = PORT_OPC_PULLUP_gc;
+ PORTF.OUTCLR = (BUTTONS_BUTTON2 | BUTTONS_BUTTON3);
+ PORTF.PIN1CTRL = (PORT_OPC_PULLUP_gc | PORT_INVEN_bm);
+ PORTF.PIN2CTRL = (PORT_OPC_PULLUP_gc | PORT_INVEN_bm);
+ }
+
+ static inline void Buttons_Disable(void)
+ {
+ PORTE.OUTCLR = BUTTONS_BUTTON1;
+ PORTE.PIN5CTRL = 0;
+
+ PORTF.OUTCLR = (BUTTONS_BUTTON2 | BUTTONS_BUTTON3);
+ PORTF.PIN1CTRL = 0;
+ PORTF.PIN2CTRL = 0;
}
static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t Buttons_GetStatus(void)
{
- return ((~PORTE_IN & BUTTONS_BUTTON1) | (~PORTF_IN & (BUTTONS_BUTTON2 | BUTTONS_BUTTON3)));
+ return ((PORTE_IN & BUTTONS_BUTTON1) | (PORTF_IN & (BUTTONS_BUTTON2 | BUTTONS_BUTTON3)));
}
#endif