This is an automated email from the ASF dual-hosted git repository. raiden00 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit e9eaafd15499f664bdfcc184b4d8183d4f563267 Author: Eren Terzioglu <eren.terzio...@espressif.com> AuthorDate: Wed Apr 9 11:07:48 2025 +0200 Documentation/risc-v: Add dedicated GPIO documentation for esp32[-c3|-c6|-h2] Add dedicated GPIO documentation for risc-v based Espressif chips Signed-off-by: Eren Terzioglu <eren.terzio...@espressif.com> --- .../esp32c3/boards/esp32c3-generic/index.rst | 35 ++++++++++++++++++++++ Documentation/platforms/risc-v/esp32c3/index.rst | 2 +- .../esp32c6/boards/esp32c6-devkitc/index.rst | 35 ++++++++++++++++++++++ .../esp32c6/boards/esp32c6-devkitm/index.rst | 35 ++++++++++++++++++++++ Documentation/platforms/risc-v/esp32c6/index.rst | 2 +- .../risc-v/esp32h2/boards/esp32h2-devkit/index.rst | 35 ++++++++++++++++++++++ Documentation/platforms/risc-v/esp32h2/index.rst | 2 +- 7 files changed, 143 insertions(+), 3 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 24a40e5e40..d5fa696ac5 100644 --- a/Documentation/platforms/risc-v/esp32c3/boards/esp32c3-generic/index.rst +++ b/Documentation/platforms/risc-v/esp32c3/boards/esp32c3-generic/index.rst @@ -221,6 +221,41 @@ We can use the interrupt pin to send a signal when the interrupt fires:: The pin is configured as a rising edge interrupt, so after issuing the above command, connect it to 3.3V. +To use dedicated gpio for controlling multiple gpio pin at the same time +or having better response time, you need to enable +`CONFIG_ESPRESSIF_DEDICATED_GPIO` option. Dedicated GPIO is suitable +for faster response times required applications like simulate serial/parallel +interfaces in a bit-banging way. +After this option enabled GPIO4 and GPIO5 pins are ready to used as dedicated GPIO pins +as input/output mode. These pins are for example, you can use any pin up to 8 pins for +input and 8 pins for output for dedicated gpio. +To write and read data from dedicated gpio, you need to use +`write` and `read` calls. + +The following snippet demonstrates how to read/write to dedicated GPIO pins: + +.. code-block:: C + + int fd; = open("/dev/dedic_gpio0", O_RDWR); + int rd_val = 0; + int wr_mask = 0xffff; + int wr_val = 3; + + while(1) + { + write(fd, &wr_val, wr_mask); + if (wr_val == 0) + { + wr_val = 3; + } + else + { + wr_val = 0; + } + read(fd, &rd_val, sizeof(uint32_t)); + printf("rd_val: %d", rd_val); + } + i2c --- diff --git a/Documentation/platforms/risc-v/esp32c3/index.rst b/Documentation/platforms/risc-v/esp32c3/index.rst index 8158b2bfd2..054e78ae94 100644 --- a/Documentation/platforms/risc-v/esp32c3/index.rst +++ b/Documentation/platforms/risc-v/esp32c3/index.rst @@ -356,7 +356,7 @@ CAN/TWAI Yes DMA No DS No eFuse Yes Also virtual mode supported -GPIO Yes +GPIO Yes Dedicated GPIO supported HMAC No I2C Yes Master and Slave mode supported I2S Yes 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 1af2c0cd64..98479fa4fe 100644 --- a/Documentation/platforms/risc-v/esp32c6/boards/esp32c6-devkitc/index.rst +++ b/Documentation/platforms/risc-v/esp32c6/boards/esp32c6-devkitc/index.rst @@ -204,6 +204,41 @@ We can use the interrupt pin to send a signal when the interrupt fires:: The pin is configured as a rising edge interrupt, so after issuing the above command, connect it to 3.3V. +To use dedicated gpio for controlling multiple gpio pin at the same time +or having better response time, you need to enable +`CONFIG_ESPRESSIF_DEDICATED_GPIO` option. Dedicated GPIO is suitable +for faster response times required applications like simulate serial/parallel +interfaces in a bit-banging way. +After this option enabled GPIO4 and GPIO5 pins are ready to used as dedicated GPIO pins +as input/output mode. These pins are for example, you can use any pin up to 8 pins for +input and 8 pins for output for dedicated gpio. +To write and read data from dedicated gpio, you need to use +`write` and `read` calls. + +The following snippet demonstrates how to read/write to dedicated GPIO pins: + +.. code-block:: C + + int fd; = open("/dev/dedic_gpio0", O_RDWR); + int rd_val = 0; + int wr_mask = 0xffff; + int wr_val = 3; + + while(1) + { + write(fd, &wr_val, wr_mask); + if (wr_val == 0) + { + wr_val = 3; + } + else + { + wr_val = 0; + } + read(fd, &rd_val, sizeof(uint32_t)); + printf("rd_val: %d", rd_val); + } + i2c --- 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 fd81264a27..8773d3917e 100644 --- a/Documentation/platforms/risc-v/esp32c6/boards/esp32c6-devkitm/index.rst +++ b/Documentation/platforms/risc-v/esp32c6/boards/esp32c6-devkitm/index.rst @@ -167,6 +167,41 @@ We can use the interrupt pin to send a signal when the interrupt fires:: The pin is configured as a rising edge interrupt, so after issuing the above command, connect it to 3.3V. +To use dedicated gpio for controlling multiple gpio pin at the same time +or having better response time, you need to enable +`CONFIG_ESPRESSIF_DEDICATED_GPIO` option. Dedicated GPIO is suitable +for faster response times required applications like simulate serial/parallel +interfaces in a bit-banging way. +After this option enabled GPIO4 and GPIO5 pins are ready to used as dedicated GPIO pins +as input/output mode. These pins are for example, you can use any pin up to 8 pins for +input and 8 pins for output for dedicated gpio. +To write and read data from dedicated gpio, you need to use +`write` and `read` calls. + +The following snippet demonstrates how to read/write to dedicated GPIO pins: + +.. code-block:: C + + int fd; = open("/dev/dedic_gpio0", O_RDWR); + int rd_val = 0; + int wr_mask = 0xffff; + int wr_val = 3; + + while(1) + { + write(fd, &wr_val, wr_mask); + if (wr_val == 0) + { + wr_val = 3; + } + else + { + wr_val = 0; + } + read(fd, &rd_val, sizeof(uint32_t)); + printf("rd_val: %d", rd_val); + } + i2c --- diff --git a/Documentation/platforms/risc-v/esp32c6/index.rst b/Documentation/platforms/risc-v/esp32c6/index.rst index c72fc77994..44e1ed438b 100644 --- a/Documentation/platforms/risc-v/esp32c6/index.rst +++ b/Documentation/platforms/risc-v/esp32c6/index.rst @@ -344,7 +344,7 @@ CAN/TWAI Yes DMA Yes ECC No eFuse Yes -GPIO Yes +GPIO Yes Dedicated GPIO supported HMAC No I2C Yes Master and Slave mode supported I2S Yes 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 5f9aaae5e2..12910ad40b 100644 --- a/Documentation/platforms/risc-v/esp32h2/boards/esp32h2-devkit/index.rst +++ b/Documentation/platforms/risc-v/esp32h2/boards/esp32h2-devkit/index.rst @@ -187,6 +187,41 @@ We can use the interrupt pin to send a signal when the interrupt fires:: The pin is configured as a rising edge interrupt, so after issuing the above command, connect it to 3.3V. +To use dedicated gpio for controlling multiple gpio pin at the same time +or having better response time, you need to enable +`CONFIG_ESPRESSIF_DEDICATED_GPIO` option. Dedicated GPIO is suitable +for faster response times required applications like simulate serial/parallel +interfaces in a bit-banging way. +After this option enabled GPIO4 and GPIO5 pins are ready to used as dedicated GPIO pins +as input/output mode. These pins are for example, you can use any pin up to 8 pins for +input and 8 pins for output for dedicated gpio. +To write and read data from dedicated gpio, you need to use +`write` and `read` calls. + +The following snippet demonstrates how to read/write to dedicated GPIO pins: + +.. code-block:: C + + int fd; = open("/dev/dedic_gpio0", O_RDWR); + int rd_val = 0; + int wr_mask = 0xffff; + int wr_val = 3; + + while(1) + { + write(fd, &wr_val, wr_mask); + if (wr_val == 0) + { + wr_val = 3; + } + else + { + wr_val = 0; + } + read(fd, &rd_val, sizeof(uint32_t)); + printf("rd_val: %d", rd_val); + } + i2c --- diff --git a/Documentation/platforms/risc-v/esp32h2/index.rst b/Documentation/platforms/risc-v/esp32h2/index.rst index 2e0fba3353..e44a0f7b28 100644 --- a/Documentation/platforms/risc-v/esp32h2/index.rst +++ b/Documentation/platforms/risc-v/esp32h2/index.rst @@ -346,7 +346,7 @@ DMA Yes DS No ECC No eFuse Yes -GPIO Yes +GPIO Yes Dedicated GPIO supported HMAC No I2C Yes Master and Slave mode supported I2S Yes