diff options
Diffstat (limited to 'src/atsamd/internal.h')
-rw-r--r-- | src/atsamd/internal.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/atsamd/internal.h b/src/atsamd/internal.h new file mode 100644 index 00000000..7043007f --- /dev/null +++ b/src/atsamd/internal.h @@ -0,0 +1,14 @@ +#ifndef __SAMD21_INTERNAL_H +#define __SAMD21_INTERNAL_H +// Local definitions for samd21 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 enable_pclock(uint32_t clock_id, uint32_t pmask); +void gpio_peripheral(uint32_t gpio, char ptype, int32_t pull_up); + +#endif // internal.h |