diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2018-07-31 15:49:37 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2018-08-07 00:03:21 -0400 |
commit | cf2393efc8697028ec9fc389ec992c6050fb5878 (patch) | |
tree | 8ac2e750a0a0c7589d975a0be05ea718b0431b7c /src/samd21/gpio.h | |
parent | 74cf4dc9e0fa129b315b398d8e70e4df20b26aea (diff) | |
download | kutter-cf2393efc8697028ec9fc389ec992c6050fb5878.tar.gz kutter-cf2393efc8697028ec9fc389ec992c6050fb5878.tar.xz kutter-cf2393efc8697028ec9fc389ec992c6050fb5878.zip |
samd21: Add support for gpio pins
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/samd21/gpio.h')
-rw-r--r-- | src/samd21/gpio.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/samd21/gpio.h b/src/samd21/gpio.h new file mode 100644 index 00000000..0cba5dba --- /dev/null +++ b/src/samd21/gpio.h @@ -0,0 +1,22 @@ +#ifndef __SAM3X8E_GPIO_H +#define __SAM3X8E_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 |