如图,我将3个信号作为中断信号同时给了PS和XDMA,我在PS中用SDK检测3个中断信号
GicConfig = XScuGic_LookupConfig(XPAR_PS7_SCUGIC_0_DEVICE_ID);
XScuGic_CfgInitialize(&InterruptController, GicConfig,GicConfig->CpuBaseAddress);
Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT,
(Xil_ExceptionHandler) XScuGic_InterruptHandler,
&InterruptController);
Xil_ExceptionEnable();
XScuGic_Connect(&InterruptController, PULSE_EVENT,
(Xil_ExceptionHandler)PULSE_EVENT_Handler,
(void *)&InterruptController);
XScuGic_Connect(&InterruptController, IRQ_EVENT,
(Xil_ExceptionHandler)IRQ_EVENT_Handler,
(void *)&InterruptController);
XScuGic_Connect(&InterruptController, OVERFLOW_EVENT,
(Xil_ExceptionHandler)OVERFLOW_EVENT_Handler,
(void *)&InterruptController);
XScuGic_SetPriorityTriggerType(&InterruptController, PULSE_EVENT,40,0b11);
XScuGic_SetPriorityTriggerType(&InterruptController, IRQ_EVENT,40,0b11);
XScuGic_SetPriorityTriggerType(&InterruptController, OVERFLOW_EVENT,40,0b11);
XScuGic_Enable(&InterruptController, PULSE_EVENT);
XScuGic_Enable(&InterruptController, IRQ_EVENT);
XScuGic_Enable(&InterruptController, OVERFLOW_EVENT);
显示中断信号识别正常,采用的是上升沿触发模式
但是我在Linux QT中, 根据汤老板的代码
event1_fd = open("/dev/xdma0_events_1",O_RDWR | O_SYNC);
if(event1_fd < 0)
return -3;
event0_fd = open("/dev/xdma0_events_0",O_RDWR | O_SYNC);
if(event0_fd < 0)
return -4;
event2_fd = open("/dev/xdma0_events_2",O_RDWR | O_SYNC);
if(event2_fd < 0)
return -5;
int read_event(int fd)
{
int val;
read(fd,&val,4);
return val;
}
void pulseeventthread::run()
{
while(1)
{
read_event(event0_fd);
emit sig_pulse_event_emit();
}
}
connect(&pulse_event_thread,SIGNAL(sig_pulse_event_emit()),this,SLOT(pulse_event_occurs()));
void MainWindow::pulse_event_occurs()
{
ui->lb_pulse_event->setText("get event");
}
发现read_event得不到这3个中断信号,请问下汤老板有遇到这样的情况吗,
驱动测试读写h2c c2h和 user 都可以正常工作了
|
|