Skip to content

Commit 46063b4

Browse files
authored
Merge pull request #14 from dhalbert/spi_doc_error
fix doc bug and add a little extra
2 parents be325b9 + 0863c30 commit 46063b4

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ bundle <bundle_installation>`.
3030
To install:
3131

3232
#. Download and unzip the `latest release zip <https://github.com/adafruit/Adafruit_CircuitPython_BusDevice/releases>`_.
33-
#. Copy the unzipped ``adafruit_bus_device`` to the ``lib`` directory on the ``CIRCUITPY`` or ``MICROPYTHON`` drive.
33+
#. Copy the unzipped ``adafruit_bus_device`` to the ``lib`` directory on the ``CIRCUITPY`` drive.
3434

3535
API
3636
---

adafruit_bus_device/spi_device.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,11 @@ class SPIDevice:
4545
cs = digitalio.DigitalInOut(D10)
4646
device = SPIDevice(spi_bus, cs)
4747
bytes_read = bytearray(4)
48+
# The object assigned to spi in the with statements below
49+
# is the original spi_bus object. We are using the busio.SPI
50+
# operations busio.SPI.readinto() and busio.SPI.write().
4851
with device as spi:
49-
spi_device.readinto(bytes_read)
52+
spi.readinto(bytes_read)
5053
# A second transaction
5154
with device as spi:
5255
spi.write(bytes_read)

0 commit comments

Comments
 (0)