From b42d5603767c63f88c92613b7e412077bcff8a95 Mon Sep 17 00:00:00 2001 From: eir Date: Sun, 22 Mar 2020 07:06:19 -0700 Subject: [PATCH] refactor(spin_device): cleanup --- stspin/spin_device.py | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/stspin/spin_device.py b/stspin/spin_device.py index bcf0914..aed2cbc 100644 --- a/stspin/spin_device.py +++ b/stspin/spin_device.py @@ -18,22 +18,6 @@ toInt, ) - -class SpiStub: - """Type definition for Spi class - """ - def xfer2(self, data: List[int]) -> List[int]: - """spidev.xfer2: - 1. Toggles Chip Select - 2. transfers list of bytes - 3. Toggles Chip Select (to latch data) - - :data: List of bytes to write - :return: List of bytes from MISO pin - """ - pass - - class SpinDevice: """Class providing access to a single SPIN device""" @@ -44,7 +28,6 @@ def __init__( ): """ :position: Position in chain, where 0 is the last device in chain - if different from hardware SPI CS pin :total_devices: Total number of devices in chain :spi: SPI object used for serial communication """ @@ -63,7 +46,7 @@ def _write(self, data: int) -> int: assert data >= 0 assert data <= 0xFF - buffer = [0] * self._total_devices + buffer = [Command.Nop] * self._total_devices buffer[self._position] = data response = self._spi_transfer(buffer)