2016-02-24 14:37:48 +01:00
|
|
|
#ifndef INTERRUPT_H
|
|
|
|
|
#define INTERRUPT_H
|
|
|
|
|
|
2016-02-24 21:51:16 +01:00
|
|
|
|
2016-02-24 14:37:48 +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);
|
2016-05-04 16:20:20 +02:00
|
|
|
static void setupWatchDogInterrupt(unsigned int milliseconds);
|
2016-05-10 13:58:07 +02:00
|
|
|
//static void setupTimerInterrupt(unsigned int milliseconds);
|
2016-05-02 16:39:39 +02:00
|
|
|
|
|
|
|
|
static void setCallback(InterruptFunction callback){ Interrupt::callback = callback;}
|
|
|
|
|
static InterruptFunction getCallback(){ return Interrupt::callback;}
|
2016-02-24 14:37:48 +01:00
|
|
|
|
|
|
|
|
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-02-24 14:37:48 +01:00
|
|
|
|
2016-05-02 16:39:39 +02:00
|
|
|
|
2016-02-24 14:37:48 +01:00
|
|
|
#endif // INTERRUPT_H
|