diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2018-12-25 10:28:21 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2019-01-07 19:30:17 -0500 |
commit | ecba3e9a19236c04e93ff102bc5cde55fdc906ad (patch) | |
tree | edbbb473ed077a7b38a493ab250708e0effaad28 /src/sam3x8e/gpio.c | |
parent | c3a2fc981d29202821e8a375005813fec76b32a7 (diff) | |
download | kutter-ecba3e9a19236c04e93ff102bc5cde55fdc906ad.tar.gz kutter-ecba3e9a19236c04e93ff102bc5cde55fdc906ad.tar.xz kutter-ecba3e9a19236c04e93ff102bc5cde55fdc906ad.zip |
sam3x8e: Add an internal.h header file with local definitions
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
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) { |