From cc62a3dbf387dffe2d7e836c64cb5f5169971f05 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 14 Jun 2016 14:27:30 -0400 Subject: sam3x8e: Add initial support for Arduino Due boards This adds basic support for running on the Atmel SAM3x8e micro-controllers that are found in the Arudino Due boards. Signed-off-by: Kevin O'Connor --- klippy/pins.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'klippy/pins.py') diff --git a/klippy/pins.py b/klippy/pins.py index d2d884d1..d41d9cd6 100644 --- a/klippy/pins.py +++ b/klippy/pins.py @@ -6,23 +6,24 @@ import re -def avr_pins(port_count): +def port_pins(port_count, bit_count=8): pins = {} for port in range(port_count): portchr = chr(65 + port) if portchr == 'I': continue - for portbit in range(8): - pins['P%c%d' % (portchr, portbit)] = port * 8 + portbit + for portbit in range(bit_count): + pins['P%c%d' % (portchr, portbit)] = port * bit_count + portbit return pins -PINS_atmega164 = avr_pins(4) -PINS_atmega1280 = avr_pins(12) +PINS_atmega164 = port_pins(4) +PINS_atmega1280 = port_pins(12) MCU_PINS = { "atmega168": PINS_atmega164, "atmega644p": PINS_atmega164, - "at90usb1286": avr_pins(5), + "at90usb1286": port_pins(5), "atmega1280": PINS_atmega1280, "atmega2560": PINS_atmega1280, + "sam3x8e": port_pins(4, 32) } def mcu_to_pins(mcu): -- cgit v1.2.3-70-g09d2