k og / Switch

Dependents:   NJU6063_HelloWorld

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Switch.h Source File

Switch.h

00001 #ifndef MBED_SWITCH_H
00002 #define MBED_SWITCH_H
00003 
00004 #include "mbed.h"
00005 
00006 class Switch
00007 {
00008 private:
00009     DigitalIn _sw0;
00010     DigitalIn _sw1;
00011     Ticker _swchecker;
00012 
00013     uint8_t buffer[2];
00014     uint8_t swst[2];
00015     uint8_t sw[2];
00016     uint8_t prev[2];
00017 
00018 public:
00019     Switch( PinName sw0, PinName sw1);
00020     ~Switch(){};
00021     void begin(void);
00022     void swcheck(void);
00023     uint8_t negedge(uint8_t no);
00024     uint8_t posedge(uint8_t no);
00025     void clear(uint8_t no);
00026     uint8_t level(uint8_t no);
00027 };
00028 
00029 #endif  //MBED_SWITCH_H