在platform_zynqmp.c文件的platform_setup_timer函数中,首先采用XTtcPs_CfgInitialize函数对TimerInstance全局变量进行初始化,让TimerInstance和硬件的定时器0(ID为XPAR_PSU_TTC_0_DEVICE_ID)绑定,并让TimerInstance的寄存器地址和定时器0的地址绑定,同时初始化定时器0的寄存器(大都赋值为0),禁止定时器中断: Config = ...
(Xil_ExceptionHandler)timer_callback, (void *)&TimerInstance); XScuGic_EnableIntr(INTC_DIST_BASE_ADDR, TIMER_IRPT_INTR); XScuTimer_EnableInterrupt(&TimerInstance); XScuTimer_Start(&TimerInstance); //1、PPI 私有定时器中断设置 方法2 XScuGic_Connect(GicInstancePtr, TimerIntrId, (Xil_ExceptionH...
static void TimerIntrHandler(void *CallBackRef); int main() { XScuTimer_Config *TMRConfigPtr; //timer config printf("---START---\n"); // init_platform(); // //私有定时器初始化 TMRConfigPtr = XScuTimer_LookupConfig(TIMER_DEVICE_ID); XScuTimer_CfgInitialize(&Timer, TMRConfigPtr,TMR...
XScuTimer_EnableInterrupt(TimerInstancePtr); /* * Initialize the exception table and register the interrupt * controller handler with the exception table */ exception_enable(&Intc); IntrFlag = 0; return XST_SUCCESS; } void GpioHandler(void *CallbackRef) { XGpio *GpioPtr = (XGpio *)Callb...
static void TimerIntrHandler(void *CallBackRef) { static int sec = 0; //计数 XScuTimer *TimerInstancePtr = (XScuTimer *) CallBackRef; XScuTimer_ClearInterruptStatus(TimerInstancePtr); sec++; printf(" %d Second\n\r",sec); //每秒打印输出一次 ...
其中TimerIntrHandler 是中断发生时要调用的函数的名称。 接下来,必须在 GIC 上和定时器本身内启用定时器中断。定时器中断服务程序非常简单。它只是清除挂起的中断并通过 STDOUT 写出一条消息: 代码语言:javascript 复制 staticvoidTimerIntrHandler(void*CallBackRef){XScuTimer*TimerInstancePtr=(XScuTimer*)CallBack...
1.staticvoidvTimerCallback(TimerHandle_tpxTimer)2.{3.longlTimerId;4.configASSERT(pxTimer);5.6.lTimerId=(long)pvTimerGetTimerID(pxTimer);7.8.if(lTimerId!=TIMER_ID){9.xil_printf("FreeRTOS Hello World Example FAILED");10.}11.12./* If the RxtaskCntr is updated every time the Rx task...
static?void?TimerIntrHandler(void?*CallBackRef);int?main(){??XScuTimer_Config?*TMRConfigPtr;???//timer?config??printf("---START---\n");??//私有定时器初始化??TMRConfigPtr?=? zynq的定时器中断实验 来自淘豆网www.taodocs.com转载请标明出处. 文档信息 页数:4 收藏数:0 顶...
本节课封装了sys_intr中断函数,以及timer_intr中断函数,其中,sys_intr负责控制整个中断的启动,而timer_intr函数负责管理timer中断。 8.7.1 timer_intr.c #include"timer_intr.h" volatileintusec; staticvoidTimerIntrHandler(void*CallBackRef) { XScuTimer*TimerInstancePtr = (XScuTimer*) CallBackRef; ...
/* Runtime PM callback shared between ->runtime_suspend() * and ->runtime_resume(). Simply returns success. * * In this driver pm_runtime_get_sync() and pm_runtime_put_sync() * are used at open() and release() time. This allows the ...