COSA
An Object-Oriented Platform for Arduino Programming
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
LED.hh
Go to the documentation of this file.
1
21
#ifndef COSA_LED_HH
22
#define COSA_LED_HH
23
24
#include "
Cosa/Types.h
"
25
#include "
Cosa/OutputPin.hh
"
26
#include "
Cosa/Periodic.hh
"
27
32
class
LED
:
private
Periodic
{
33
public
:
38
LED
(
Job::Scheduler
* scheduler,
Board::DigitalPin
pin =
Board::LED
) :
39
Periodic
(scheduler, 512),
40
m_pin(pin)
41
{}
42
46
void
on
()
47
__attribute__((always_inline))
48
{
49
stop
();
50
m_pin.
on
();
51
}
52
56
void
off
()
57
__attribute__((always_inline))
58
{
59
stop
();
60
m_pin.
off
();
61
}
62
66
void
normal_mode
()
67
__attribute__((always_inline))
68
{
69
stop
();
70
period
(512);
71
start
();
72
}
73
77
void
alert_mode
()
78
__attribute__((always_inline))
79
{
80
stop
();
81
period
(128);
82
start
();
83
}
84
85
private
:
87
OutputPin
m_pin;
88
93
virtual
void
run()
94
{
95
m_pin.
toggle
();
96
}
97
};
98
99
#endif
Board::DigitalPin
DigitalPin
Definition:
ATmega1284P.hh:106
Types.h
Periodic.hh
LED::alert_mode
void alert_mode()
Definition:
LED.hh:77
Job::Scheduler
Definition:
Job.hh:43
Periodic
Definition:
Periodic.hh:38
LED
Definition:
LED.hh:32
OutputPin::off
void off() const
Definition:
OutputPin.hh:144
Periodic::period
uint32_t period() const
Definition:
Periodic.hh:67
OutputPin.hh
OutputPin::toggle
void toggle() const
Definition:
OutputPin.hh:163
LED::LED
LED(Job::Scheduler *scheduler, Board::DigitalPin pin=Board::LED)
Definition:
LED.hh:38
OutputPin
Definition:
OutputPin.hh:29
Job::stop
bool stop()
Definition:
Job.hh:169
LED::on
void on()
Definition:
LED.hh:46
LED::normal_mode
void normal_mode()
Definition:
LED.hh:66
Board::LED
Definition:
ATmega1284P.hh:139
OutputPin::on
void on() const
Definition:
OutputPin.hh:105
Job::start
bool start()
Definition:
Job.hh:159
LED::off
void off()
Definition:
LED.hh:56
cores
cosa
Cosa
LED.hh
Generated on Thu Aug 31 2017 17:02:02 for COSA by
1.8.11