temp.c

来自「vxWorks下pc1394的驱动程序」· C语言 代码 · 共 88 行

C
88
字号

/******************************************************************************
TITLE:  	pc1394DevSetAsyncRespReceiveCmdPtr
DESC:   	routine to set Async response receive command pointer register of PC 1394 card
PARAM:  	ulDescAdrs   - address of descriptor
         ulBlkNum     - number of continious block
RETURN: 	OK    - operation runs successfully
         ERROR - operation runs failed 
******************************************************************************/
STATUS pc1394DevSetAsyncRespReceiveCmdPtr(unsigned long ulDescAdrs, unsigned long ulBlkNum)
{
   unsigned long ulTempData;

   ulTempData = (ulDescAdrs & 0xfffffff0) | (ulBlkNum & 0x0000000f);

   pciWriteLong((int)pPc1394Dev.pciControllerSpace0 + ASY_RES_R_COMMANDPTR_ADR, ulTempData);

   return(OK);
}

/******************************************************************************
TITLE:  	pc1394DevGetAsyncRespReceiveCmdPtr
DESC:   	routine to get Async response receive command pointer register of PC 1394 card
PARAM:  	none
RETURN: 	OK    - operation runs successfully
         ERROR - operation runs failed 
******************************************************************************/
unsigned long pc1394DevGetAsyncRespReceiveCmdPtr(void)
{
   unsigned long ulTempData;

   ulTempData = pciReadLong((int)pPc1394Dev.pciControllerSpace0 + ASY_RES_R_COMMANDPTR_ADR);

   return(ulTempData);
}

/******************************************************************************
TITLE:  	pc1394DevSetAsyncRespReceiveCtxCtl
DESC:   	routine to set Async response receive context control register of PC 1394 card
PARAM:  	ulRegData      - data to write to register
RETURN: 	OK    - operation runs successfully
         ERROR - operation runs failed 
******************************************************************************/
STATUS pc1394DevSetAsyncRespReceiveCtxCtl(unsigned long ulRegData)
{
   unsigned long ulTempData;

   ulTempData = ulRegData;

   pciWriteLong((int)pPc1394Dev.pciControllerSpace0 + ASY_RES_R_CNTXT_CTR_SET_ADR, ulTempData);

   return(OK);
}

/******************************************************************************
TITLE:  	pc1394DevClrAsyncRespReceiveCtxCtl
DESC:   	routine to clear Async response receive context control register of PC 1394 card
PARAM:  	ulRegData      - data to write to register
RETURN: 	OK    - operation runs successfully
         ERROR - operation runs failed 
******************************************************************************/
STATUS pc1394DevClrAsyncRespReceiveCtxCtl(unsigned long ulRegData)
{
   unsigned long ulTempData;

   ulTempData = ulRegData;

   pciWriteLong((int)pPc1394Dev.pciControllerSpace0 + ASY_RES_R_CNTXT_CTR_CLR_ADR, ulTempData);

   return(OK);
}

/******************************************************************************
TITLE:  	pc1394DevGetAsyncRespReceiveCtxCtl
DESC:   	routine to get Async response receive command pointer register of PC 1394 card
PARAM:  	none
RETURN: 	OK    - operation runs successfully
         ERROR - operation runs failed 
******************************************************************************/
unsigned long pc1394DevGetAsyncRespReceiveCtxCtl(void)
{
   unsigned long ulTempData;

   ulTempData = pciReadLong((int)pPc1394Dev.pciControllerSpace0 + ASY_RES_R_CNTXT_CTR_SET_ADR);

   return(ulTempData);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?