-
Notifications
You must be signed in to change notification settings - Fork 1.3k
arch/risc-v: Add dedicated GPIO support for esp32[-s2|-s3|-c3|-c6|-h2] #16223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
arch/risc-v: Add dedicated GPIO support for esp32[-s2|-s3|-c3|-c6|-h2] #16223
Conversation
Add bundle ioctl commands to read/write multiple gpios at the same time for some specialized peripherals Signed-off-by: Eren Terzioglu <[email protected]>
Add Dedicated GPIO support for risc-v based Espressif devices Signed-off-by: Eren Terzioglu <[email protected]>
…c6|-h2] Add board level dedicated GPIO support for risc-v based Espressif devices Signed-off-by: Eren Terzioglu <[email protected]>
Add dedicated GPIO support for Xtensa based Espressif devices Signed-off-by: Eren Terzioglu <[email protected]>
Add board level dedicated GPIO support for Xtensa based Espressif devices Signed-off-by: Eren Terzioglu <[email protected]>
…-c6|-h2] Add dedicated GPIO documentation for risc-v based Espressif chips Signed-off-by: Eren Terzioglu <[email protected]>
Add dedicated GPIO documentations for Xtensa based Espressif devices Signed-off-by: Eren Terzioglu <[email protected]>
Update common layer version for esp32s3 to fix warnings when building Signed-off-by: Eren Terzioglu <[email protected]>
[Experimental Bot, please feedback here] This PR description mostly meets the NuttX requirements, but needs a few improvements: Strengths:
Weaknesses:
Suggested Improvements:
Example of Improved Testing Section:
<Output of the test application before the changes, demonstrating slower performance>
By addressing these points, your PR will be much stronger and easier for reviewers to assess. Remember, a well-written PR significantly increases its chances of being merged quickly and smoothly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if expanding /drivers/ioexpander/gpio.c
this way is a good idea. This driver is designed to support single GPIO. The interface for single GPIO is different and mutually exclusive with the interface to control many GPIOs. In your implementation, when go_bundle_XXXX
is defined, all the rest of the operations in the gpio driver doesn't make sense.
So what is the point of combining two not compatible implementations into one?
The correct solution is a new driver, dedicated to control many GPIOs, maybe something like gpiochip
in Linux.
Should we implement a new driver which includes just 2 calls? Maybe we can write the driver when we implement parallel io interface for esp devices to make the interface more inclusive? That interface also can handle HUB75 led display protocol |
Yes, these are two different functionalities and should be kept separate. What's the point of using these 2 calls from gpio driver if all others gpio methods are NULL and not compatible with "bundle" approach? I'm against shortcuts, it is against INVIOLABLES.md. We already have an example of such an easy way out in upstream and it doesn't seem like anyone wants to fix it: #15431 |
@eren-terzioglu I think @raiden00pl raised some important point here. Another thing that I noticed is the way it was implemented this solution seems ESP-specific. The right solution should be creating ARCH_HAS_GPIO_GROUPING and also the gpio example should have been modified to support it. I think GPIO grouping is more common term than bundle. If you decide to create a new driver, I suggest something like iogroup, gpiowide or par_io, it should be more appropriated, gpiochip that Raiden suggested is not self-explanatory. |
Summary
Add dedicated gpio support to control pins with faster response time and control multiple pins at the same time to applications requires faster response time (.e.g SPI bitbang)
arch/xtensa: Update common layer version for esp32s3
Documentation/xtensa: Add dedicated GPIO docs for esp32[-s2|-s3]
Documentation/risc-v: Add dedicated GPIO documentation for esp32[-c3|-c6|-h2]
boards/xtensa: Add dedicated GPIO board level support for esp32[-s2|-s3]
arch/xtensa: Add dedicated GPIO support for esp32[-s2|-s3]
boards/risc-v: Add dedicated GPIO board level support for esp32[-c3|-c6|-h2]
arch/risc-v: Add Dedicated GPIO support for esp32[c3|c6|h2]
drivers/gpio: Add bundle ioctl commands
Impact
Impact on user: No, new feature added
Impact on build: No, old defconfigs can be used without any issue
Impact on hardware: Yes, dedicated GPIO feature added
Impact on documentation:
Impact on security: No
Impact on compatibility: No, it is compatible with old defconfigs
Testing
esp32c6-devkitc:gpio
,esp32s3-devkit:gpio
andesp32s2-saola-1:gpio
config used withCONFIG_ESPRESSIF_DEDICATED_GPIO
option enabled.Building
Commands used for building:
esp32c6
esp32s2
esp32s3
Sample app I used:
Results
Output should look like this:
I tested blink test without any delay and these are the results
C6 results with using POSIX calls
S3 results with using POSIX calls
S3 results with using arch calls (esp32s3_gpiowrite, ...)