documentation/esp32[s2|s3]: Add I2C slave support
Build Documentation / build-html (push) Waiting to run

Add I2C Slave support into docs for xtensa based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
This commit is contained in:
Eren Terzioglu
2025-02-26 09:16:52 +01:00
committed by Alin Jerpelea
parent 06ef4a8084
commit c7702894fe
6 changed files with 55 additions and 3 deletions
@@ -336,7 +336,7 @@ DAC Yes One-shot
eFuse Yes
Ethernet Yes
GPIO Yes
I2C Yes
I2C Yes Master and Slave mode supported
I2S Yes
LED_PWM Yes
MCPWM Yes
@@ -248,6 +248,23 @@ You can scan for all I2C devices using the following command::
nsh> i2c dev 0x00 0x7f
To use slave mode, you can enable `ESP32S2_I2S_ROLE_SLAVE` option.
To use slave mode driver following snippet demonstrates how write to i2c bus
using slave driver:
.. code-block:: C
#define ESP_I2C_SLAVE_PATH "/dev/i2cslv0"
int main(int argc, char *argv[])
{
int i2c_slave_fd;
int ret;
uint8_t buffer[5] = {0xAA};
i2c_slave_fd = open(ESP_I2C_SLAVE_PATH, O_RDWR);
ret = write(i2c_slave_fd, buffer, 5);
close(i2c_slave_fd);
}
lvgl_ili9341
------------
@@ -209,6 +209,23 @@ You can scan for all I2C devices using the following command::
nsh> i2c dev 0x00 0x7f
To use slave mode, you can enable `ESP32S2_I2S_ROLE_SLAVE` option.
To use slave mode driver following snippet demonstrates how write to i2c bus
using slave driver:
.. code-block:: C
#define ESP_I2C_SLAVE_PATH "/dev/i2cslv0"
int main(int argc, char *argv[])
{
int i2c_slave_fd;
int ret;
uint8_t buffer[5] = {0xAA};
i2c_slave_fd = open(ESP_I2C_SLAVE_PATH, O_RDWR);
ret = write(i2c_slave_fd, buffer, 5);
close(i2c_slave_fd);
}
i2schar
-------
@@ -323,7 +323,7 @@ DMA Yes
eFuse No
Ethernet No
GPIO Yes
I2C Yes
I2C Yes Master and Slave mode supported
I2S Yes
LED_PWM No
Pulse_CNT Yes
@@ -242,6 +242,24 @@ You can scan for all I2C devices using the following command::
nsh> i2c dev 0x00 0x7f
To use slave mode, you can enable `ESP32S3_I2S0_ROLE_SLAVE` or
`ESP32S3_I2S1_ROLE_SLAVE` option.
To use slave mode driver following snippet demonstrates how write to i2c bus
using slave driver:
.. code-block:: C
#define ESP_I2C_SLAVE_PATH "/dev/i2cslv0"
int main(int argc, char *argv[])
{
int i2c_slave_fd;
int ret;
uint8_t buffer[5] = {0xAA};
i2c_slave_fd = open(ESP_I2C_SLAVE_PATH, O_RDWR);
ret = write(i2c_slave_fd, buffer, 5);
close(i2c_slave_fd);
}
knsh
----
@@ -356,7 +356,7 @@ CAN/TWAI Yes
DMA Yes
eFuse No
GPIO Yes
I2C No
I2C Yes Master and Slave mode supported
I2S Yes
LCD No
LED_PWM No