Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: NJU6063_HelloWorld
Switch.h@3:952d0895e274, 2016-01-25 (annotated)
- Committer:
- og
- Date:
- Mon Jan 25 08:59:31 2016 +0000
- Revision:
- 3:952d0895e274
- Parent:
- 2:74f6d3b45803
test
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 | 3:952d0895e274 | 21 | void begin(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 |