From 7e2c0ffa911dcbf4793b34c817747010894c2c15 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 12 Mar 2019 12:20:04 -0400 Subject: [PATCH] atsamd: Use enumerations for pin mappings Signed-off-by: Kevin O'Connor --- klippy/pins.py | 3 --- src/atsamd/gpio.c | 6 ++++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/klippy/pins.py b/klippy/pins.py index 4f22d48a..b47b0091 100644 --- a/klippy/pins.py +++ b/klippy/pins.py @@ -38,9 +38,6 @@ def beaglebone_pins(): return gpios MCU_PINS = { - "samd21g18a": port_pins(2, 32), "samd21e18a": port_pins(2, 32), - "samd51g19a": port_pins(2, 32), "samd51j19a": port_pins(3, 32), - "samd51n19a": port_pins(3, 32), "samd51p20a": port_pins(4, 32), "stm32f103": port_pins(5, 16), "lpc176x": lpc_pins(), "pru": beaglebone_pins(), diff --git a/src/atsamd/gpio.c b/src/atsamd/gpio.c index 2e26fa66..a83163a8 100644 --- a/src/atsamd/gpio.c +++ b/src/atsamd/gpio.c @@ -44,8 +44,14 @@ gpio_peripheral(uint32_t gpio, char ptype, int32_t pull_up) #if CONFIG_MACH_SAMD21 #define NUM_PORT 2 +DECL_ENUMERATION_RANGE("pin", "PA0", GPIO('A', 0), 32); +DECL_ENUMERATION_RANGE("pin", "PB0", GPIO('B', 0), 32); #elif CONFIG_MACH_SAMD51 #define NUM_PORT 4 +DECL_ENUMERATION_RANGE("pin", "PA0", GPIO('A', 0), 32); +DECL_ENUMERATION_RANGE("pin", "PB0", GPIO('B', 0), 32); +DECL_ENUMERATION_RANGE("pin", "PC0", GPIO('C', 0), 32); +DECL_ENUMERATION_RANGE("pin", "PD0", GPIO('D', 0), 32); #endif struct gpio_out