IO is an event based input manager which permit to select which composents are manged on your system
Dependencies: C12832 FXOS8700Q LM75B MMA7660
Diff: Event.h
- Revision:
- 0:2ac59c564ab0
- Child:
- 3:1ab88130bb9d
diff -r 000000000000 -r 2ac59c564ab0 Event.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Event.h Tue Feb 23 17:25:07 2016 +0000 @@ -0,0 +1,36 @@ +#pragma once + +#include "Vector.hpp" + +struct Event +{ + enum Device + { + FrdmK64f, + AppShield + }; + + const Device device; + + enum Type // Type of data + { + BinaryInput, + AnalogInput, + VectorInput + }; + + const Type type; // Type of event + + const int id; // Input identifier + + enum ButtonState { Rise, Fall }; + + const ButtonState binary; // State of the button if needed + float analog; // The value if needed (Analog sensors) + Vector<float> vector;// Vector of float if needed (accelerometer) + + Event(Device, Type, int, ButtonState); + Event(Device, Type, int, float); + Event(Device, Type, int, const Vector<float> &); + Event(const Event &); +};