This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit c7702894fe85cf99505d792ffa15bd7f16964701
Author: Eren Terzioglu <eren.terzio...@espressif.com>
AuthorDate: Wed Feb 26 09:16:52 2025 +0100

    documentation/esp32[s2|s3]: Add I2C slave support
    
    Add I2C Slave support into docs for xtensa based Espressif devices
    
    Signed-off-by: Eren Terzioglu <eren.terzio...@espressif.com>
---
 Documentation/platforms/xtensa/esp32/index.rst         |  2 +-
 .../xtensa/esp32s2/boards/esp32s2-kaluga-1/index.rst   | 17 +++++++++++++++++
 .../xtensa/esp32s2/boards/esp32s2-saola-1/index.rst    | 17 +++++++++++++++++
 Documentation/platforms/xtensa/esp32s2/index.rst       |  2 +-
 .../xtensa/esp32s3/boards/esp32s3-devkit/index.rst     | 18 ++++++++++++++++++
 Documentation/platforms/xtensa/esp32s3/index.rst       |  2 +-
 6 files changed, 55 insertions(+), 3 deletions(-)

diff --git a/Documentation/platforms/xtensa/esp32/index.rst 
b/Documentation/platforms/xtensa/esp32/index.rst
index fb4e9020e8..523c1967d2 100644
--- a/Documentation/platforms/xtensa/esp32/index.rst
+++ b/Documentation/platforms/xtensa/esp32/index.rst
@@ -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
diff --git 
a/Documentation/platforms/xtensa/esp32s2/boards/esp32s2-kaluga-1/index.rst 
b/Documentation/platforms/xtensa/esp32s2/boards/esp32s2-kaluga-1/index.rst
index 5e1abc2d5f..a475a0ba7c 100644
--- a/Documentation/platforms/xtensa/esp32s2/boards/esp32s2-kaluga-1/index.rst
+++ b/Documentation/platforms/xtensa/esp32s2/boards/esp32s2-kaluga-1/index.rst
@@ -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
 ------------
 
diff --git 
a/Documentation/platforms/xtensa/esp32s2/boards/esp32s2-saola-1/index.rst 
b/Documentation/platforms/xtensa/esp32s2/boards/esp32s2-saola-1/index.rst
index edebe5a882..2929fc3e32 100644
--- a/Documentation/platforms/xtensa/esp32s2/boards/esp32s2-saola-1/index.rst
+++ b/Documentation/platforms/xtensa/esp32s2/boards/esp32s2-saola-1/index.rst
@@ -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
 -------
 
diff --git a/Documentation/platforms/xtensa/esp32s2/index.rst 
b/Documentation/platforms/xtensa/esp32s2/index.rst
index 2745550d15..3c07f03938 100644
--- a/Documentation/platforms/xtensa/esp32s2/index.rst
+++ b/Documentation/platforms/xtensa/esp32s2/index.rst
@@ -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
diff --git 
a/Documentation/platforms/xtensa/esp32s3/boards/esp32s3-devkit/index.rst 
b/Documentation/platforms/xtensa/esp32s3/boards/esp32s3-devkit/index.rst
index a26d244dd2..a0e3c6080d 100644
--- a/Documentation/platforms/xtensa/esp32s3/boards/esp32s3-devkit/index.rst
+++ b/Documentation/platforms/xtensa/esp32s3/boards/esp32s3-devkit/index.rst
@@ -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
 ----
 
diff --git a/Documentation/platforms/xtensa/esp32s3/index.rst 
b/Documentation/platforms/xtensa/esp32s3/index.rst
index 605e1d9afa..cc79ddf215 100644
--- a/Documentation/platforms/xtensa/esp32s3/index.rst
+++ b/Documentation/platforms/xtensa/esp32s3/index.rst
@@ -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

Reply via email to