mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
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.terzioglu@espressif.com>
This commit is contained in:
committed by
Mateusz Szafoni
parent
d471609267
commit
e9eaafd154
@@ -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
|
||||
---
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
---
|
||||
|
||||
|
||||
@@ -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
|
||||
---
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
---
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user