Skip to content

Commit 7a40f6b

Browse files
brentrubrentru
brentru
authored and
brentru
committed
add test code to allow debugging over UART
1 parent c32ac22 commit 7a40f6b

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

examples/esp32spi_cert.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import board
2+
import busio
3+
from digitalio import DigitalInOut
4+
import adafruit_esp32spi.adafruit_esp32spi_socket as socket
5+
from adafruit_esp32spi import adafruit_esp32spi
6+
import adafruit_requests as requests
7+
8+
print("ESP32 SPI- User-provided SSL Certificate Test")
9+
10+
# If you are using a board with pre-defined ESP32 Pins:
11+
esp32_cs = DigitalInOut(board.ESP_CS)
12+
esp32_ready = DigitalInOut(board.ESP_BUSY)
13+
esp32_reset = DigitalInOut(board.ESP_RESET)
14+
15+
# If you have an externally connected ESP32:
16+
# esp32_cs = DigitalInOut(board.D9)
17+
# esp32_ready = DigitalInOut(board.D10)
18+
# esp32_reset = DigitalInOut(board.D5)
19+
20+
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
21+
esp = adafruit_esp32spi.ESP_SPIcontrol(spi, esp32_cs, esp32_ready, esp32_reset)
22+
23+
# Allow debugging
24+
esp.set_esp_debug(True)

0 commit comments

Comments
 (0)