@@ -57,36 +57,36 @@ ESP32-ALL
5757 They exactly what they seem. It is easier to show a code example then it is to explain it.
5858
5959
60- from machine import SPI
61-
62- spi_bus = SPI.Bus(
63- host=1,
64- mosi=15,
65- miso=16,
66- sck=10
67- )
68-
69- spi_device = SPI.Device(
70- spi_bus=spi_bus,
71- freq=10000000,
72- cs=3,
73- polarity=0,
74- phase=0,
75- bits=8,
76- first_bit=SPI.MSB
77- )
78-
79- #if you want to delete a device from being used you have to deinit it first
80- #and then you can delete it
81- spi_device.deinit()
82- del spi_device
83-
84- #if you want to stop using a bus and all devices attached to it
85- del spi_bus
86- del spi_device
87-
88- #The SPI.Bus instance you need to pass to machine.SDCard, lcd_bus.SPIBus
89- #and any of the touch drivers that use SPI.
60+ from machine import SPI
61+
62+ spi_bus = SPI.Bus(
63+ host=1,
64+ mosi=15,
65+ miso=16,
66+ sck=10
67+ )
68+
69+ spi_device = SPI.Device(
70+ spi_bus=spi_bus,
71+ freq=10000000,
72+ cs=3,
73+ polarity=0,
74+ phase=0,
75+ bits=8,
76+ first_bit=SPI.MSB
77+ )
78+
79+ # if you want to delete a device from being used you have to deinit it first
80+ # and then you can delete it
81+ spi_device.deinit()
82+ del spi_device
83+
84+ # if you want to stop using a bus and all devices attached to it
85+ del spi_bus
86+ del spi_device
87+
88+ # The SPI.Bus instance you need to pass to machine.SDCard, lcd_bus.SPIBus
89+ # and any of the touch drivers that use SPI.
9090
9191
9292All methods that existed for the original` machine.SPI ` are available in