libPocuter 1.0 Support library for programming the Pocuter

PocuterAccelerometer.h
Go to the documentation of this file.
1
2 #ifndef POCUTERACCELEROMETER_H
3 #define POCUTERACCELEROMETER_H
4
9 class PocuterAccelerometer {
10 public:
11 enum ACCERROR {
12 ACCERROR_OK = 0,
13 ACCERROR_OFFLINE,
14 ACCERROR_COMMUNICATION_FAILED,
15 ACCERROR_UNKNOWN
16 };
17 enum ACCSCALE {
18 G2 = 0,
19 G4 = 1,
20 G8 = 2
21 };
22 struct State {
23 int16_t x;
24 int16_t y;
25 int16_t z;
26 };
27 enum ACCEVENT {
28 ACC_ORIENTATION,
29 ACC_SHAKE
30 };
31 typedef void (accEventHandler)(ACCEVENT, void*);
45 virtual ACCERROR registerEventHandler(accEventHandler* e, void* u) = 0;
46
52 virtual void unregisterEventHandler() = 0;
58 virtual ACCERROR isOnline() = 0;
68 virtual ACCERROR getState(State* state) = 0;
69
78 virtual ACCERROR setScale(ACCSCALE) = 0;
79
89 virtual ACCERROR getTemperature(int8_t*) = 0;
90
96 virtual ACCERROR pauseInterruptHandler() = 0;
97
103 virtual ACCERROR resumeInterruptHandler() = 0;
104
105
106 private:
107
108 };
109
110 #endif /* POCUTERACCELEROMETER_H */
111
PocuterAccelerometer::ACC_ORIENTATION
@ ACC_ORIENTATION
Definition: PocuterAccelerometer.h:28
PocuterAccelerometer::ACCEVENT
ACCEVENT
Definition: PocuterAccelerometer.h:27
PocuterAccelerometer::resumeInterruptHandler
virtual ACCERROR resumeInterruptHandler()=0
resume the eventhandler
PocuterAccelerometer::ACCERROR
ACCERROR
Definition: PocuterAccelerometer.h:11
PocuterAccelerometer::ACCERROR_OFFLINE
@ ACCERROR_OFFLINE
Definition: PocuterAccelerometer.h:13
PocuterAccelerometer::registerEventHandler
virtual ACCERROR registerEventHandler(accEventHandler *e, void *u)=0
register an event callback
PocuterAccelerometer::pauseInterruptHandler
virtual ACCERROR pauseInterruptHandler()=0
pause the eventhandler
PocuterAccelerometer::ACCERROR_UNKNOWN
@ ACCERROR_UNKNOWN
Definition: PocuterAccelerometer.h:15
PocuterAccelerometer::unregisterEventHandler
virtual void unregisterEventHandler()=0
unregister the event handler
PocuterAccelerometer::ACCERROR_COMMUNICATION_FAILED
@ ACCERROR_COMMUNICATION_FAILED
Definition: PocuterAccelerometer.h:14
PocuterAccelerometer::ACCSCALE
ACCSCALE
Definition: PocuterAccelerometer.h:17
PocuterAccelerometer::accEventHandler
void() accEventHandler(ACCEVENT, void *)
Definition: PocuterAccelerometer.h:31
PocuterAccelerometer::G8
@ G8
Definition: PocuterAccelerometer.h:20
PocuterAccelerometer::ACC_SHAKE
@ ACC_SHAKE
Definition: PocuterAccelerometer.h:29
PocuterAccelerometer::G2
@ G2
Definition: PocuterAccelerometer.h:18
PocuterAccelerometer::State::y
int16_t y
Definition: PocuterAccelerometer.h:24
PocuterAccelerometer
options to access the Pocuter accelerometer
Definition: PocuterAccelerometer.h:9
PocuterAccelerometer::State::z
int16_t z
Definition: PocuterAccelerometer.h:25
PocuterAccelerometer::getState
virtual ACCERROR getState(State *state)=0
get the current position of the accelerometer in space.
PocuterAccelerometer::State::x
int16_t x
Definition: PocuterAccelerometer.h:23
PocuterAccelerometer::G4
@ G4
Definition: PocuterAccelerometer.h:19
PocuterAccelerometer::State
Definition: PocuterAccelerometer.h:22
PocuterAccelerometer::setScale
virtual ACCERROR setScale(ACCSCALE)=0
set the accelerometer scale.
PocuterAccelerometer::getTemperature
virtual ACCERROR getTemperature(int8_t *)=0
get the current sensor temperature
PocuterAccelerometer::ACCERROR_OK
@ ACCERROR_OK
Definition: PocuterAccelerometer.h:12
PocuterAccelerometer::isOnline
virtual ACCERROR isOnline()=0
checks if the accelerometer is online