aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/pins.py
Commit message (Collapse)AuthorAgeFilesLines
* pins: Remove support for deprecated pin_map optionKevin O'Connor2021-11-021-146/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Rename the analog-only PE0/PE1 pins on atmega168/328 to PE2/PE3Kevin O'Connor2021-08-141-1/+1
| | | | | | | The atmega328pb has officially named these pins as PE2 and PE3, so use that naming scheme instead of the previous Klipper invented names. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* duplicate_pin_override: Debugging tool to permit multiple use pinsKevin O'Connor2021-06-271-3/+10
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Move MCU_stepper from mcu.py to stepper.pyKevin O'Connor2019-11-121-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* board_pins: Add a new "extras" module to support per-board pin aliasesKevin O'Connor2019-08-191-2/+14
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pins: Move reserved pin handling into PinResolver classKevin O'Connor2019-08-191-17/+18
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pins: Add arduino aliases for Adafruit Grand Central boardKevin O'Connor2019-08-091-0/+22
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc2208: Add support for using an analog mux to access TMC uartsKevin O'Connor2019-06-121-10/+15
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bus: Support bus enumerations and add support for reserved pinsKevin O'Connor2019-04-041-1/+14
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pins: Document support for '~' to enable pull-down resistorsKevin O'Connor2019-03-171-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pins: Simplify alias codeKevin O'Connor2019-03-171-25/+9
| | | | | | | Simplify the pin aliasing code now that all pins are defined via enumerations. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* linux: Use enumerations for pin mappingsKevin O'Connor2019-03-171-1/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pru: Use enumerations for pin mappingsKevin O'Connor2019-03-171-13/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f1: Use enumerations for pin mappingsKevin O'Connor2019-03-171-11/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Use enumerations for pin mappingsKevin O'Connor2019-03-171-5/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsamd: Use enumerations for pin mappingsKevin O'Connor2019-03-171-3/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsam: Use enumerations for pin mappingsKevin O'Connor2019-03-171-2/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Use enumerations for pin mappingsKevin O'Connor2019-03-171-10/+11
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsamd: Add definitions for SAMD21E18 chipKevin O'Connor2019-03-011-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsamd: Use the full micro-controller name for CONFIG_MCUKevin O'Connor2019-03-011-3/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pins: Wrap code to 80 columnsKevin O'Connor2019-02-271-3/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pins: Add support for pull down resistorsKevin O'Connor2019-02-271-2/+4
| | | | | | | Add initial support for selecting pull down resistors (for micro-controllers that support it). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsamd: Initial support for SAMD51Kevin O'Connor2019-01-281-0/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsam: Add support for the SAM3X8C micro-controllerKevin O'Connor2019-01-221-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam3: Add support for sam4s8c chipsKevin O'Connor2019-01-071-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bus: Don't raise a "duplicate pin" warning on None pinsKevin O'Connor2019-01-021-0/+3
| | | | | | | If "None" is used for an spi cs pin, then it should not reserve "None" for other uses. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Add initial support for atmega32u4 chipsKevin O'Connor2018-11-201-0/+1
| | | | | Signed-off-by: Trevor Jones <trevorjones141@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Add support for atmega328pKevin O'Connor2018-10-291-1/+3
| | | | | | | The atmega328p is basically the same as the atmega328 - add explicit support for it so that avrdude doesn't complain while flashing. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pins: Verify the pin_map settingKevin O'Connor2018-09-031-4/+10
| | | | | | Raise an error if pin_map is not set to a valid value. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam4e8e: Add the SAM4e8e portFlorian Heilmann2018-08-081-0/+1
| | | | | | | | This can be flashed to e.g. the duet wifi using bossac. It requires a later version as is currently included in the klipper repo (1.8 vs. 1.2). Comms are currently via UART0 only, USB serial is still TBD Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
* samd21: Add support for gpio pinsKevin O'Connor2018-08-071-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pins: Explicitly pass can_invert and can_pullup to lookup_pin()Kevin O'Connor2018-07-261-8/+8
| | | | | | | | | | | | Don't pass pin_type to lookup_pin() - instead, if a pin can be inverted or can have a pullup, then the caller must explicitly specify that when calling lookup_pin(). This simplifies the code for the cases where it is not valid to invert or pullup. Explicitly pass the pin_type to setup_pin() and have ppins.setup_pin() apply default pullup and invert flags. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: No need to pass printer reference to add_printer_objects()Kevin O'Connor2018-07-121-2/+2
| | | | | | The config reference already stores a reference to the printer object. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buttons: Add initial support for detecting button pressesKevin O'Connor2018-06-301-2/+3
| | | | | | | Add mcu support for periodically polling for a button press. Add host code support for registering buttons and invoking callbacks for them. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pins: Strip pin names before trying to parse themKevin O'Connor2018-06-301-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Add support for GPIO pinsKevin O'Connor2018-05-251-0/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Add STM32F103 portGrigori Goronzy2018-04-091-0/+1
| | | | | | | | | | | | Add a fully functional STM32F1 port, currently mostly targeting STM32F103 microcontrollers. This requires an 8 MHz XTAL. The maximum possible step rate is around 282K steps per second. This uses stm32flash to burn the firmware. The bootloader needs to be started by setting BOOT0 to 1 and resetting the MCU. There is no automatic bootloader, unlike on Arduino. Signed-off-by: Grigori Goronzy <greg@kinoho.net>
* pins: Remove module level get_printer_pins() and setup_pin() functionsKevin O'Connor2018-04-041-6/+0
| | | | | | | | Most callers did a lookup of the pins module via printer.lookup_object("pins"). Use that as the standard method and remove these less frequently used methods. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Add at90usb646 supportDouglas Hammond2018-02-251-1/+1
| | | | Signed-off-by: Douglas Hammond wizhippo@gmail.com
* pins: Warn on invalid pin formatKevin O'Connor2018-02-071-7/+17
| | | | | | Raise an error if a pin description isn't formatted correctly. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Add access methods and avoid peeking into the printer classesKevin O'Connor2018-01-281-1/+1
| | | | | | | | | Add get_reactor(), lookup_object(), lookup_module_objects(), and set_rollover_info() to the main Printer class so that callers do not need to peek into the class' members. Similarly, add get_printer() and get_name() methods to the ConfigWrapper class. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pins: Check if the same pin is referenced via different aliasesKevin O'Connor2018-01-101-14/+25
| | | | | | | | Change the update_command() call to use a new PinResolver class. In that new class, verify that the same pin isn't referenced in two different parts of the config using different aliases for the pin. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Automatically detect and handle shared stepper enable linesKevin O'Connor2018-01-101-4/+16
| | | | | | | | | | | It's common for multiple steppers to use the same stepper enable line. Detect this and only create a single digital_out oid on the micro-controller. Also, prohibit any other pin from being used multiple times in the config file. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pins: Rename parse_pin_desc() to lookup_pin()Kevin O'Connor2018-01-101-9/+9
| | | | | | | Always set the pin_params['type'] field on a pin lookup. Rename parse_pin_desc() to lookup_pin() to make the change more clear. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pins: Fix atmega168/328 mappingsKevin O'Connor2017-12-091-1/+2
| | | | | | | | | The atmega168 and atmega328 need to define PE0 and PE1 in order to support the 2 extra analog pins. Also, support the arduino mappings for the atmega328. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pins: Add pin mapping for atmega1284pKevin O'Connor2017-10-051-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* linux: Add support for analog IIO devicesKevin O'Connor2017-09-201-0/+1
| | | | | | | | Add support for reading analog values via the standard Linux IIO interface. This can be used on Replicape boards to sample analog input pins. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pins: Don't pass mcu_freq to update_command()Kevin O'Connor2017-09-131-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Drop support for TICKS() expansion in mcu config commandsKevin O'Connor2017-08-261-5/+2
| | | | | | | It's no longer necessary to use the TICKS() hack as the config commands are now all generated after the mcu speed is known. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pins: Support registering arbitrary chips that supply configurable pinsKevin O'Connor2017-08-251-3/+56
| | | | | | | | | Allow multiple chips to provide pin mappings (not just the main mcu chip). Move the pin parsing from the mcu.py code to pins.py and support mapping from pin descriptions to their corresponding chips and parameters. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>