LoginSignup
0
1

More than 5 years have passed since last update.

Zybo > Chronicles blog 19 > TTC > Interrupt設定例 > XTtcPs_EnableInterrupts() / XTTCPS_IXR_INTERVAL_MASK / xttcps_hw.h / ISRの例

Last updated at Posted at 2016-05-21

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-Three-Adam/ba-p/413105

There are several interrupts to choose from for each TTC. I have enabled only the interval interrupt in this instance:

XTtcPs_EnableInterrupts(TtcPsInt, XTTCPS_IXR_INTERVAL_MASK);

The file xttcps_hw.h, which is called up by xttcps.h, includes definitions for all possible TTC interrupts allowing them to be enabled as desired using the above function.

ソースコードでISRを設定しているのは以下の通り

XScuGic_Connect(GicInstancePtr, TTC_INTR_ID,
    (Xil_ExceptionHandler)TickHandler, (void *)TtcPsInt);

上記でコネクトしているTickHandlerは以下のような実装をしている

static void TickHandler(void *CallBackRef)
{
    u32 StatusEvent;

    StatusEvent = XTtcPs_GetInterruptStatus((XTtcPs *)CallBackRef);
    XTtcPs_ClearInterruptStatus((XTtcPs *)CallBackRef, StatusEvent);

    printf("event\n\r");
}
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1