Timer peripheral class. This lib. include function ; WAIT, stop, reset, start, and read_ms.
Dependents: DetectFreqAboveTH RN41
myTimer.h@7:8fbe0cf9d582, 2017-09-29 (annotated)
- Committer:
- AkinoriHashimoto
- Date:
- Fri Sep 29 07:05:10 2017 +0000
- Revision:
- 7:8fbe0cf9d582
- Parent:
- 6:4cb4eea64805
adj. wait_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 | 7:8fbe0cf9d582 | 22 | void wait_us(int waitTime, bool _START=true, bool _RESET=true, bool _STOP=true); |
AkinoriHashimoto | 0:04c9087b9ca9 | 23 | }; |
AkinoriHashimoto | 0:04c9087b9ca9 | 24 | |
AkinoriHashimoto | 0:04c9087b9ca9 | 25 | // EOF |