3-Wire SPI Open Drain?
Posted: Wed Oct 11, 2017 1:01 am
Can you configure SPI pins to be Open Drain? It seems to disconnect SPI from the GPIO matrix if I use the GPIO direction function:
Code: Select all
#define DATA 23
#define SCLK 19
#define CS 22
spi_bus_config_t buscfg=
{
.mosi_io_num=DATA,
.miso_io_num=-1,
.sclk_io_num=SCLK,
.quadwp_io_num=-1,
.quadhd_io_num=-1
};
spi_device_interface_config_t devcfg=
{
.clock_speed_hz=1*1000*1000,
.mode=0,
.spics_io_num=CS,
.queue_size=7,
.flags=SPI_DEVICE_3WIRE | SPI_DEVICE_HALFDUPLEX,
};
spi_bus_initialize(HSPI_HOST, &buscfg, 1);
spi_bus_add_device(HSPI_HOST, &devcfg, &spi);
gpio_set_direction(DATA, GPIO_MODE_INPUT_OUTPUT_OD);