simulavr
1.1.0
pinmon.h
Go to the documentation of this file.
1
#ifndef _pinmonh_
2
#define _pinmonh_
3
#include "
avrdevice.h
"
4
#include "
pin.h
"
5
#include "
pinnotify.h
"
6
#include "
net.h
"
7
8
// This class monitors a single pin and prints
9
// changes in the pin state to stdout.
10
class
PinMonitor
:
public
HasPinNotifyFunction
{
11
private
:
12
// This string printed as a prefix on stdout with each pin change.
13
const
char
*
_pinDescStr
;
14
// String printed when the pin is HIGH.
15
const
char
*
_pinHighStr
;
16
// String printed when the pin is LOW.
17
const
char
*
_pinLowStr
;
18
// Previous state of pin since change callback doesn't *really*
19
// mean "change"!
20
bool
_prevState
;
21
public
:
22
PinMonitor
(
AvrDevice
& avr,
23
const
char
* pinNameStr,
// AVR pin name. (e.g. "B1","C2", etc.)
24
const
char
* pinDescStr = 0,
25
const
char
* pinHighStr = 0,
26
const
char
* pinLowStr = 0
27
) throw();
28
private:
// HasPinNotifyFunction
29
void
PinStateHasChanged
(
Pin
*);
30
};
31
32
#endif
AvrDevice
Basic AVR device, contains the core functionality.
Definition:
avrdevice.h:66
PinMonitor::_pinLowStr
const char * _pinLowStr
Definition:
pinmon.h:17
net.h
PinMonitor::PinStateHasChanged
void PinStateHasChanged(Pin *)
Definition:
pinmon.cpp:21
Pin
Pin class, handles input and output to external parts.
Definition:
pin.h:98
avrdevice.h
pinnotify.h
PinMonitor::_pinDescStr
const char * _pinDescStr
Definition:
pinmon.h:13
PinMonitor
Definition:
pinmon.h:10
HasPinNotifyFunction
Definition:
pinnotify.h:29
PinMonitor::_pinHighStr
const char * _pinHighStr
Definition:
pinmon.h:15
PinMonitor::PinMonitor
PinMonitor(AvrDevice &avr, const char *pinNameStr, const char *pinDescStr=0, const char *pinHighStr=0, const char *pinLowStr=0)
Definition:
pinmon.cpp:6
PinMonitor::_prevState
bool _prevState
Definition:
pinmon.h:20
pin.h
include
pinmon.h
Generated by
1.8.13