summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-10-25 13:39:03 +0200
committerDaniel Friesel <derf@finalrewind.org>2018-10-25 13:39:03 +0200
commite3f0c6556f66e97b8cf47df4473da52242a58997 (patch)
treea48c31e432e83d3e24c5170ff5ff8d48db59ffcf
parentf6c24bc802f2cb5ec959a768b60dadc957f113cb (diff)
msp430 gpio: Add (unused) write_mask function
-rw-r--r--include/arch/msp430fr5969lp/driver/gpio.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/arch/msp430fr5969lp/driver/gpio.h b/include/arch/msp430fr5969lp/driver/gpio.h
index 2f271c2..84ce820 100644
--- a/include/arch/msp430fr5969lp/driver/gpio.h
+++ b/include/arch/msp430fr5969lp/driver/gpio.h
@@ -166,6 +166,23 @@ class GPIO {
}
}
}
+ inline void write_mask(unsigned char const pin_base, unsigned char set_mask, unsigned char clear_mask) {
+ if (pin_base < p2_0) {
+ P1OUT = (P1OUT | set_mask) & ~clear_mask;
+ }
+ if (pin_base < p3_0) {
+ P2OUT = (P2OUT | set_mask) & ~clear_mask;
+ }
+ if (pin_base < p4_0) {
+ P3OUT = (P3OUT | set_mask) & ~clear_mask;
+ }
+ if (pin_base < pj_0) {
+ P4OUT = (P4OUT | set_mask) & ~clear_mask;
+ }
+ if (pin_base < PIN_INVALID) {
+ PJOUT = (PJOUT | set_mask) & ~clear_mask;
+ }
+ }
};
extern GPIO gpio;