yangsong8-a1 opened a new pull request, #21714:
URL: https://github.com/apache/nuttx/pull/21714
## Summary
- Add an I/O expander driver for the ARM PrimeCell PL061 GPIO controller
(8 pins): direction, read/write through the masked data register, and
optional pin interrupts (CONFIG_PL061_INT_ENABLE) with level, rising,
falling and both-edge triggers. A board creates it with
pl061_ioe_initialize(base, irq) and can expose pins with
gpio_lower_half().
- Handle IOEXPANDER_VAL_BOTH, which gpio_lower_half uses for
GPIO_INTERRUPT_BOTH_PIN, return NULL when the allocation fails, and make
pl061.h self-contained.
## Impact
New driver, off by default (CONFIG_IOEXPANDER_PL061). No existing code
changes.
## Testing
Ubuntu 22.04, gcc 13.1, aarch64-none-elf-gcc, arm-none-eabi-gcc 10.3.
- Build with IOEXPANDER_PL061 + DEV_GPIO + GPIO_LOWER_HALF, no warnings:
sim:nsh (PL061_INT_ENABLE off, on, on with IOEXPANDER_MULTIPIN),
qemu-armv8a:nsh and qemu-armv7a:nsh (PL061_INT_ENABLE on)
- qemu-armv8a:nsh on QEMU 6.2 virt (PL061 at 0x09030000, INTID 39). A test
app creates the device, registers /dev/gpio0 (output) and /dev/gpio3
(interrupt), and pin 3 is pulsed with the QEMU monitor command
`system_powerdown` (virt wires its gpio-key to PL061 pin 3):
```
pl061: write 1/0 read 1/0 PASS
pl061: write 0/1 read 0/1 PASS
pl061: /dev/gpio0 write 1 read 1, write 0 read 0 PASS
pl061: rise edges 1 expect 1 PASS
pl061: rise edges 1 expect 1 PASS
pl061: both edges 2 expect 2 PASS
pl061: rise edges 1 expect 1 PASS
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]