3-Wire-SPI on ESP32-WROOM-32UE
Posted: Fri Oct 13, 2023 10:43 am
How to perform 3-Wire-SPI communication on ESP32-WROOM-32UE ? We're using AD7091R sensor.
Code: Select all
// spi_bus_config_t
buscfg.sclk_io_num = PIN_NUM_CLK; // GPIO pin for Spi CLocK signal, or -1 if not used.
buscfg.mosi_io_num = -1; // GPIO pin for Master Out Slave In (=spi_d) signal, or -1 if not used.
buscfg.miso_io_num = PIN_NUM_MISO; // GPIO pin for Master In Slave Out (=spi_q) signal, or -1 if not used.O
buscfg.quadwp_io_num = -1; // GPIO pin for WP (Write Protect) signal which is used as D2 in 4-bit
communication modes, or -1 if not used.
buscfg.quadhd_io_num = -1; // GPIO pin for HD (HolD) signal which is used as D3 in 4-bit communication
modes, or -1 if not used.
buscfg.max_transfer_sz = 0; // Maximum transfer size, in bytes. Defaults to 4094 if 0.
ESP_ERROR_CHECK(spi_bus_initialize(HSPI_HOST, &buscfg, 1));