Timer peripheral class. This lib. include function ; WAIT, stop, reset, start, and read_ms.
Dependents: DetectFreqAboveTH RN41
myTimer.h@5:c9304777ce1a, 2016-03-29 (annotated)
- Committer:
- AkinoriHashimoto
- Date:
- Tue Mar 29 10:50:26 2016 +0000
- Revision:
- 5:c9304777ce1a
- Parent:
- 2:3060a6604f13
- Child:
- 6:4cb4eea64805
add read_us()
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AkinoriHashimoto | 0:04c9087b9ca9 | 1 | #pragma once |
AkinoriHashimoto | 0:04c9087b9ca9 | 2 | |
AkinoriHashimoto | 0:04c9087b9ca9 | 3 | #include "mbed.h" |
AkinoriHashimoto | 0:04c9087b9ca9 | 4 | |
AkinoriHashimoto | 0:04c9087b9ca9 | 5 | /** Timer Class. |
AkinoriHashimoto | 0:04c9087b9ca9 | 6 | * |
AkinoriHashimoto | 0:04c9087b9ca9 | 7 | * stop, reset, start, read_ms. |
AkinoriHashimoto | 0:04c9087b9ca9 | 8 | */ |
AkinoriHashimoto | 0:04c9087b9ca9 | 9 | class myTimer |
AkinoriHashimoto | 0:04c9087b9ca9 | 10 | { |
AkinoriHashimoto | 0:04c9087b9ca9 | 11 | private: |
AkinoriHashimoto | 0:04c9087b9ca9 | 12 | Timer timer; |
AkinoriHashimoto | 0:04c9087b9ca9 | 13 | |
AkinoriHashimoto | 0:04c9087b9ca9 | 14 | public: |
AkinoriHashimoto | 0:04c9087b9ca9 | 15 | myTimer(); |
AkinoriHashimoto | 0:04c9087b9ca9 | 16 | void stop(); |
AkinoriHashimoto | 0:04c9087b9ca9 | 17 | void reset(); |
AkinoriHashimoto | 2:3060a6604f13 | 18 | void start(bool _RESET=false); |
AkinoriHashimoto | 1:685c0f37a569 | 19 | int read_ms(bool _START=true, bool _RESET=true, bool _STOP=true); |
AkinoriHashimoto | 5:c9304777ce1a | 20 | int read_us(bool _START=true, bool _RESET=true, bool _STOP=true); |
AkinoriHashimoto | 1:685c0f37a569 | 21 | void wait_ms(int waitTime, bool _START=true, bool _RESET=true, bool _STOP=true); |
AkinoriHashimoto | 0:04c9087b9ca9 | 22 | }; |
AkinoriHashimoto | 0:04c9087b9ca9 | 23 | |
AkinoriHashimoto | 0:04c9087b9ca9 | 24 | // EOF |