Henk Meewis / Mbed 2 deprecated USB_serial_LED_controller

Dependencies:   mbed

Fork of frdm_echo by Henk Meewis

PushButtons.h

Committer:
silverpanda
Date:
2014-04-18
Revision:
13:019e24491f32

File content as of revision 13:019e24491f32:

#ifndef pushbuttons_h__
#define pushbuttons_h__

typedef enum {pb2 = 0, pb3} ePushButton;

class PushButtons {
public:
    PushButtons();
    bool tick10ms();
    bool getJustPressed(ePushButton);
    bool getPressed(ePushButton);
private:
    void reset(ePushButton);
    void process(ePushButton);
    DigitalIn *getPointer(ePushButton);

    DigitalIn *sw2, *sw3;
    uint32_t timer[2];
    bool justPressed[2], oldPressed[2];
};

#endif