libPocuter 1.0 Support library for programming the Pocuter

PocuterPorts.h
Go to the documentation of this file.
1
2 #ifndef POCUTERPORTS_H
3 #define POCUTERPORTS_H
4
8 class PocuterPorts {
9 public:
10 enum PORT_NUMBER {
11 PORT_0,
12 PORT_1,
13 PORT_2,
14 PORT_3,
15 PORT_4,
16 PORT_5
17 };
18
19 enum PORT_DIRECTION {
20 PORT_DIRECTION_IN,
21 PORT_DIRECTION_OUT
22
23 };
24 enum PORT_PULLUP {
25 PORT_PULLUP_OFF,
26 PORT_PULLUP_ON
27
28 };
29
30 enum PORT_MODE {
31 PORT_MODE_BINARY,
32 PORT_MODE_ADC
33 };
34 enum PORTSERROR {
35 PORTSERROR_OK,
36 PORTSERROR_NOT_SUPPORTED,
37 PORTSERROR_NOT_INITIALIZED,
38 PORTSERROR_UNKNOWN
39 };
40
41
65 virtual PORTSERROR initPort(PORT_NUMBER n, PORT_DIRECTION d, PORT_MODE m, PORT_PULLUP p) = 0;
66
79 virtual PORTSERROR deinitPort(PORT_NUMBER n) = 0;
80
81
82
83
94 virtual PORTSERROR getValue(PORT_NUMBER n, uint16_t* value);
95
106 virtual PORTSERROR getValue(PORT_NUMBER n, bool* value);
107
119 virtual PORTSERROR setValue(PORT_NUMBER n, bool value);
120
121 typedef void (portEventHandler)(PORT_NUMBER n, bool portValue, void*);
136 virtual PORTSERROR registerEventHandler(PORT_NUMBER n, portEventHandler* h, void* u) = 0;
137
143 virtual PORTSERROR pauseInterruptHandler() = 0;
144
150 virtual PORTSERROR resumeInterruptHandler() = 0;
151
152 private:
153
154 };
155
156 #endif /* POCUTERPORTS_H */
157
PocuterPorts::PORTSERROR
PORTSERROR
Definition: PocuterPorts.h:34
PocuterPorts::PORT_2
@ PORT_2
Definition: PocuterPorts.h:13
PocuterPorts
options to access the Pocuter user ports (Port0 - Port5)
Definition: PocuterPorts.h:8
PocuterPorts::PORT_MODE_BINARY
@ PORT_MODE_BINARY
Definition: PocuterPorts.h:31
PocuterPorts::PORT_PULLUP_ON
@ PORT_PULLUP_ON
Definition: PocuterPorts.h:26
PocuterPorts::deinitPort
virtual PORTSERROR deinitPort(PORT_NUMBER n)=0
deinit an exposed port
PocuterPorts::pauseInterruptHandler
virtual PORTSERROR pauseInterruptHandler()=0
pause the eventhandler
PocuterPorts::PORT_DIRECTION_IN
@ PORT_DIRECTION_IN
Definition: PocuterPorts.h:20
PocuterPorts::getValue
virtual PORTSERROR getValue(PORT_NUMBER n, uint16_t *value)
get a value from an ADC port
PocuterPorts::PORT_NUMBER
PORT_NUMBER
Definition: PocuterPorts.h:10
PocuterPorts::PORT_PULLUP_OFF
@ PORT_PULLUP_OFF
Definition: PocuterPorts.h:25
PocuterPorts::PORT_3
@ PORT_3
Definition: PocuterPorts.h:14
PocuterPorts::PORTSERROR_NOT_INITIALIZED
@ PORTSERROR_NOT_INITIALIZED
Definition: PocuterPorts.h:37
PocuterPorts::PORT_PULLUP
PORT_PULLUP
Definition: PocuterPorts.h:24
PocuterPorts::PORTSERROR_UNKNOWN
@ PORTSERROR_UNKNOWN
Definition: PocuterPorts.h:38
PocuterPorts::setValue
virtual PORTSERROR setValue(PORT_NUMBER n, bool value)
set a binary port
PocuterPorts::registerEventHandler
virtual PORTSERROR registerEventHandler(PORT_NUMBER n, portEventHandler *h, void *u)=0
register an event callback
PocuterPorts::PORT_MODE
PORT_MODE
Definition: PocuterPorts.h:30
PocuterPorts::initPort
virtual PORTSERROR initPort(PORT_NUMBER n, PORT_DIRECTION d, PORT_MODE m, PORT_PULLUP p)=0
init an exposed port
PocuterPorts::PORTSERROR_NOT_SUPPORTED
@ PORTSERROR_NOT_SUPPORTED
Definition: PocuterPorts.h:36
PocuterPorts::resumeInterruptHandler
virtual PORTSERROR resumeInterruptHandler()=0
resume the eventhandler
PocuterPorts::PORT_MODE_ADC
@ PORT_MODE_ADC
Definition: PocuterPorts.h:32
PocuterPorts::PORTSERROR_OK
@ PORTSERROR_OK
Definition: PocuterPorts.h:35
PocuterPorts::PORT_0
@ PORT_0
Definition: PocuterPorts.h:11
PocuterPorts::PORT_4
@ PORT_4
Definition: PocuterPorts.h:15
PocuterPorts::portEventHandler
void() portEventHandler(PORT_NUMBER n, bool portValue, void *)
Definition: PocuterPorts.h:121
PocuterPorts::PORT_DIRECTION_OUT
@ PORT_DIRECTION_OUT
Definition: PocuterPorts.h:21
PocuterPorts::PORT_1
@ PORT_1
Definition: PocuterPorts.h:12
PocuterPorts::PORT_DIRECTION
PORT_DIRECTION
Definition: PocuterPorts.h:19
PocuterPorts::PORT_5
@ PORT_5
Definition: PocuterPorts.h:16