mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-08-06 13:34:06 -06:00
tmc2130: Verify SPI register writes
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>
This commit is contained in:
parent
3ea2e4fc58
commit
7dd2bf4af3
4 changed files with 41 additions and 11 deletions
|
@ -92,8 +92,14 @@ class MCU_SPI:
|
|||
return
|
||||
self.spi_send_cmd.send([self.oid, data],
|
||||
minclock=minclock, reqclock=reqclock)
|
||||
def spi_transfer(self, data):
|
||||
return self.spi_transfer_cmd.send([self.oid, data])
|
||||
def spi_transfer(self, data, minclock=0, reqclock=0):
|
||||
return self.spi_transfer_cmd.send([self.oid, data],
|
||||
minclock=minclock, reqclock=reqclock)
|
||||
def spi_transfer_with_preface(self, preface_data, data,
|
||||
minclock=0, reqclock=0):
|
||||
return self.spi_transfer_cmd.send_with_preface(
|
||||
self.spi_send_cmd, [self.oid, preface_data], [self.oid, data],
|
||||
minclock=minclock, reqclock=reqclock)
|
||||
|
||||
# Helper to setup an spi bus from settings in a config section
|
||||
def MCU_SPI_from_config(config, mode, pin_option="cs_pin",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue