aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/replicape.py
Commit message (Collapse)AuthorAgeFilesLines
* replicape: Don't require a host alias for the enable_pin defaultKevin O'Connor2021-03-251-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pca9685: Use move queue for pwm updatesKevin O'Connor2020-12-041-1/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Add support for changing cycle_time in set_pwm()Kevin O'Connor2020-09-261-1/+1
| | | | | Signed-off-by: Guy Shapira <gayuha@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extras: Use "from . import module" for relative importsKevin O'Connor2020-06-151-1/+2
| | | | | | Use alternate import syntax to improve Python3 compatibility. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* linux: Adapt servo0 channels for beagleboard kernel 4.14.108-ti (#2746)Janne Grunau2020-05-031-3/+17
| | | | | | | | | | | | | | The beagleboard TI kernel 4.14 and 4.19 contain a commit which change the device names ("pwm: Create device class for pwm channels") from pwmN to pwm-${chip}:N. This commit was never merged into the upstream kernel. Decrease the number of pwm channels to a more reasonable 16. Increase the number of pwm chips to 8 since the replicape servo pwm outputs are on pwmchip4. Update replicape code to detect appropriate channel. Signed-off-by: Janne Grunau <janne-gh@jannau.net>
* pins: Move reserved pin handling into PinResolver classKevin O'Connor2019-08-191-2/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* spicmds: Rework spi config commandsKevin O'Connor2019-08-061-2/+2
| | | | | | | | | | Rework the spi_config commands so that bus configuration and shutdown message configuration is done separately from the main "config_spi" command. This makes the spi configuration more flexible. It's now possible to use software spi without a CS pin. It's now possible to define multiple SPI messages to send on a shutdown event. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* replicape: Try to detect shift register spi on spidev2.1Kevin O'Connor2019-07-121-4/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* replicape: add support for Linux hardware PWM (#1443)Janne Grunau2019-04-061-10/+41
| | | | | | | | | | | | | The servo pins (P9_14/P9_16) are muxed to the SOCs hardware PWM unit driven by a 13MHz GP timer. They have to be driven by the linux host mcu. This commits adds hardware PWM support using the linux sysfs user space interface. The servo pins can be specified as "replicape:servo0" and "replicape:servo1". Removes the "servo0_enable", "servo1_enable" configuration parameters. Fixes #1105. Signed-off-by: Janne Grunau <janne-3d@jannau.net>
* linux: Convert SPI to use enumerationsKevin O'Connor2019-04-041-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* replicape: Use bus.py helper code for spiKevin O'Connor2018-11-211-17/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Rename add_config_object() to register_config_callback()Kevin O'Connor2018-09-031-4/+4
| | | | | | | | | Change the name of the config registration method and pass an explicit reference to the callback to the new method. This makes the relationship between mcu registration and build_config() more clear in the calling code. 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-7/+7
| | | | | | | | | | | | 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>
* linux: Convert linux SPI code to use the generic spicmds.c codeKevin O'Connor2018-05-071-12/+14
| | | | | | | | | | Use the generic spi send/receive code on Linux. Update the replicape code to use the updated command format. Also, update the replicape code to turn off the stepper motors on a shutdown event. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pins: Remove module level get_printer_pins() and setup_pin() functionsKevin O'Connor2018-04-041-3/+4
| | | | | | | | 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>
* replicape: Add config controls for the servo[01]_enable linesKevin O'Connor2018-03-171-0/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialhdl: Add a wrapper around the results of lookup_command()Kevin O'Connor2018-02-271-16/+20
| | | | | | | | Add a lookup_command() method to the SerialReader class that provides a wrapper that stores the serial and commandqueue references. This makes it easier to run the send() method. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Introduce load_config_prefix() for modules that take parametersKevin O'Connor2018-02-031-2/+0
| | | | | | | | Use both load_config() and load_config_prefix() functions when dynamically loading a module from the extras directory - if the config section name has parameters in it then use load_config_prefix(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* fan: Clarify hardware_pwm and allow cycle_time to be set on software pwmKevin O'Connor2018-01-291-5/+7
| | | | | | | | Specify hardware pwm cycle times using the same method as software pwm (in seconds, not clock ticks). Allow the fan code to be configured with an explicit cycle time even when using software pwm. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* replicape: Move the replicape code from chipmisc.py to extras directoryKevin O'Connor2018-01-281-0/+221
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>