mirror of
https://github.com/eclipse/upm.git
synced 2025-07-08 12:51:18 +03:00
a110x: Add interrupt support and a suitable example
Signed-off-by: Jon Trulson <jtrulson@ics.com> Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
This commit is contained in:

committed by
John Van Drasek

parent
317ad35180
commit
4bb077e70b
@ -50,7 +50,10 @@ namespace upm {
|
||||
* whether it is detecting a magnetic field with south polarity
|
||||
* perpendicular to the sensor element.
|
||||
*
|
||||
* An example showing a simple test for the presence of a field
|
||||
* @snippet a110x.cxx Interesting
|
||||
* An example demonstrating the use of an interrupt handler to count pulses
|
||||
* @snippet a110x-intr.cxx Interesting
|
||||
*/
|
||||
class A110X {
|
||||
public:
|
||||
@ -71,7 +74,24 @@ namespace upm {
|
||||
*/
|
||||
bool magnetDetected();
|
||||
|
||||
/**
|
||||
* Install an Interrupt Service Routine (ISR) to be called when
|
||||
* the appropriate magnetic field is detected.
|
||||
*
|
||||
* @param fptr function pointer to function to be called on interrupt
|
||||
* @param arg pointer to an object that will be supplied as an
|
||||
* arguement to the ISR.
|
||||
*/
|
||||
void installISR(void (*isr)(void *), void *arg);
|
||||
|
||||
/**
|
||||
* Uninstall the previously installed Interrupt Service Routine (ISR)
|
||||
*
|
||||
*/
|
||||
void uninstallISR();
|
||||
|
||||
private:
|
||||
bool m_isrInstalled;
|
||||
mraa_gpio_context m_gpio;
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user