klipper/src/samd21/internal.h
Kevin O'Connor 6df7356baa samd21: Fix gpio in support
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-30 23:10:23 -05:00

15 lines
399 B
C

#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