nuttx/Documentation
Justin Hammond 1528b470b9 drivers/ioexpander: List the registered pins in /proc/gpio.
The pins a board publishes are visible in /dev and each can be read
through its own node, but surveying a whole board that way means an open
and two ioctls per pin, and the signal and interrupt counters the upper
half keeps are not reachable through any of them.

Adds a list of registered pins and publishes it as /proc/gpio, behind
GPIO_PROCFS: a quality of life view of the same kind as /proc/pinctrl
and /proc/reset.  Every common field comes from state the upper half
already holds: the pin type, the value through go_read(), how many times
the pin has been registered for signals, and how many interrupts it has
taken.  Lines carry the same key:value tokens in the same order, so the
file is machine parseable.

Lower halves may supply an optional go_describe() adding what only they
can say, such as which pad carries the line or how its trigger is
configured.  It writes text into a caller supplied buffer and the upper
half owns the line, so a lower half needs no procfs knowledge.  A lower
half without it is listed with the common tokens alone.

The pin type index is bounded before use: it comes from the lower half
and the name table cannot cover a type the enumeration does not define.
A pin that cannot be read reports val:- rather than a zero that would
read as a real level.

procfs_register() appends without checking for duplicates, so the entry
is claimed once for the lifetime of the system rather than whenever the
list is empty; pins come and go at run time.

The name is held in a buffer as long as the one gpio_pin_register()
accepts, so a listing always names the same string as /dev.

The pin type name table is declared without an explicit size so that the
assertion beside it compares against the enumeration and can fail; sized
as [GPIO_NPINTYPES] it would have been tautological.

Documents the entry, its tokens, and how a lower half describes a pin.

Off by default: with GPIO_PROCFS unset the list, the lock and the procfs
entry are compiled out, and go_describe() is one more member at the end
of a structure existing lower halves do not reach.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Justin Hammond <justin@dynam.ac>
2026-08-19 00:46:56 +08:00
..
_extensions Documentation: port warnings_filter Sphinx extension from Zephyr 2023-11-28 09:18:29 -08:00
_static docs: reduce main content max width from 1200px to 1000px 2021-03-26 23:41:45 -05:00
_templates Documentation: support versioned docs 2020-11-26 10:58:44 -08:00
applications sched,fs,docs: support setuid sudo helper 2026-08-18 15:57:52 +08:00
components drivers/ioexpander: List the registered pins in /proc/gpio. 2026-08-19 00:46:56 +08:00
contributing !arch/stm32: move stm32l1 and finalize the directory split 2026-06-24 14:54:44 -03:00
debugging Documentation: Add documentation of SCHED_DUMP_TASKS and SCHED_DUMP_STACK 2026-06-09 08:04:54 -04:00
faq !boards: Remove NSH_ARCHINIT and board_app_initialize 2026-05-02 18:36:46 +08:00
guides arch/arm: add stm32u0 support 2026-08-18 15:00:15 +02:00
implementation docs: describe shared library module declarations 2026-08-18 10:36:28 -03:00
introduction WIP: Documentation: replace first person perspectives 2025-05-19 20:21:33 +08:00
logos style: fix typos 2025-04-30 13:45:46 +08:00
platforms boards/qemu-intel64: add python configuration 2026-08-18 11:16:06 -03:00
quickstart Documentation: fill in pass1 directory description in organization.rst 2026-07-06 10:18:42 -03:00
reference !Documentation: Describe the fork()/vfork() split. 2026-08-10 08:57:30 -03:00
ReleaseNotes Documentation: add NuttX 13.0.1 release notes 2026-08-12 21:53:28 +08:00
standards !Documentation: Describe the fork()/vfork() split. 2026-08-10 08:57:30 -03:00
testing ci: do not trigger Build on PR description edits 2026-08-16 19:08:58 -04:00
.gitignore docs/tags: Introduce tagging feature to the documentation. 2025-04-29 09:18:25 +02:00
conf.py Documentation: conf: Ignore .venv 2026-05-29 01:26:21 +08:00
glossary.rst
index.rst docs/security: Add Security section to the documentation. 2026-01-06 02:17:20 +08:00
known-warnings.txt fs: Add VFS docs 2024-02-20 18:28:09 -08:00
legacy_README.md style: Fix "the the" typo across the codebase. 2026-03-23 11:07:49 +01:00
make.bat Documentation: Remove all tail spaces from *.rst and *.html 2020-10-18 10:51:22 -07:00
Makefile doc: Improve sphinx build time + add autobuild help info. 2026-01-27 09:50:55 +08:00
Pipfile docs/plantuml: Add PlantUML support to Documentation build 2026-02-15 08:47:23 +01:00
Pipfile.lock build(deps): bump starlette from 1.0.1 to 1.3.1 in /Documentation 2026-06-18 12:49:49 -04:00
security.rst docs/security: Add Security section to the documentation. 2026-01-06 02:17:20 +08:00
substitutions.rst Remove the double blank line from source files 2022-02-20 20:10:14 +01:00