Counts signal transitions on p30(CAP2.0) or p29(CAP2.1) for LPC1768 target. Can detecte rising, falling or both signal edge. Return the signal edge count during a period in seconds. In theory (Shannon's theorem) input signal frequency can up to 48 MHz with 96 MHz CCLK. But only tested with frequencys up to 20 MHz and it work.

Files at this revision

API Documentation at this revision

Comitter:
YSI
Date:
Tue Jan 07 15:00:14 2020 +0000
Parent:
3:20dd01b1a1fd
Child:
5:b5e68cd91f09
Commit message:
add switch default

Changed in this revision

lib_ClockCounter.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/lib_ClockCounter.cpp	Tue Jan 07 14:55:10 2020 +0000
+++ b/lib_ClockCounter.cpp	Tue Jan 07 15:00:14 2020 +0000
@@ -42,6 +42,8 @@
                                                                     // CCR => Capture Control Register
             LPC_TIM2->CCR = 0x0;                                    // Bits(5,4,3,2,1,0) 000000 => capture and interrupt on event disabled
         break;
+        default:
+        break;
     }
 }