I want to make a small timing critical I2C-slave which basically only returns one or two bytes depending on the state of the ESP32 and I can't get it to work with the slave example provided.
What I basically need is an interrupt for each new byte (or full transaction) that comes in and the possibility in the interrupt handler to send a byte back.
* Is there any documentation on how to use the I2C hardware directly?
* Is there anyone using the slave mode that can share some alternative code?
* Any pointers to usefull code are welcome
Low-level I2C slave
-
- Posts: 9761
- Joined: Thu Nov 26, 2015 4:08 am
Re: Low-level I2C slave
FWIW, all hardware documentation on the ESP32 (except for the peripherals we haven't come around to documenting yet) is in the Technical Reference Manual: https://espressif.com/en/content/esp32- ... nce-manual . You can also find the I2S hardware description there if you want to make your own driver.
Re: Low-level I2C slave
Thanks but the documentation doesn't say much about slave mode. Would be good with an example snippet of code
Re: Low-level I2C slave
I'm still struggling with getting an i2c-slave running. A real help to me would be to add interrupts to the current i2c example taking actions when data is available in the buffers. Is this something that could be put on the To-do list?
Re: Low-level I2C slave
Hi all,
I run a I2C in slave mode and I have a problem with the i2c_slave_read_buffer function. I can receive data without any problem if I set the function parameter max_size exactly to the number of bytes received. If I set it to a higher value, the function stucks even if an ACK plus STOP was received. It is not nice if I need to know the exact number of data received of each command. Do you have similar experience?
In ESP-IDF-v2.1 it says that this issue is fixed now, but it is not.
thanks for any help.
I run a I2C in slave mode and I have a problem with the i2c_slave_read_buffer function. I can receive data without any problem if I set the function parameter max_size exactly to the number of bytes received. If I set it to a higher value, the function stucks even if an ACK plus STOP was received. It is not nice if I need to know the exact number of data received of each command. Do you have similar experience?
In ESP-IDF-v2.1 it says that this issue is fixed now, but it is not.
thanks for any help.
Who is online
Users browsing this forum: Baidu [Spider] and 115 guests