projects
/
fw
/
altos
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c82b214
)
fixup for exti restore
author
Keith Packard
<keithp@keithp.com>
Sun, 13 Nov 2022 03:38:56 +0000
(19:38 -0800)
committer
Keith Packard
<keithp@keithp.com>
Sun, 13 Nov 2022 03:38:56 +0000
(19:38 -0800)
Signed-off-by: Keith Packard <keithp@keithp.com>
src/samd21/samd21.h
patch
|
blob
|
history
diff --git
a/src/samd21/samd21.h
b/src/samd21/samd21.h
index 747f3ad5f8df52652c5d2321b8b9d37ad883d7ad..b101c6b9f3e97c100d803a3c3d938f88a254bb56 100644
(file)
--- a/
src/samd21/samd21.h
+++ b/
src/samd21/samd21.h
@@
-777,6
+777,16
@@
samd21_port_pmux_set(struct samd21_port *port, uint8_t pin, uint8_t func)
(1 << SAMD21_PORT_PINCFG_PMUXEN));
}
+static inline uint8_t
+samd21_port_pmux_get(struct samd21_port *port, uint8_t pin)
+{
+ uint8_t byte = pin >> 1;
+ uint8_t bit = (pin & 1) << 2;
+ uint8_t mask = 0xf << bit;
+ uint8_t value = (uint8_t) ((port->pmux[byte] & mask) >> bit);
+ return value;
+}
+
static inline void
samd21_port_pmux_clr(struct samd21_port *port, uint8_t pin)
{