IO is an event based input manager which permit to select which composents are manged on your system

Dependencies:   C12832 FXOS8700Q LM75B MMA7660

Event.h

Committer:
co838_app56
Date:
2016-02-25
Revision:
3:1ab88130bb9d
Parent:
0:2ac59c564ab0

File content as of revision 3:1ab88130bb9d:

#pragma once

#include "Vector.h"

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              vector;// Vector of float if needed (accelerometer)
    
    Event(Device, Type, int, ButtonState);
    Event(Device, Type, int, float);
    Event(Device, Type, int, const Vector &);
    Event(const Event &);
};