sim/ft2232h: Add FT2232H GPIO integration on NuttX sim#18951
Open
acassis wants to merge 4 commits into
Open
Conversation
linguini1
previously approved these changes
May 24, 2026
1e68630 to
0c68d8c
Compare
linguini1
previously approved these changes
May 24, 2026
Contributor
Author
|
@simbit18 is it possible to install libftdio-dev to get FT2232H integration passing on CI? |
acassis
added a commit
that referenced
this pull request
May 29, 2026
This commit is needed to get PR #18951 passing on CI test. I think this USB Device could be used in the future to do real hardware tests, including automated tests on our CI. Signed-off-by: Alan C. Assis <acassis@gmail.com>
This patch adds support to use FT2232H as GPIO to control external devices. Signed-off-by: Alan C. Assis <acassis@gmail.com>
This commit add documentation to explain about the FT2232H integration on NuttX. Signed-off-by: Alan C. Assis <acassis@gmail.com>
This board profile configure the FT2232H module to use as a GPIO to NuttX sim. Signed-off-by: Alan C. Assis <acassis@gmail.com>
| config SIM_FT2232H | ||
| bool "Support FT2232H USB bridge to control external devices" | ||
| default n | ||
| depends on ARCH_SIM |
Contributor
Author
There was a problem hiding this comment.
Right, I will make FT2232H be a specialization of GPIOCHIP, so we will have choice to use Generic Linux GPIOv2 or FT2232H
|
|
||
| endif # SIM_CANDEV | ||
|
|
||
| config SIM_FT2232H |
Contributor
There was a problem hiding this comment.
should you group SIM_FT2232H and SIM_GPIOCHIP into choice?
| * Public Function Prototypes | ||
| ****************************************************************************/ | ||
|
|
||
| struct host_ft2232h_gpio_dev *host_ft2232h_gpio_alloc(uint8_t pins_dir); |
Contributor
There was a problem hiding this comment.
why not share the host interface of SIM_GPIOCHIP? so we don't need add sim_ft2232h_gpio_initialize, but implement host_gpiochip_xxx instead.
| * 0 for success, other for fail. | ||
| ****************************************************************************/ | ||
|
|
||
| int host_ft2232h_gpio_irq_request(struct host_ft2232h_gpio_dev *priv, uint8_t pin, |
Contributor
There was a problem hiding this comment.
merge to the first patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This driver implements a FT2232H GPIO integration NuttX sim to allow users to read/write external GPIOs and control external devices.
It will help to control external devices using NuttX sim.
The next steps will be adding SPI and I2C integration support.
Impact
User will be able to use a FT2232H module to read/write external GPIO
Testing
nsh> ls /dev
/dev:
console
gpio20
gpio21
gpio22
gpio23
gpio24
gpio25
gpio26
gpio27
loop
null
oneshot
ram0
ram1
ram2
zero
nsh> gpio /dev/gpio20
Driver: /dev/gpio20
gplh_read: pin0: value=0x7fa69b5d4117
Output pin: Value=0
nsh> gpio /dev/gpio20
Driver: /dev/gpio20
gplh_read: pin0: value=0x7fa69b5d4117
Output pin: Value=1
nsh> gpio -o 1 /dev/gpio27
Driver: /dev/gpio27
gplh_read: pin7: value=0x7fa69b5d4117
Output pin: Value=0
Writing: Value=1
gplh_write: pin7: value=1
gplh_read: pin7: value=0x7fa69b5d4117
Verify: Value=1
nsh> gpio -o 0 /dev/gpio27
Driver: /dev/gpio27
gplh_read: pin7: value=0x7fa69b5d4117
Output pin: Value=1
Writing: Value=0
gplh_write: pin7: value=0
gplh_read: pin7: value=0x7fa69b5d4117
Verify: Value=1
nsh>