samd21: Use GPIO() macro when calling gpio_peripheral()

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2018-11-26 22:18:51 -05:00
parent 0af0bc946e
commit 6d90ebe6f8
4 changed files with 12 additions and 11 deletions

View File

@@ -4,7 +4,11 @@
#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(char bank, uint32_t bit, char ptype, uint32_t pull_up);
void gpio_peripheral(uint32_t gpio, char ptype, uint32_t pull_up);
#endif // internal.h