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:
4:50e2aefe516b
Parent:
3:1ab88130bb9d

File content as of revision 4:50e2aefe516b:

#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 &);
};