Dependents: NJU6063_HelloWorld
Switch.h@2:74f6d3b45803, 2016-01-18 (annotated)
- Committer:
- og
- Date:
- Mon Jan 18 05:07:38 2016 +0000
- Revision:
- 2:74f6d3b45803
- Parent:
- 1:511798f6c248
- Child:
- 3:952d0895e274
beta
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
og | 0:185d28cb4740 | 1 | #ifndef MBED_SWITCH_H |
og | 0:185d28cb4740 | 2 | #define MBED_SWITCH_H |
og | 0:185d28cb4740 | 3 | |
og | 0:185d28cb4740 | 4 | #include "mbed.h" |
og | 0:185d28cb4740 | 5 | |
og | 0:185d28cb4740 | 6 | class Switch |
og | 0:185d28cb4740 | 7 | { |
og | 0:185d28cb4740 | 8 | private: |
og | 0:185d28cb4740 | 9 | DigitalIn _sw0; |
og | 0:185d28cb4740 | 10 | DigitalIn _sw1; |
og | 0:185d28cb4740 | 11 | Ticker _swchecker; |
og | 0:185d28cb4740 | 12 | |
og | 0:185d28cb4740 | 13 | uint8_t buffer[2]; |
og | 0:185d28cb4740 | 14 | uint8_t swst[2]; |
og | 0:185d28cb4740 | 15 | uint8_t sw[2]; |
og | 0:185d28cb4740 | 16 | uint8_t prev[2]; |
og | 0:185d28cb4740 | 17 | |
og | 0:185d28cb4740 | 18 | public: |
og | 0:185d28cb4740 | 19 | Switch( PinName sw0, PinName sw1); |
og | 0:185d28cb4740 | 20 | ~Switch(){}; |
og | 2:74f6d3b45803 | 21 | void init(void); |
og | 0:185d28cb4740 | 22 | void swcheck(void); |
og | 1:511798f6c248 | 23 | uint8_t negedge(uint8_t no); |
og | 1:511798f6c248 | 24 | uint8_t posedge(uint8_t no); |
og | 1:511798f6c248 | 25 | void clear(uint8_t no); |
og | 1:511798f6c248 | 26 | uint8_t level(uint8_t no); |
og | 0:185d28cb4740 | 27 | }; |
og | 0:185d28cb4740 | 28 | |
og | 0:185d28cb4740 | 29 | #endif //MBED_SWITCH_H |