You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/programming_guide/03_i2c_spi.rst
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -169,6 +169,7 @@ Now we're almost ready to read data from the sensor. However just like with I2C
169
169
bytearray(b'\x01\xa8\x1a\xf0')
170
170
171
171
Before digging into the results let's break down what just happened:
172
+
172
173
- The with statement uses a context manager to automatically lock the SPI bus. You don't need to worry about locking and unlocking the bus by using the with statement, but again be sure to indent all the code that runs while the SPI bus is locked.
173
174
- The :py:func:`busio.SPI.configure` function is called to configure the speed, phase, and polarity of the SPI bus. It's important to always call configure before talking to your device as communication with other devices might have changed the speed, polarity, etc. You'll need to look up the exact speed and other values from your device's datasheet. For the MAX31855 we'll use a speed of 5mhz and a polarity and phase of 0 (sometimes called mode 0).
174
175
- Next we toggle the CS line down to a low logic level. Remember with SPI each device needs a chip select line to tell it when it's ready to send and receive data.
0 commit comments