Plx使用手册学习-----10 PlxPci_NotificationWait

本文详细介绍了PLX_PCI_NotificationWait函数的使用方法,该函数用于等待与PLX通知对象相关联的特定中断发生或直到超时。文章解释了参数含义,包括设备指针、事件对象和超时时间,以及返回代码的解读,如成功、空参数、无效设备信息等。

Syntax:
 

PLX_STATUS
PlxPci_NotificationWait(
PLX_DEVICE_OBJECT *pDevice,
PLX_NOTIFY_OBJECT *pEvent,
U64 Timeout_ms
);


PLX Chip Support:
All PLX 9000 devices, 8311, 8000 DMA, 6000 NT, & 8000 NT
Description:

等待与PLX通知对象相关联的特定中断发生或直到超时。
Wait for a specific interrupt(s) associated with a PLX notification object to occur or until the timeout is reached.
Parameters:
pDevice
Pointer to an open device
pEvent
A pointer to a PLX notification object previously registered with PlxPci_NotificationRegisterFor.
Timeout_ms
The desired time to wait, in milliseconds, for the event to occur.

To wait forever, use the pre-defined value PLX_TIMEOUT_INFINITE.
Return Codes:

CodeDescription
ApiSuccessThe function returned successfully and at least one event ocurred
ApiNullParamOne or more parameters is NULL
ApiInvalidDeviceInfoThe device object is not a valid PLX device or has not been opened
ApiFailedThe notification object is not valid or not registered
ApiWaitTimeoutReached timeout waiting for event
ApiWaitCanceledWait event was cancelled

Usage:

PLX_STATUS rc;
PLX_INTERRUPT IntSources;
PLX_NOTIFY_OBJECT Event;
// Clear interrupt sources
memset(&IntSources, 0, sizeof(PLX_INTERRUPT));
// Register for interrupt notification
IntSources.DmaChannel_0 = 1;
rc =PlxPci_NotificationRegisterFor(pDevice,&IntSources,&Event);
if (rc != ApiSuccess)
{
// ERROR – Unable to register interrupt notification
}
// Wait for the interrupt
rc =PlxPci_NotificationWait(pDevice,&Event,10 * 1000 /* 10 second timeout*/);
switch (rc)
{
case ApiSuccess:
// Interrupt occurred
break;
case ApiWaitTimeout:
// ERROR - Timeout waiting for Interrupt Event
break;
case ApiWaitCanceled:
// ERROR – Event not registered for wait
break;
}

 

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值