summaryrefslogtreecommitdiff
path: root/digital/avr/common
diff options
context:
space:
mode:
authorNicolas Schodet2011-05-06 23:39:13 +0200
committerNicolas Schodet2011-05-06 23:42:12 +0200
commitf018d5a18fd4844ed65254fa58e220237aa506ed (patch)
treee56303a7f38ea3fbc2bd5c23470c8dea15bfbd07 /digital/avr/common
parent8bae07b463b80a6e3b877b01302507e4d1aa335b (diff)
digital/avr/common/io: add io macros for expanded io names
Diffstat (limited to 'digital/avr/common')
-rw-r--r--digital/avr/common/io.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/digital/avr/common/io.h b/digital/avr/common/io.h
index cf706e9c..9690a55b 100644
--- a/digital/avr/common/io.h
+++ b/digital/avr/common/io.h
@@ -110,10 +110,15 @@ intr_restore (intr_flags_t flags) { }
#define IO_N(io) IO_N_ (io)
#define IO_N_(p, n) (n)
-#define IO_GET(io) (IO_PIN_ (io) & IO_BV_ (io))
-#define IO_SET(io) IO_PORT_ (io) |= IO_BV_ (io)
-#define IO_CLR(io) IO_PORT_ (io) &= ~IO_BV_ (io)
-#define IO_OUTPUT(io) IO_DDR_ (io) |= IO_BV_ (io)
-#define IO_INPUT(io) IO_DDR_ (io) &= ~IO_BV_ (io)
+#define IO_GET(io) IO_GET_ (io)
+#define IO_GET_(p, n) (IO_PIN_ (p, n) & IO_BV_ (p, n))
+#define IO_SET(io) IO_SET_ (io)
+#define IO_SET_(p, n) IO_PORT_ (p, n) |= IO_BV_ (p, n)
+#define IO_CLR(io) IO_CLR_ (io)
+#define IO_CLR_(p, n) IO_PORT_ (p, n) &= ~IO_BV_ (p, n)
+#define IO_OUTPUT(io) IO_OUTPUT_ (io)
+#define IO_OUTPUT_(p, n) IO_DDR_ (p, n) |= IO_BV_ (p, n)
+#define IO_INPUT(io) IO_INPUT_ (io)
+#define IO_INPUT_(p, n) IO_DDR_ (p, n) &= ~IO_BV_ (p, n)
#endif /* io_h */