mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-24 07:04:01 -06:00
atsam: Use enumerations for pin mappings
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
8f541d090e
commit
8b0195f896
2 changed files with 21 additions and 10 deletions
|
@ -11,15 +11,28 @@
|
|||
#include "internal.h" // gpio_peripheral
|
||||
#include "sched.h" // sched_shutdown
|
||||
|
||||
DECL_ENUMERATION_RANGE("pin", "PA0", GPIO('A', 0), 32);
|
||||
DECL_ENUMERATION_RANGE("pin", "PB0", GPIO('B', 0), 32);
|
||||
#ifdef PIOC
|
||||
DECL_ENUMERATION_RANGE("pin", "PC0", GPIO('C', 0), 32);
|
||||
#endif
|
||||
#ifdef PIOD
|
||||
DECL_ENUMERATION_RANGE("pin", "PD0", GPIO('D', 0), 32);
|
||||
#endif
|
||||
#ifdef PIOE
|
||||
DECL_ENUMERATION_RANGE("pin", "PE0", GPIO('E', 0), 32);
|
||||
#endif
|
||||
|
||||
static Pio * const digital_regs[] = {
|
||||
#if CONFIG_MACH_SAM3X8E
|
||||
PIOA, PIOB, PIOC, PIOD
|
||||
#elif CONFIG_MACH_SAM3X8C
|
||||
PIOA, PIOB
|
||||
#elif CONFIG_MACH_SAM4S8C
|
||||
PIOA, PIOB, PIOC
|
||||
#elif CONFIG_MACH_SAM4E8E
|
||||
PIOA, PIOB, PIOC, PIOD, PIOE
|
||||
PIOA, PIOB,
|
||||
#ifdef PIOC
|
||||
PIOC,
|
||||
#endif
|
||||
#ifdef PIOD
|
||||
PIOD,
|
||||
#endif
|
||||
#ifdef PIOE
|
||||
PIOE,
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue