RTEMS | dev/gpio: A generic GPIO API as a device node and ioctl (!1499)
Christian Mauderer (@c-mauderer)
gitlab at rtems.org
Tue Sep 22 06:34:04 UTC 2026
Merge request https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1499 was reviewed by Christian Mauderer
--
Christian Mauderer started a new discussion on cpukit/include/dev/gpio/gpio.h: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1499#note_159733
> + * @retval -1 An error occurred. The errno is set to indicate the error.
> + */
> +int rtems_gpio_pin_irq_enable(int fd, uint32_t pin,
I'm not sure whether the interrupt mechanics is optimal. A few questions:
* What happens if I already have an interrupt on the same line? Is it one handler per line or can I register multiple ones? Registering multiple ones could be useful for level triggered interrupts. For example if you handle a PCI legacy interrupt line where multiple devices on the bus can pull one interrupt line.
* Do we want to support a mechanism to disable and enable an interrupt without having to re-register the handler? For example, to temporarily disable an interrupt so it can be handled in a task. That would be an application similar to the interrupt server.
--
Christian Mauderer started a new discussion: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1499#note_159734
Thanks for working on that. The current GPIO API (the one used by Raspberry and BBB) is not very flexible. I tried to use it for some BSPs a few times and decided every time that it wouldn't work. So my answer for your question 1 would be: Let's deprecate the old API and maybe make it a GSoC project to port the BSPs to the new API.
At the moment I have read through the API once. It looks a bit complex, but that's the problem with every generic enough API. I'll have to re-read it a few times more for a more thorough opinion.
--
Christian Mauderer started a new discussion on cpukit/include/dev/gpio/gpio.h: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1499#note_159735
> + */
> + RTEMS_GPIO_DIRECTION_OUTPUT
> +} rtems_gpio_direction;
Some chips also have the option to set a pin to "analog" or some other energy saving mode. Should that be another setting? Something like `RTEMS_GPIO_DIRECTION_UNUSED_LOW_POWER`? Or would the `RTEMS_GPIO_DIRECTION_NONE` be that value?
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1499
You're receiving this email because of your account on gitlab.rtems.org. Unsubscribe from this thread: https://gitlab.rtems.org/-/namespace/49/sent_notifications/5-573vmr9i6s7vgadwrg35absme-1d/unsubscribe | Manage all notifications: https://gitlab.rtems.org/-/profile/notifications | Help: https://gitlab.rtems.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260922/6abba123/attachment.htm>
More information about the bugs
mailing list