Use ESP32 to access A7108, a 433M transceiver, which requires 3-line SPI interface, through spec, the data pin is bi-direction,
I configured GPIO21 as GPIO_MODE_INPUT_OUTPUT mode:
#define GPIO_DATA 21
#define GPIO_IO_PIN_SEL (((uint64_t)1)<<GPIO_DATA)
...
io_conf.pin_bit_mask = GPIO_IO_PIN_SEL;
//set as input&output mode
io_conf.mode = GPIO_MODE_INPUT_OUTPUT;
//disable pull-down mode, external pull up
io_conf.pull_down_en = 0;
//enable pull-up mode
io_conf.pull_up_en = 0;
gpio_config(&io_conf);
but the value read by gpio_get_level is the last value set by gpio_set_level, not the register value. Not sure if esp32 really support bi-direction IO access.
does esp32 support bi-direction gpio?
- iot-bits.com
- Posts: 25
- Joined: Wed Dec 21, 2016 6:14 am
- Location: India
- Contact:
Re: does esp32 support bi-direction gpio?
Setting SPI_SIO bit in SPI_USER_REG will enable pin sharing where MISO and MOSI will use the same physical pin for half-duplex communication. So yes, there is hardware support for that. ESP8266 had it too.
When you attach SPI peripheral to a GPIO pad, what do you get?
When you attach SPI peripheral to a GPIO pad, what do you get?
- Pratik
Just another hobbyist and consultant
Just another hobbyist and consultant
Who is online
Users browsing this forum: No registered users and 79 guests