3-Wire SPI Open Drain?

DrSegatron
Posts: 22
Joined: Tue Oct 10, 2017 2:46 pm

3-Wire SPI Open Drain?

Postby DrSegatron » 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);

Who is online

Users browsing this forum: Bing [Bot], FX2032 and 127 guests