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/internal.h | |
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/internal.h')
-rw-r--r-- | src/sam3x8e/internal.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/sam3x8e/internal.h b/src/sam3x8e/internal.h new file mode 100644 index 00000000..733ef694 --- /dev/null +++ b/src/sam3x8e/internal.h @@ -0,0 +1,13 @@ +#ifndef __SAM3_INTERNAL_H +#define __SAM3_INTERNAL_H +// Local definitions for sam3 code + +#include <stdint.h> // uint32_t + +#define GPIO(PORT, NUM) (((PORT)-'A') * 32 + (NUM)) +#define GPIO2PORT(PIN) ((PIN) / 32) +#define GPIO2BIT(PIN) (1<<((PIN) % 32)) + +void gpio_peripheral(char bank, uint32_t bit, char ptype, uint32_t pull_up); + +#endif // internal.h |