Adafruit CircuitPython 7.3.3 on 2022-08-29; Adafruit Feather ESP32-S2 TFT with ESP32S2
Board ID:adafruit_feather_esp32s2_tft
Running the code or any similar that uses busio.SPI results in
In line 5
"ValueError: SCK in use"
Code: Select all
import busio
import digitalio
from board import *
from adafruit_bus_device.spi_device import SPIDevice
with busio.SPI(SCK, MOSI, MISO) as spi_bus:
cs = digitalio.DigitalInOut(D10)
device = SPIDevice(spi_bus, cs)
bytes_read = bytearray(4)
# The object assigned to spi in the with statements below
# is the original spi_bus object. We are using the busio.SPI
# operations busio.SPI.readinto() and busio.SPI.write().
with device as spi:
spi.readinto(bytes_read)
# A second transaction
with device as spi:
spi.write(bytes_read)