COSA
An Object-Oriented Platform for Arduino Programming
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
Alarm.hh
Go to the documentation of this file.
1
21
#ifndef COSA_ALARM_HH
22
#define COSA_ALARM_HH
23
24
#include "
Cosa/Types.h
"
25
#include "
Cosa/Clock.hh
"
26
#include "
Cosa/Periodic.hh
"
27
#include "
Cosa/ExternalInterrupt.hh
"
28
35
class
Alarm
:
public
Periodic
{
36
public
:
42
class
Clock
:
public
::Clock
,
public
ExternalInterrupt
{
43
public
:
52
Clock
(
Board::ExternalInterruptPin
pin
,
53
InterruptMode
mode
=
ON_RISING_MODE
,
54
bool
pullup =
false
) :
55
::
Clock
(),
56
ExternalInterrupt
(pin,
mode
, pullup)
57
{}
58
59
protected
:
65
virtual
void
on_interrupt
(uint16_t arg = 0)
66
{
67
UNUSED
(arg);
68
tick
(1000);
69
}
70
};
71
78
Alarm
(::
Clock
* clock, uint32_t
period
) :
79
Periodic
(clock, period)
80
{}
81
};
82
#endif
83
ExternalInterrupt
Definition:
ExternalInterrupt.hh:33
Types.h
Alarm::Alarm
Alarm(::Clock *clock, uint32_t period)
Definition:
Alarm.hh:78
Pin::pin
uint8_t pin() const
Definition:
Pin.hh:103
Alarm
Definition:
Alarm.hh:35
Periodic.hh
Periodic
Definition:
Periodic.hh:38
IOPin::mode
Mode mode() const
Definition:
IOPin.hh:71
ExternalInterrupt::ON_RISING_MODE
Definition:
ExternalInterrupt.hh:39
Alarm::Clock::on_interrupt
virtual void on_interrupt(uint16_t arg=0)
Definition:
Alarm.hh:65
Periodic::period
uint32_t period() const
Definition:
Periodic.hh:67
ExternalInterrupt.hh
Clock.hh
Board::ExternalInterruptPin
ExternalInterruptPin
Definition:
ATmega1284P.hh:190
UNUSED
#define UNUSED(x)
Definition:
ATmega328P.hh:31
Alarm::Clock::Clock
Clock(Board::ExternalInterruptPin pin, InterruptMode mode=ON_RISING_MODE, bool pullup=false)
Definition:
Alarm.hh:52
ExternalInterrupt::InterruptMode
InterruptMode
Definition:
ExternalInterrupt.hh:35
Clock::tick
void tick(uint16_t ms)
Definition:
Clock.hh:94
Alarm::Clock
Definition:
Alarm.hh:42
cores
cosa
Cosa
Alarm.hh
Generated on Thu Aug 31 2017 17:02:02 for COSA by
1.8.11