diff options
-rw-r--r-- | include/arch/msp430fr5969lp/driver/gpio.h | 17 |
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; |