MSPM0_ValvanoWare  1.0
ECE445L starter code
InputCapture.h
Go to the documentation of this file.
1 
32 #ifndef __INPUTCAPTURE_H__
33 #define __INPUTCAPTURE_H__
34 
35 
36 
40 #define INPUTCAPTUREUSELFCLK 2
44 #define INPUTCAPTUREUSEMFCLK 4
48 #define INPUTCAPTUREUSEBUSCLK 8
49 
96 void InputCapture_Init(uint32_t timerClkSrc, uint32_t timerClkPrescale, uint32_t priority);
97 
98 
99 // Power Domain PD1
100 // dual signal waves connected to
101 // PB8 ELA TA0_C0
102 // PB12 ERA TA0_C1
103 // initialize A0 for rising edge input capture interrupt
104 // for 32MHz bus clock, Timer clock is 32MHz
105 // for 40MHz bus clock, Timer clock is MCLK 40MHz
106 // for 80MHz bus clock, Timer clock is MCLK 80MHz
107 // Arm interrupts on rising edge of PB8, PB12
108 // interrupts will be enabled in main after all initialization
109 // timerClkSrc = 2 for 32768 Hz LFCLK
110 // = 4 for 4MHz MFCLK
111 // = 8 for 80/32/4 BUSCLK
112 // prescale divide clock by prescale+1, 0 to 255
113 // priority is 0(highest),1,2 or 3(lowest)
114  /*
115  * timerClkSrc could be 80 MHz, 40MHz, 32MHz, 4MHz, or 32767Hz
116  * timerClkDivRatio = 1
117  * timerClkFreq = (timerClkSrc / (timerClkDivRatio * (timerClkPrescale + 1)))
118  * resolution = (timerClkDivRatio * (timerClkPrescale + 1)))/timerClkSrc
119  * For example, source=LFCLK, prescale=255, resolution = 7.8125ms
120  * For example, source=BUSCLK, prescale=79, resolution = 1us
121  */
122 void InputCapture_InitDual(uint32_t timerClkSrc, uint32_t timerClkPrescale, uint32_t priority);
123 
124 #endif // __INPUTCAPTURE_H__
void InputCapture_Init(uint32_t timerClkSrc, uint32_t timerClkPrescale, uint32_t priority)
Initialize input capture.