COSA
An Object-Oriented Platform for Arduino Programming
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
ExternalInterrupt.hh
Go to the documentation of this file.
1
21
#ifndef COSA_EXTERNAL_INTERRUPT_HH
22
#define COSA_EXTERNAL_INTERRUPT_HH
23
24
#include "
Cosa/Types.h
"
25
#include "
Cosa/Bits.h
"
26
#include "
Cosa/IOPin.hh
"
27
#include "
Cosa/Interrupt.hh
"
28
33
class
ExternalInterrupt
:
public
IOPin
,
public
Interrupt::Handler
{
34
public
:
35
enum
InterruptMode
{
36
ON_LOW_LEVEL_MODE
= 0,
37
ON_CHANGE_MODE
= _BV(ISC00),
38
ON_FALLING_MODE
= _BV(ISC01),
39
ON_RISING_MODE
= (_BV(ISC01) | _BV(ISC00))
40
} __attribute__((packed));
41
49
ExternalInterrupt
(
Board::ExternalInterruptPin
pin
,
50
InterruptMode
mode
=
ON_CHANGE_MODE
,
51
bool
pullup =
false
);
52
58
virtual
void
on_interrupt
(uint16_t arg = 0)
59
{
60
UNUSED
(arg);
61
}
62
68
virtual
void
enable
();
69
75
virtual
void
disable
();
76
82
virtual
void
clear
();
83
84
private
:
86
static
ExternalInterrupt
* ext[
Board::EXT_MAX
];
87
89
uint8_t m_ix;
90
91
friend
void
INT0_vect
(
void
);
92
#if defined(INT1_vect)
93
friend
void
INT1_vect
(
void
);
94
#endif
95
#if defined(INT2_vect)
96
friend
void
INT2_vect
(
void
);
97
#endif
98
#if defined(INT3_vect)
99
friend
void
INT3_vect
(
void
);
100
#endif
101
#if defined(INT4_vect)
102
friend
void
INT4_vect
(
void
);
103
#endif
104
#if defined(INT5_vect)
105
friend
void
INT5_vect
(
void
);
106
#endif
107
#if defined(INT6_vect)
108
friend
void
INT6_vect
(
void
);
109
#endif
110
#if defined(INT7_vect)
111
friend
void
INT7_vect
(
void
);
112
#endif
113
};
114
115
#endif
ExternalInterrupt::ON_CHANGE_MODE
Definition:
ExternalInterrupt.hh:37
ExternalInterrupt::clear
virtual void clear()
Definition:
ExternalInterrupt.cpp:205
ExternalInterrupt
Definition:
ExternalInterrupt.hh:33
ExternalInterrupt::INT0_vect
friend void INT0_vect(void)
Types.h
Pin::pin
uint8_t pin() const
Definition:
Pin.hh:103
ExternalInterrupt::on_interrupt
virtual void on_interrupt(uint16_t arg=0)
Definition:
ExternalInterrupt.hh:58
Interrupt.hh
ExternalInterrupt::enable
virtual void enable()
Definition:
ExternalInterrupt.cpp:190
IOPin::mode
Mode mode() const
Definition:
IOPin.hh:71
ExternalInterrupt::ON_RISING_MODE
Definition:
ExternalInterrupt.hh:39
ExternalInterrupt::disable
virtual void disable()
Definition:
ExternalInterrupt.cpp:199
INT4_vect
void INT4_vect(void)
INT7_vect
void INT7_vect(void)
ExternalInterrupt::ExternalInterrupt
ExternalInterrupt(Board::ExternalInterruptPin pin, InterruptMode mode=ON_CHANGE_MODE, bool pullup=false)
INT5_vect
void INT5_vect(void)
Board::ExternalInterruptPin
ExternalInterruptPin
Definition:
ATmega1284P.hh:190
INT2_vect
void INT2_vect(void)
ExternalInterrupt::ON_FALLING_MODE
Definition:
ExternalInterrupt.hh:38
INT6_vect
void INT6_vect(void)
UNUSED
#define UNUSED(x)
Definition:
ATmega328P.hh:31
INT1_vect
void INT1_vect(void)
ExternalInterrupt::InterruptMode
InterruptMode
Definition:
ExternalInterrupt.hh:35
IOPin
Definition:
IOPin.hh:29
IOPin.hh
INT3_vect
void INT3_vect(void)
ExternalInterrupt::ON_LOW_LEVEL_MODE
Definition:
ExternalInterrupt.hh:36
Bits.h
Board::EXT_MAX
Definition:
ATmega1284P.hh:269
Interrupt::Handler
Definition:
Interrupt.hh:31
cores
cosa
Cosa
ExternalInterrupt.hh
Generated on Thu Aug 31 2017 17:02:02 for COSA by
1.8.11