diff options
Diffstat (limited to 'src/sam3x8e/gpio.c')
-rw-r--r-- | src/sam3x8e/gpio.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/sam3x8e/gpio.c b/src/sam3x8e/gpio.c index 9b7cca65..2311d41f 100644 --- a/src/sam3x8e/gpio.c +++ b/src/sam3x8e/gpio.c @@ -10,25 +10,17 @@ #include "command.h" // shutdown #include "compiler.h" // ARRAY_SIZE #include "gpio.h" // gpio_out_setup +#include "internal.h" // gpio_peripheral #include "sam3x8e.h" // Pio #include "sched.h" // sched_shutdown - -/**************************************************************** - * Pin mappings - ****************************************************************/ - -#define GPIO(PORT, NUM) (((PORT)-'A') * 32 + (NUM)) -#define GPIO2PORT(PIN) ((PIN) / 32) -#define GPIO2BIT(PIN) (1<<((PIN) % 32)) - static Pio * const digital_regs[] = { PIOA, PIOB, PIOC, PIOD }; /**************************************************************** - * General Purpose Input Output (GPIO) pins + * Pin multiplexing ****************************************************************/ void @@ -47,6 +39,10 @@ gpio_peripheral(char bank, uint32_t bit, char ptype, uint32_t pull_up) } +/**************************************************************** + * General Purpose Input Output (GPIO) pins + ****************************************************************/ + struct gpio_out gpio_out_setup(uint8_t pin, uint8_t val) { |