Skip to content

Adding a GPIO IRQ support for Linux lib#3197

Open
villyjayt wants to merge 1 commit into
analogdevicesinc:mainfrom
villyjayt:main
Open

Adding a GPIO IRQ support for Linux lib#3197
villyjayt wants to merge 1 commit into
analogdevicesinc:mainfrom
villyjayt:main

Conversation

@villyjayt

Copy link
Copy Markdown

This commit adds a GPIO IRQ option for Linux ecosystems.

With this new update, we can allow non-STM32 chips that doesn't support other Linux distros (we are using CM5 for this), to allow an IRQ trigger for a GPIO device.

Our exact setup would be:

  • CM5 is running with RPI OS
  • Run a Docker with an Ubuntu 24.04 image and ROS2 Jazzy, and mount the GPIO Chip device of CM5
  • Use linux_gpio_irq.c and linux_gpio_irq.h as libraries for a ROS node.

@CLAassistant

CLAassistant commented Jul 8, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@buha

buha commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Please sign this CLA, add a proper body/description to the commit and ammend the commit with the -s flag.

This commit adds a GPIO IRQ option for Linux ecosystems.

With this new update, we can allow non-STM32 chips that doesn't support other Linux distros (for instance, RPI CM5), to allow an IRQ trigger for a GPIO device.

Signed-off-by: Vtolent3 <villyjay.tolentino@analog.com>
@rbolboac

Copy link
Copy Markdown
Contributor

/AzurePipelines run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@rbolboac rbolboac left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see also the styling errors

/** Linux platform specific GPIO IRQ platform ops structure. */
extern const struct no_os_irq_platform_ops linux_gpio_irq_ops;

#endif /* LINUX_GPIO_IRQ_H_ */ No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing newline

.enable = linux_gpio_irq_enable,
.disable = linux_gpio_irq_disable,
.remove = linux_gpio_irq_ctrl_remove,
}; No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing newline

Comment on lines +576 to +578
/**
* @brief Get the last latched level for a line (1 = HIGH, 0 = LOW).
*/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

document prams and return for each api

strncpy(req.consumer, "no_os_gpio_irq", sizeof(req.consumer) - 1);

ret = ioctl(chip_fd, GPIO_V2_GET_LINE_IOCTL, &req);
close(chip_fd);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check for ret before closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants