hal/arduino/HalMultiSensor/Interrupt.h

28 lines
624 B
C
Raw Normal View History

#ifndef INTERRUPT_H
#define INTERRUPT_H
2016-02-24 21:51:16 +01:00
typedef void (*InterruptFunction) ();
class Interrupt
{
public:
2016-05-02 16:39:39 +02:00
static void wakeUp();
static void sleep();
static void setupPinInterrupt(int pin);
static void setupTimerInterrupt(unsigned int milliseconds);
static void setCallback(InterruptFunction callback){ Interrupt::callback = callback;}
static InterruptFunction getCallback(){ return Interrupt::callback;}
private:
2016-05-02 16:39:39 +02:00
static InterruptFunction callback;
static bool wakeUpNow;
Interrupt() {};
Interrupt(Interrupt const&);
void operator=(Interrupt const&);
2016-02-24 21:51:16 +01:00
};
2016-05-02 16:39:39 +02:00
#endif // INTERRUPT_H