Mark Gottscho / HardwareTimersLib

Fork of HardwareTimersLib by Mark Gottscho

Committer:
mgottscho
Date:
Sun Mar 09 03:02:55 2014 +0000
Revision:
2:5056ec8c52e8
Parent:
0:47acc8320421
Child:
7:78f6ee57d324
Refactored code and added new PIT timer support.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mgottscho 0:47acc8320421 1 /* HardwareTimer.cpp
mgottscho 0:47acc8320421 2 * Tested with mbed board: FRDM-KL46Z
mgottscho 0:47acc8320421 3 * Author: Mark Gottscho
mgottscho 0:47acc8320421 4 * mgottscho@ucla.edu
mgottscho 0:47acc8320421 5 */
mgottscho 0:47acc8320421 6
mgottscho 0:47acc8320421 7 #include "mbed.h"
mgottscho 0:47acc8320421 8 #include "HardwareTimer.h"
mgottscho 0:47acc8320421 9
mgottscho 2:5056ec8c52e8 10 HardwareTimer::HardwareTimer(float tickValue) :
mgottscho 0:47acc8320421 11 __valid(false),
mgottscho 0:47acc8320421 12 __enabled(false),
mgottscho 0:47acc8320421 13 __tickValue(tickValue)
mgottscho 0:47acc8320421 14 {
mgottscho 0:47acc8320421 15 }
mgottscho 0:47acc8320421 16
mgottscho 0:47acc8320421 17 HardwareTimer::~HardwareTimer() { }
mgottscho 0:47acc8320421 18
mgottscho 0:47acc8320421 19 bool HardwareTimer::valid() {
mgottscho 0:47acc8320421 20 return __valid;
mgottscho 0:47acc8320421 21 }
mgottscho 0:47acc8320421 22
mgottscho 0:47acc8320421 23 bool HardwareTimer::isEnabled() {
mgottscho 0:47acc8320421 24 return __enabled;
mgottscho 0:47acc8320421 25 }
mgottscho 0:47acc8320421 26
mgottscho 0:47acc8320421 27 float HardwareTimer::tickValue() {
mgottscho 0:47acc8320421 28 return __tickValue;
mgottscho 0:47acc8320421 29 }