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 7658c39304f76a2c73d121da38b8c643676510a5 Author: Eren Terzioglu <eren.terzio...@espressif.com> AuthorDate: Wed Feb 26 09:32:38 2025 +0100 documentation/esp32[c3|c6|h2]: Add I2C slave support Add I2C slave support into docs for risc-v based Espressif devices Signed-off-by: Eren Terzioglu <eren.terzio...@espressif.com> --- .../risc-v/esp32c3/boards/esp32c3-generic/index.rst | 17 +++++++++++++++++ Documentation/platforms/risc-v/esp32c3/index.rst | 2 +- .../risc-v/esp32c6/boards/esp32c6-devkitc/index.rst | 17 +++++++++++++++++ .../risc-v/esp32c6/boards/esp32c6-devkitm/index.rst | 17 +++++++++++++++++ Documentation/platforms/risc-v/esp32c6/index.rst | 10 +++++----- .../risc-v/esp32h2/boards/esp32h2-devkit/index.rst | 17 +++++++++++++++++ Documentation/platforms/risc-v/esp32h2/index.rst | 10 +++++----- 7 files changed, 79 insertions(+), 11 deletions(-) diff --git a/Documentation/platforms/risc-v/esp32c3/boards/esp32c3-generic/index.rst b/Documentation/platforms/risc-v/esp32c3/boards/esp32c3-generic/index.rst index 795f40e5df..83361c0416 100644 --- a/Documentation/platforms/risc-v/esp32c3/boards/esp32c3-generic/index.rst +++ b/Documentation/platforms/risc-v/esp32c3/boards/esp32c3-generic/index.rst @@ -208,6 +208,23 @@ You can scan for all I2C devices using the following command:: nsh> i2c dev 0x00 0x7f +To use slave mode, you can enable `ESPRESSIF_I2C0_SLAVE_MODE` 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/risc-v/esp32c3/index.rst b/Documentation/platforms/risc-v/esp32c3/index.rst index 59efb8cb03..b838985c8b 100644 --- a/Documentation/platforms/risc-v/esp32c3/index.rst +++ b/Documentation/platforms/risc-v/esp32c3/index.rst @@ -293,7 +293,7 @@ CDC Console Yes Rev.3 DMA Yes eFuse Yes Also virtual mode supported GPIO Yes -I2C Yes +I2C Yes Master and Slave mode supported LED_PWM Yes RNG No RSA No diff --git a/Documentation/platforms/risc-v/esp32c6/boards/esp32c6-devkitc/index.rst b/Documentation/platforms/risc-v/esp32c6/boards/esp32c6-devkitc/index.rst index d5be28f55f..6b01c4238c 100644 --- a/Documentation/platforms/risc-v/esp32c6/boards/esp32c6-devkitc/index.rst +++ b/Documentation/platforms/risc-v/esp32c6/boards/esp32c6-devkitc/index.rst @@ -191,6 +191,23 @@ You can scan for all I2C devices using the following command:: nsh> i2c dev 0x00 0x7f +To use slave mode, you can enable `ESPRESSIF_I2C0_SLAVE_MODE` 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/risc-v/esp32c6/boards/esp32c6-devkitm/index.rst b/Documentation/platforms/risc-v/esp32c6/boards/esp32c6-devkitm/index.rst index 99997f0efe..fd81264a27 100644 --- a/Documentation/platforms/risc-v/esp32c6/boards/esp32c6-devkitm/index.rst +++ b/Documentation/platforms/risc-v/esp32c6/boards/esp32c6-devkitm/index.rst @@ -175,6 +175,23 @@ You can scan for all I2C devices using the following command:: nsh> i2c dev 0x00 0x7f +To use slave mode, you can enable `ESPRESSIF_I2C0_SLAVE_MODE` 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/risc-v/esp32c6/index.rst b/Documentation/platforms/risc-v/esp32c6/index.rst index b5b9a434bb..4e4ae11021 100644 --- a/Documentation/platforms/risc-v/esp32c6/index.rst +++ b/Documentation/platforms/risc-v/esp32c6/index.rst @@ -269,9 +269,9 @@ Peripheral Support The following list indicates the state of peripherals' support in NuttX: -============== ======= -Peripheral Support -============== ======= +============== ======= ==================== +Peripheral Support NOTES +============== ======= ==================== ADC No AES No Bluetooth No @@ -281,7 +281,7 @@ ECC No eFuse Yes GPIO Yes HMAC No -I2C Yes +I2C Yes Master and Slave mode supported I2S Yes Int. Temp. Yes LED No @@ -302,7 +302,7 @@ UART Yes Watchdog Yes Wifi Yes XTS No -============== ======= +============== ======= ==================== Supported Boards ================ diff --git a/Documentation/platforms/risc-v/esp32h2/boards/esp32h2-devkit/index.rst b/Documentation/platforms/risc-v/esp32h2/boards/esp32h2-devkit/index.rst index c1a378e57e..2b2c2125eb 100644 --- a/Documentation/platforms/risc-v/esp32h2/boards/esp32h2-devkit/index.rst +++ b/Documentation/platforms/risc-v/esp32h2/boards/esp32h2-devkit/index.rst @@ -174,6 +174,23 @@ You can scan for all I2C devices using the following command:: nsh> i2c dev 0x00 0x7f +To use slave mode, you can enable `ESPRESSIF_I2C0_SLAVE_MODE` 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/risc-v/esp32h2/index.rst b/Documentation/platforms/risc-v/esp32h2/index.rst index 7e46177a24..f66c47b5e6 100644 --- a/Documentation/platforms/risc-v/esp32h2/index.rst +++ b/Documentation/platforms/risc-v/esp32h2/index.rst @@ -269,9 +269,9 @@ Peripheral Support The following list indicates the state of peripherals' support in NuttX: -============== ======= -Peripheral Support -============== ======= +============== ======= ==================== +Peripheral Support NOTES +============== ======= ==================== ADC No AES No Bluetooth No @@ -281,7 +281,7 @@ ECC No eFuse Yes GPIO Yes HMAC No -I2C Yes +I2C Yes Master and Slave mode supported I2S Yes Int. Temp. Yes LED No @@ -302,7 +302,7 @@ UART Yes Watchdog Yes Wifi No XTS No -============== ======= +============== ======= ==================== Supported Boards ================