aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/bus.py
Commit message (Collapse)AuthorAgeFilesLines
* i2c_software: Implementation of software i2c (#6141)BIGTREETECH2023-06-071-7/+29
| | | Signed-off-by: Alan.Ma from BigTreeTech <tech@biqu3d.com>
* spicmds: Allow inversion of CS pin for SPI bussesMartin Hierholzer2022-04-221-4/+7
| | | | | Signed-off-by: Martin Hierholzer <martin@hierholzer.info> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc2130: Verify SPI register writesKevin O'Connor2021-03-101-2/+8
| | | | | | | | The tmc2130 (and tmc5160) will respond back with the value written during the next SPI command. Use this feature to verify that the value written matches the value sent. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc2130: Add spi daisy chain supportMarco D'Alessio2021-02-261-2/+2
| | | | | | | | This patch adds the ability to daisy-chain multiple tmc2130 and tmc5160 drivers. Signed-off-by: Marco D'Alessio <marco@wrecklab.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Introduce new lookup_query_command() command wrapperKevin O'Connor2020-02-201-8/+10
| | | | | | | Use new mcu.lookup_query_command() for all commands that query information from the micro-controller. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pins: Move reserved pin handling into PinResolver classKevin O'Connor2019-08-191-1/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bus: Add MCU_bus_digital_out helper classKevin O'Connor2019-08-171-0/+41
| | | | | | | Add a helper class for tracking gpio outputs that are synchronized to bus updates on a particular command queue. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* spicmds: Rework spi config commandsKevin O'Connor2019-08-061-32/+26
| | | | | | | | | | 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>
* bus: Don't reserve any pins if BUS_PINS_x is not definedKevin O'Connor2019-04-071-3/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bus: Support bus enumerations and add support for reserved pinsKevin O'Connor2019-04-041-19/+51
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bus: Change bus parameter in config_spi/config_i2cKevin O'Connor2019-04-041-3/+3
| | | | | | Be explicit when using an spi_bus vs i2c_bus in the parameter name. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* spi_software: Implementation of software spiKevin O'Connor2019-02-131-12/+37
| | | | | Signed-off-by: Matt Janus <FragginRight@variabl.es> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* i2ccmds: Pass the i2c address as a 7-bit number (0-127)Kevin O'Connor2019-01-071-4/+8
| | | | | | | | | | | | | | | | The sam3 i2c code and the linux code use a 7-bit i2c address, while the avr, lpc176x, and samd21 i2c code uses an 8-bit address with the least significant bit always zero. A similar issue occurred in the host code (sx1509.py and replicape.py use 7-bit addresses while uc1701.py and mcp4451.py use 8-bit addresses). Consistently use 7-bit addresses in all the code. This breaks compatibility between host and mcu software, so make a change to the config_i2c command to force users to synchronize software updates. This also breaks common Smoothieboard configs, so update the mcp4451 code to validate the i2c_address. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bus: Set all SPI CS pins high before first config_spi messageKevin O'Connor2019-01-041-2/+5
| | | | | | | | | If an SPI device is shared among many devices, then all the device's CS pins should be set high prior to setting up the clk pin. (Otherwise, there's a chance a device could interpret the clk pin setup as part of a transmission.) 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/+1
| | | | | | | 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>
* uc1701: Add support for SSD1306 in i2c modeKevin O'Connor2018-11-231-2/+76
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bus: Add klippy/extras/bus.py module with SPI bus helper codeKevin O'Connor2018-11-211-0/+65
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>