Merge branch 'timer_doc_update' of ssh://github.com/naveenkaje/mbed-os into naveenkaje-timer_doc_update

pull/8410/head
Cruz Monrreal II 2018-10-12 12:07:25 -05:00
commit 9489972a3e
1 changed files with 11 additions and 8 deletions

View File

@ -30,7 +30,7 @@ namespace mbed {
* *
* Example: * Example:
* @code * @code
* // Count the time to toggle a LED * // Count the time to toggle an LED
* *
* #include "mbed.h" * #include "mbed.h"
* *
@ -65,7 +65,7 @@ public:
/** Reset the timer to 0. /** Reset the timer to 0.
* *
* If it was already counting, it will continue * If it was already running, it will continue
*/ */
void reset(); void reset();
@ -75,15 +75,15 @@ public:
*/ */
float read(); float read();
/** Get the time passed in milli-seconds /** Get the time passed in milliseconds
* *
* @returns Time passed in milli seconds * @returns Time passed in milliseconds
*/ */
int read_ms(); int read_ms();
/** Get the time passed in micro-seconds /** Get the time passed in microseconds
* *
* @returns Time passed in micro seconds * @returns Time passed in microseconds
*/ */
int read_us(); int read_us();
@ -91,18 +91,21 @@ public:
*/ */
operator float(); operator float();
/** Get in a high resolution type the time passed in micro-seconds. /** Get in a high resolution type the time passed in microseconds.
* Returns a 64 bit integer.
*/ */
us_timestamp_t read_high_resolution_us(); us_timestamp_t read_high_resolution_us();
#if !defined(DOXYGEN_ONLY)
protected: protected:
us_timestamp_t slicetime(); us_timestamp_t slicetime();
int _running; // whether the timer is running int _running; // whether the timer is running
us_timestamp_t _start; // the start time of the latest slice us_timestamp_t _start; // the start time of the latest slice
us_timestamp_t _time; // any accumulated time from previous slices us_timestamp_t _time; // any accumulated time from previous slices
const ticker_data_t *_ticker_data; const ticker_data_t *_ticker_data;
bool _lock_deepsleep; // flag which indicates if deep-sleep should be disabled bool _lock_deepsleep; // flag that indicates if deep sleep should be disabled
}; };
#endif
} // namespace mbed } // namespace mbed