diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2016-06-14 14:27:30 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2016-06-14 14:27:30 -0400 |
commit | cc62a3dbf387dffe2d7e836c64cb5f5169971f05 (patch) | |
tree | 2ac823250c391a4883e7374616adf6d8eba33982 /src/sam3x8e/gpio.h | |
parent | 31c04261c14b7ab7cca2d191d294c3efa326c8f1 (diff) | |
download | kutter-cc62a3dbf387dffe2d7e836c64cb5f5169971f05.tar.gz kutter-cc62a3dbf387dffe2d7e836c64cb5f5169971f05.tar.xz kutter-cc62a3dbf387dffe2d7e836c64cb5f5169971f05.zip |
sam3x8e: Add initial support for Arduino Due boards
This adds basic support for running on the Atmel SAM3x8e
micro-controllers that are found in the Arudino Due boards.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/sam3x8e/gpio.h')
-rw-r--r-- | src/sam3x8e/gpio.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/sam3x8e/gpio.h b/src/sam3x8e/gpio.h new file mode 100644 index 00000000..d8fdf569 --- /dev/null +++ b/src/sam3x8e/gpio.h @@ -0,0 +1,23 @@ +#ifndef __SAM3X8E_GPIO_H +#define __SAM3X8E_GPIO_H + +#include <stdint.h> + +void gpio_peripheral(char bank, uint32_t bit, char ptype, uint32_t pull_up); + +struct gpio_out { + void *regs; + uint32_t bit; +}; +struct gpio_out gpio_out_setup(uint8_t pin, uint8_t val); +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 |