RTEMS | dev/gpio: A generic GPIO API as a device node and ioctl (!1499)

Christian Mauderer (@c-mauderer) gitlab at rtems.org
Thu Sep 24 06:03:34 UTC 2026




Christian Mauderer commented on a discussion on cpukit/include/dev/gpio/gpio.h: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1499#note_159884

 > + *
 > + * The pin must already be configured with a trigger other than
 > + * #RTEMS_GPIO_TRIGGER_NONE.
 > + *
 > + * @param fd is the descriptor for the controller's device node.
 > + *
 > + * @param pin is the logical pin whose interrupt to deliver.
 > + *
 > + * @param handler is the handler to call.
 > + *
 > + * @param arg is the argument to pass to the handler.
 > + *
 > + * @retval 0 Successful operation.
 > + * @retval -1 An error occurred.  The errno is set to indicate the error.
 > + */
 > +int rtems_gpio_pin_irq_enable(int fd, uint32_t pin,

What about my point that we maybe should add a flag that would allow the extension of the API in the future? Basically instead of
```
int rtems_gpio_pin_irq_enable(int fd, uint32_t pin, rtems_gpio_irq_handler handler, void* arg);
```
I would suggest a 
```
int rtems_gpio_pin_irq_enable(int fd, uint32_t pin, rtems_gpio_irq_flags flags, rtems_gpio_irq_handler handler, void* arg);
```
and `flag` would be always a RTEMS_GPIO_IRQ_REPLACE at the moment (without other options). That would not change anything in the current implementation but allows extending that API in the future if someone needs it.

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1499#note_159884
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-6se5rcn8om9hxv4j4k4dd0j6s-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/20260924/78cb18ef/attachment-0001.htm>


More information about the bugs mailing list