Saturday, April 27, 2013

HiPi Perl Modules and Interrupts

HiPi::Perl modules version 0.32 have been released containing modules that support GPIO interrupt handling in Perl.

Edit: These interrupt modules were removed from HiPi in release 0.66

Threads are created to handle interrupt response and pin value polling. True interrupt handling is implemented via the kernel sysfs gpio filespace and HiPi::Device::GPIO. Direct polling of the bcm2835 registers is implemented using the HiPi:: BCM2835 module.

Documentation for the interrupt handling modules is available in the online application help pages.

There are also three example scripts showing usage of the interrupt modules:

  • Derived Class Example shows handling interrupts by implementing your own derived class and overriding the base class methods.
  • Callback Example shows handling interrupts by  registering callbacks with the base class.
  • Mixed Handler Example shows handling interrupts for pins managed by HiPi::Device::GPIO and HiPi::BCM2835 with the same process.

As with all releases, an existing installation can be upgraded by calling:

hipi-upgrade

Full installation instructions are available on the install page.