Library to simplify using capture pins on hardware.
When I first started experimenting with the notion of capture pins, I had no idea where to begin. Rather than write to registers in every single program, I decided to create a class that'd handle that heavy lifting for me!
Import library
Public Member Functions |
|
TimerCapture (PinName pCapturePin) | |
Configures registers to use the given pin as a capture pin.
|
|
uint32_t | getTime () |
Get the time captured by the capture pin's register.
|
|
Static Public Member Functions |
|
static void | startTimer () |
Starts the TIMER2 timer, and configures it if it's not already configured.
|
|
static bool | isRunning () |
Checks if the TIMER2 timer is running.
|
|
static void | stopTimer () |
Stops the TIMER2 timer.
|
|
static void | resetTimer () |
Resets the TIMER2 timer.
|
This code uses TIMER2 on the LPC1768. I have no idea if it will work on other hardware, but I hope it helps someone else!
History
Tuning tick counter to behave correctly.;
2015-06-10, by dishbreak [Wed, 10 Jun 2015 06:21:13 +0000] rev 4
Tuning tick counter to behave correctly.;
More documentation polishing.
2015-05-21, by dishbreak [Thu, 21 May 2015 08:34:46 +0000] rev 3
More documentation polishing.
Fixing documentation. Adding bug handling.
2015-05-21, by dishbreak [Thu, 21 May 2015 08:30:25 +0000] rev 2
Fixing documentation. Adding bug handling.
updating documentation.
2015-05-21, by dishbreak [Thu, 21 May 2015 08:11:06 +0000] rev 1
updating documentation.
Initial commit of TimerCapture code.
2015-05-21, by dishbreak [Thu, 21 May 2015 08:04:03 +0000] rev 0
Initial commit of TimerCapture code.