diff options
Diffstat (limited to 'src/lpc176x/gpio.h')
-rw-r--r-- | src/lpc176x/gpio.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/lpc176x/gpio.h b/src/lpc176x/gpio.h new file mode 100644 index 00000000..030528e6 --- /dev/null +++ b/src/lpc176x/gpio.h @@ -0,0 +1,22 @@ +#ifndef __LPC176X_GPIO_H +#define __LPC176X_GPIO_H + +#include <stdint.h> + +struct gpio_out { + void *regs; + uint32_t bit; +}; +struct gpio_out gpio_out_setup(uint8_t pin, uint8_t val); +void gpio_out_toggle_noirq(struct gpio_out g); +void gpio_out_toggle(struct gpio_out g); +void gpio_out_write(struct gpio_out g, uint8_t val); + +struct gpio_in { + void *regs; + uint32_t bit; +}; +struct gpio_in gpio_in_setup(uint8_t pin, int8_t pull_up); +uint8_t gpio_in_read(struct gpio_in g); + +#endif // gpio.h |