Skip to content

Commit

Permalink
refactor(spin_device): cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
m-laniakea committed Mar 22, 2020
1 parent 2968073 commit b42d560
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions stspin/spin_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""

Expand All @@ -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
"""
Expand All @@ -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)
Expand Down

0 comments on commit b42d560

Please sign in to comment.