11static const char*
TAG =
"SpiBus";
40 spi_bus_config_t buscfg = {};
44 buscfg.quadwp_io_num = -1;
45 buscfg.quadhd_io_num = -1;
46 buscfg.max_transfer_sz = 4096;
47 buscfg.flags = SPICOMMON_BUSFLAG_MASTER;
50 if (err != ESP_OK && err != ESP_ERR_INVALID_STATE) {
51 LOG_E(
TAG,
"SPI bus init failed: %d", err);
55 if (err == ESP_ERR_INVALID_STATE) {
57 LOG_I(
TAG,
"SPI bus already initialized (by display)");
59 LOG_I(
TAG,
"SPI bus initialized (MOSI=%d, MISO=%d, CLK=%d)",
CDC Log: logging over TinyUSB CDC and UART.
#define LOG_I(tag, fmt,...)
#define LOG_E(tag, fmt,...)
static std::atomic< bool > g_spiInitialized
static constexpr uint32_t SPI_DMA_CHAN
esp_err_t initSharedSpiBus()
Initializes shared SPI bus once for all SPI peripherals.
static constexpr spi_host_device_t SPI_BUS_HOST
Shared SPI host selection for ESP32-S3 user peripherals.
spi_host_device_t getSharedSpiHost()
Returns shared SPI host identifier.