COSA
An Object-Oriented Platform for Arduino Programming
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
PinChangeInterrupt.hh
Go to the documentation of this file.
1
21
#ifndef COSA_PIN_CHANGE_INTERRUPT_HH
22
#define COSA_PIN_CHANGE_INTERRUPT_HH
23
24
#include "
Cosa/Types.h
"
25
#include "
Cosa/Event.hh
"
26
#include "
Cosa/IOPin.hh
"
27
#include "
Cosa/Interrupt.hh
"
28
33
class
PinChangeInterrupt
:
public
IOPin
,
public
Interrupt::Handler
{
34
public
:
38
static
void
begin
();
39
43
static
void
end
();
44
46
enum
InterruptMode
{
47
ON_FALLING_MODE
= 0,
48
ON_RISING_MODE
= 1,
49
ON_CHANGE_MODE
= 2
50
} __attribute__((packed));
51
59
PinChangeInterrupt
(
Board::InterruptPin
pin
,
60
InterruptMode
mode
=
ON_CHANGE_MODE
,
61
bool
pullup =
false
) :
62
IOPin
((
Board
::DigitalPin) pin,
INPUT_MODE
, pullup),
63
m_mode(
mode
),
64
m_next(
NULL
)
65
{}
66
72
virtual
void
enable
();
73
79
virtual
void
disable
();
80
86
virtual
void
on_interrupt
(uint16_t arg = 0) = 0;
87
88
private
:
89
static
PinChangeInterrupt
* s_pin[
Board::PCMSK_MAX
];
90
static
uint8_t s_state[
Board::PCMSK_MAX
];
91
93
InterruptMode
m_mode;
94
96
PinChangeInterrupt
* m_next;
97
106
static
void
on_interrupt
(uint8_t ix, uint8_t mask, uint8_t base);
107
108
friend
void
PCINT0_vect
(
void
);
109
#if defined(PCINT1_vect)
110
friend
void
PCINT1_vect
(
void
);
111
#if defined(PCINT2_vect)
112
friend
void
PCINT2_vect
(
void
);
113
#if defined(PCINT3_vect)
114
friend
void
PCINT3_vect
(
void
);
115
#endif
116
#endif
117
#endif
118
};
119
#endif
PCINT2_vect
void PCINT2_vect(void)
Event.hh
PinChangeInterrupt::enable
virtual void enable()
Definition:
PinChangeInterrupt.cpp:44
Types.h
Board::PCMSK_MAX
Definition:
ATmega1284P.hh:270
Pin::pin
uint8_t pin() const
Definition:
Pin.hh:103
PinChangeInterrupt::PinChangeInterrupt
PinChangeInterrupt(Board::InterruptPin pin, InterruptMode mode=ON_CHANGE_MODE, bool pullup=false)
Definition:
PinChangeInterrupt.hh:59
Interrupt.hh
IOPin::INPUT_MODE
Definition:
IOPin.hh:33
PCINT1_vect
void PCINT1_vect(void)
NULL
#define NULL
Definition:
Types.h:101
IOPin::mode
Mode mode() const
Definition:
IOPin.hh:71
Board::InterruptPin
InterruptPin
Definition:
ATmega1284P.hh:199
PCINT3_vect
void PCINT3_vect(void)
Board
Definition:
ATmega1284P.hh:36
PinChangeInterrupt::ON_FALLING_MODE
Definition:
PinChangeInterrupt.hh:47
PinChangeInterrupt::end
static void end()
Definition:
PinChangeInterrupt.cpp:103
PinChangeInterrupt::disable
virtual void disable()
Definition:
PinChangeInterrupt.cpp:59
PinChangeInterrupt::PCINT0_vect
friend void PCINT0_vect(void)
IOPin
Definition:
IOPin.hh:29
IOPin.hh
PinChangeInterrupt
Definition:
PinChangeInterrupt.hh:33
PinChangeInterrupt::on_interrupt
virtual void on_interrupt(uint16_t arg=0)=0
PinChangeInterrupt::begin
static void begin()
Definition:
PinChangeInterrupt.cpp:65
PinChangeInterrupt::InterruptMode
InterruptMode
Definition:
PinChangeInterrupt.hh:46
PinChangeInterrupt::ON_RISING_MODE
Definition:
PinChangeInterrupt.hh:48
Interrupt::Handler
Definition:
Interrupt.hh:31
PinChangeInterrupt::ON_CHANGE_MODE
Definition:
PinChangeInterrupt.hh:49
cores
cosa
Cosa
PinChangeInterrupt.hh
Generated on Thu Aug 31 2017 17:02:02 for COSA by
1.8.11