DUNE: GPIO with Interrupt

15 views
Skip to first unread message

Kristian Klausen

unread,
Sep 1, 2017, 3:32:30 AM9/1/17
to LSTS Toolchain
Hi,

I'm planning on implementing an interface to GPIO's with user-space interrupts. Currently, I am planning to create a new IrqGPIO class, which inherits IO::Handle, so it can be used with IO::Poll (internal select on linux) on changes to gpio/value.

It will cause some duplication of code from Hardware::GPIO, as the handle and path are not accessible public. (Or change the interface to GPIO, and have a GPIO as a member variable in IrqGPIO, though this will expose a bit much.)

Alternatively, I can inherit from GPIO instead of IO::Handle, make necessary variables protected, and make the linux native handle accessible, to be added to IO::Poll through that.

Class friends are also an option, but I do not like that to much.

Any thoughts?
Reply all
Reply to author
Forward
0 new messages