diff --git a/README.rst b/README.rst index 94c0e0e..109a68e 100644 --- a/README.rst +++ b/README.rst @@ -30,7 +30,7 @@ bundle `. To install: #. Download and unzip the `latest release zip `_. -#. Copy the unzipped ``adafruit_bus_device`` to the ``lib`` directory on the ``CIRCUITPY`` or ``MICROPYTHON`` drive. +#. Copy the unzipped ``adafruit_bus_device`` to the ``lib`` directory on the ``CIRCUITPY`` drive. API --- diff --git a/adafruit_bus_device/spi_device.py b/adafruit_bus_device/spi_device.py index 57b5441..d1dd0bd 100644 --- a/adafruit_bus_device/spi_device.py +++ b/adafruit_bus_device/spi_device.py @@ -45,8 +45,11 @@ class SPIDevice: cs = digitalio.DigitalInOut(D10) device = SPIDevice(spi_bus, cs) bytes_read = bytearray(4) + # The object assigned to spi in the with statements below + # is the original spi_bus object. We are using the busio.SPI + # operations busio.SPI.readinto() and busio.SPI.write(). with device as spi: - spi_device.readinto(bytes_read) + spi.readinto(bytes_read) # A second transaction with device as spi: spi.write(bytes_read)