From 7512a712446b7ffa56af6fe0090274b92567acd5 Mon Sep 17 00:00:00 2001 From: Nathael Pajani Date: Thu, 19 Mar 2015 23:02:10 +0100 Subject: [PATCH] Add gpio_toggle define --- include/drivers/gpio.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/drivers/gpio.h b/include/drivers/gpio.h index 9c167cc..c8a88c1 100644 --- a/include/drivers/gpio.h +++ b/include/drivers/gpio.h @@ -85,6 +85,12 @@ void gpio_off(void); gpio_port->clear = (1 << gpio.pin);\ } +#define gpio_toggle(gpio) \ +{ \ + struct lpc_gpio* gpio_port = LPC_GPIO_REGS(gpio.port); \ + gpio_port->toggle = (1 << gpio.pin);\ +} + /* GPIO Configuration * This function calls the config_pio() function for the gpio with the given -- 2.43.0