summaryrefslogtreecommitdiff
path: root/quantum/config_common.h
diff options
context:
space:
mode:
authorTakeshi ISHII <2170248+mtei@users.noreply.github.com>2019-08-22 09:10:47 +0900
committerFlorian Didron <fdidron@users.noreply.github.com>2019-08-28 14:52:34 +0900
commitac52955ff26e783cf74a449f824dffb3bf209ee0 (patch)
tree950916c992a61747b0f36adc13c77811c853e9d5 /quantum/config_common.h
parentef5cdd2262d340c5cc0e4c0011d81950e637eeb9 (diff)
AVR GPIO macro defines more readable (#5937)
* A little easier to read the definition of the GPIO control macro for AVR. No change in build result. * Changed to not use GNU statement expression extension. No change in build result. * Modified split_common/serial.c to use qmk_firmware standard GPIO control macro. No change in build result. * fix PE6 -> E6 * remove some space * add some comment to config_common.h * Changed split_common/serial.c to use a newer version of qmk_firmware standard GPIO control macro.
Diffstat (limited to 'quantum/config_common.h')
-rw-r--r--quantum/config_common.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/quantum/config_common.h b/quantum/config_common.h
index bc4d9ec1af..ae72701da1 100644
--- a/quantum/config_common.h
+++ b/quantum/config_common.h
@@ -132,6 +132,16 @@
#define F7 PINDEF(F, 7)
#endif
+ #ifndef __ASSEMBLER__
+ #define _PIN_ADDRESS(p, offset) _SFR_IO8(ADDRESS_BASE + (p >> PORT_SHIFTER) + offset)
+ // Port X Input Pins Address
+ #define PINx_ADDRESS(p) _PIN_ADDRESS(p, 0)
+ // Port X Data Direction Register, 0:input 1:output
+ #define DDRx_ADDRESS(p) _PIN_ADDRESS(p, 1)
+ // Port X Data Register
+ #define PORTx_ADDRESS(p) _PIN_ADDRESS(p, 2)
+ #endif
+
#elif defined(PROTOCOL_CHIBIOS)
// Defines mapping for Proton C replacement
#ifdef CONVERT_TO_PROTON_C