Commit Graph

6 Commits

Author SHA1 Message Date
Kevin O'Connor 98ed462865 spi_software: Implementation of software spi
Signed-off-by: Matt Janus <FragginRight@variabl.es>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-13 11:52:20 -05:00
Kevin O'Connor e26d1a3567 i2ccmds: Pass the i2c address as a 7-bit number (0-127)
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>
2019-01-07 20:00:44 -05:00
Kevin O'Connor c3efcd9c8d bus: Set all SPI CS pins high before first config_spi message
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>
2019-01-04 22:26:34 -05:00
Kevin O'Connor 1be24b8fc7 bus: Don't raise a "duplicate pin" warning on None pins
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>
2019-01-02 17:37:39 -05:00
Kevin O'Connor e5150fe187 uc1701: Add support for SSD1306 in i2c mode
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-23 22:04:06 -05:00
Kevin O'Connor 58890e32a2 bus: Add klippy/extras/bus.py module with SPI bus helper code
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00