esp32/machine_hw_spi: Use default pins when making SPI if none given.

The default pins can be optionally configured by a board.

Fixes issue #6974.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2021-03-11 13:32:00 +11:00
parent a62e791978
commit b24fcd7aec
2 changed files with 33 additions and 3 deletions

View File

@@ -302,6 +302,7 @@ has the same methods as software SPI above::
from machine import Pin, SPI
hspi = SPI(1, 10000000)
hspi = SPI(1, 10000000, sck=Pin(14), mosi=Pin(13), miso=Pin(12))
vspi = SPI(2, baudrate=80000000, polarity=0, phase=0, bits=8, firstbit=0, sck=Pin(18), mosi=Pin(23), miso=Pin(19))