Skip to content

Commit 8d9a85c

Browse files
committed
Correct mistake in SPI API documentation example
Correct a small mistake in the SPI API documentation. Make the set_direction call clearer to readers by adding the parameter names to the function call, and using binary so it is clear the bits correspond to the pin position.
1 parent 16398f3 commit 8d9a85c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pyftdi/doc/api/spi.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ Example: communication with a SPI device and an extra GPIO
5858
# Get a SPI port to a SPI slave w/ /CS on A*BUS3 and SPI mode 0 @ 12MHz
5959
slave = spi.get_port(cs=0, freq=12E6, mode=0)
6060
61-
# Get GPIO port to manage extra pins, use A*BUS4 as GPO, A*BUS4 as GPI
61+
# Get GPIO port to manage extra pins, use A*BUS4 as GPO, A*BUS5 as GPI
6262
gpio = spi.get_gpio()
63-
gpio.set_direction(0x30, 0x10)
63+
gpio.set_direction(pins=0b0011_0000, direction=0b0001_0000)
6464
6565
# Assert GPO pin
6666
gpio.write(0x10)

0 commit comments

Comments
 (0)