From a4513f01592628599f3461fcc5862902d3da7ea4 Mon Sep 17 00:00:00 2001 From: Glenn Ruben Bakke Date: Mon, 8 May 2017 21:20:08 +0200 Subject: [PATCH] nrf5/hal/gpio: Add function to clear output register using a pin mask. --- nrf5/hal/hal_gpio.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nrf5/hal/hal_gpio.h b/nrf5/hal/hal_gpio.h index 2cc73a5fe9..06fadcbef9 100644 --- a/nrf5/hal/hal_gpio.h +++ b/nrf5/hal/hal_gpio.h @@ -78,6 +78,10 @@ static inline void hal_gpio_out_set(uint8_t port, uint32_t pin_mask) { GPIO_BASE(port)->OUTSET = pin_mask; } +static inline void hal_gpio_out_clear(uint8_t port, uint32_t pin_mask) { + GPIO_BASE(port)->OUTCLR = pin_mask; +} + static inline void hal_gpio_pin_set(uint8_t port, uint32_t pin) { GPIO_BASE(port)->OUTSET = (1 << pin); }