2018-07-31 22:49:37 +03:00
|
|
|
#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);
|
2018-08-21 00:06:17 +03:00
|
|
|
void gpio_out_reset(struct gpio_out g, uint8_t val);
|
2018-07-31 22:49:37 +03:00
|
|
|
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);
|
2018-08-21 00:06:17 +03:00
|
|
|
void gpio_in_reset(struct gpio_in g, int8_t pull_up);
|
2018-07-31 22:49:37 +03:00
|
|
|
uint8_t gpio_in_read(struct gpio_in g);
|
|
|
|
|
|
|
|
#endif // gpio.h
|