MicroZed Chronicles リスト http://adiuvoengineering.com/?page_id=285
@ Adam Taylor blog
https://forums.xilinx.com/t5/Xcell-Daily-Blog/Introduction-to-the-Zynq-Triple-Timer-Counter-Part-Four-Adam/ba-p/416243
We will look at using the match registers to issue interrupts for different counter values.
...
We can OR the XTTCPS_OPTION_MATCH_MODE as defined within the xttcps.h file to enable the match mode along with the disabled waveform and interval mode.
...
次にトリガーを設定
XTtcPs_SetMatchValue(&Timer, 0, (interval/3));
内部カウンター(interval)はXTtcPs_GetInterval()にて取得。
次にmatch interruptを設定
XTtcPs_EnableInterrupts(TtcPsInt, XTTCPS_IXR_MATCH_0_MASK);
ISR(TickHandler()としている)では各interruptに対応する処理を書く
static void TickHandler(void *CallBackRef)
{
u32 StatusEvent;
StatusEvent = XTtcPs_GetInterruptStatus((XTtcPs *)CallBackRef);
XTtcPs_ClearInterruptStatus((XTtcPs *)CallBackRef, StatusEvent);
if (0 != (XTTCPS_IXR_INTERVAL_MASK & StatusEvent)) {
printf("interval interrupt event\n\r");
//XTtcPs_SetMatchValue(Timer, 0, *MatchReg);
}
if (0 != (XTTCPS_IXR_MATCH_0_MASK & StatusEvent)) {
printf("match interrupt event\n\r");
//XTtcPs_SetMatchValue(Timer, 0, *MatchReg);
}
}