summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2020-07-17 15:37:05 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2020-07-17 15:37:05 +0200
commit583ece21a3484fa4a923cfcd2d3a66828485da40 (patch)
tree7b8b116d6a858860436af8c7338a5162b0d1af2f /include
parent52f23fad43b47c6cebb38fa387c39d0e27a12797 (diff)
MSP430FR5969: Disable pull-ups when configuring pin as input w/o pull-up
Diffstat (limited to 'include')
-rw-r--r--include/arch/msp430fr5969lp/driver/gpio.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/arch/msp430fr5969lp/driver/gpio.h b/include/arch/msp430fr5969lp/driver/gpio.h
index d279e31..65b5567 100644
--- a/include/arch/msp430fr5969lp/driver/gpio.h
+++ b/include/arch/msp430fr5969lp/driver/gpio.h
@@ -66,14 +66,19 @@ class GPIO {
inline void input(unsigned char const pin) {
if (pin < p2_0) {
P1DIR &= ~(1 << pin);
+ P1REN &= ~(1 << pin);
} else if (pin < p3_0) {
P2DIR &= ~(1 << (pin - p2_0));
+ P2REN &= ~(1 << (pin - p2_0));
} else if (pin < p4_0) {
P3DIR &= ~(1 << (pin - p3_0));
+ P3REN &= ~(1 << (pin - p3_0));
} else if (pin < pj_0) {
P4DIR &= ~(1 << (pin - p4_0));
+ P4REN &= ~(1 << (pin - p4_0));
} else if (pin < PIN_INVALID) {
PJDIR &= ~(1 << (pin - pj_0));
+ PJREN &= ~(1 << (pin - pj_0));
}
}
inline void input(unsigned char const pin, unsigned char const pull) {