亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? zl5011xgm.c

?? Zalink50114----TDMoIP芯片驅(qū)動源碼
?? C
?? 第 1 頁 / 共 2 頁
字號:

   if (status == ZL5011X_OK)
   {
      status = zl5011xWrite(zl5011xParams, ZL5011X_GM_GRANULE_TAIL,
            index << ZL5011X_GM_GRANULE_TAIL_BITS);

      zl5011xParams->packetMemory.granuleTailIndex = index;
   }

   return(status);
}

/*******************************************************************************

 Function:
    zl5011xGmGetTailGranule

 Description:
   Gets the index number of the tail granule.

 Inputs:
   zl5011xParams      Pointer to the structure for this device instance

 Outputs:
   index             gets the index number of the tail granule

 Returns:
   zlStatusE

 Remarks:
    None

*******************************************************************************/

zlStatusE zl5011xGmGetTailGranule(zl5011xParamsS *zl5011xParams, Uint32T *index)
{
   zlStatusE status = ZL5011X_OK;
   Uint32T readValue;

   ZL5011X_TRACE(ZL5011X_GM_FN_ID, "zl5011xGmGetTailGranule:", 0, 0, 0, 0, 0, 0);

   status = zl5011xRead(zl5011xParams, ZL5011X_GM_GRANULE_TAIL,
         &readValue);

   if (status == ZL5011X_OK)
   {
      *index = (readValue >> ZL5011X_GM_GRANULE_TAIL_BITS) & ZL5011X_GM_GRANULE_INDEX_MASK;

      ZL5011X_TRACE(ZL5011X_GM_FN_ID, "zl5011xGmGetTailGranule: index %d", *index, 0, 0, 0, 0, 0);
   }

   return(status);
}

/*******************************************************************************

 Function:
    zl5011xGmSetNumFreeGranules

 Description:
   Sets the number of available granules.

 Inputs:
   zl5011xParams      Pointer to the structure for this device instance
   count             sets the total number of granules available

 Outputs:
    None

 Returns:
   zlStatusE

 Remarks:
    None

*******************************************************************************/

zlStatusE zl5011xGmSetNumFreeGranules(zl5011xParamsS *zl5011xParams, Uint32T count)
{
   zlStatusE status = ZL5011X_OK;

   ZL5011X_TRACE(ZL5011X_GM_FN_ID, "zl5011xGmSetNumFreeGranules: count %d", count, 0, 0, 0, 0, 0);

   /* if the count value passed in is a bad number, or does not tie up with the
      tail and head pointers, then return an error */
   if ((count & ~ZL5011X_GM_GRANULE_COUNT_MASK) != 0)
   {
      status = ZL5011X_PARAMETER_INVALID;
   }

   if (status == ZL5011X_OK)
   {
      status = zl5011xWrite(zl5011xParams, ZL5011X_GM_GRANULE_COUNT,
            count << ZL5011X_GM_GRANULE_COUNT_BITS);

      zl5011xParams->packetMemory.granuleCount = count;
   }

   return(status);
}

/*******************************************************************************

 Function:
    zl5011xGmGetNumFreeGranules

 Description:
   Gets the number of available granules.

 Inputs:
   zl5011xParams      Pointer to the structure for this device instance

 Outputs:
   count             gets the total number of granules available

 Returns:
   zlStatusE

 Remarks:
    None

*******************************************************************************/

zlStatusE zl5011xGmGetNumFreeGranules(zl5011xParamsS *zl5011xParams, Uint32T *count)
{
   zlStatusE status = ZL5011X_OK;
   Uint32T readValue;

   ZL5011X_TRACE(ZL5011X_GM_FN_ID, "zl5011xGmGetNumFreeGranules: ", 0, 0, 0, 0, 0, 0);

   status = zl5011xRead(zl5011xParams, ZL5011X_GM_GRANULE_COUNT,
         &readValue);

   if (status == ZL5011X_OK)
   {
      *count = (readValue >> ZL5011X_GM_GRANULE_COUNT_BITS) & ZL5011X_GM_GRANULE_COUNT_MASK;

      ZL5011X_TRACE(ZL5011X_GM_FN_ID, "zl5011xGmGetNumFreeGranules: count %d", *count, 0, 0, 0, 0, 0);
   }

   return(status);
}

/*******************************************************************************

 Function:
    zl5011xGmSetGranuleThreshold

 Description:
   Sets the granule threshold, which is used to generate an interrupt.

 Inputs:
   zl5011xParams      Pointer to the structure for this device instance
   count             granule threshold.

 Outputs:
    None

 Returns:
   zlStatusE

 Remarks:
    None

*******************************************************************************/

zlStatusE zl5011xGmSetGranuleThreshold(zl5011xParamsS *zl5011xParams, Uint32T count)
{
   zlStatusE status = ZL5011X_OK;

   ZL5011X_TRACE(ZL5011X_GM_FN_ID, "zl5011xGmSetGranuleThreshold: count %d", count, 0, 0, 0, 0, 0);

   /* if the threshold value passed in is a bad number, or is not less than the total
      number of granules, then return an error */
   if (((count & ~ZL5011X_GM_GRANULE_THRESHOLD_MASK) != 0) ||
      (count > (zl5011xParams->packetMemory.granuleTailIndex - zl5011xParams->packetMemory.granuleHeadIndex + 1)))
   {
      status = ZL5011X_PARAMETER_INVALID;
   }

   if (status == ZL5011X_OK)
   {
      status = zl5011xWrite(zl5011xParams, ZL5011X_GM_GRANULE_THRESHOLD,
            count << ZL5011X_GM_GRANULE_THRESHOLD_BITS);
   }

   zl5011xParams->packetMemory.granuleThreshold = count;

   return(status);
}

/*******************************************************************************

 Function:
    zl5011xGmCheckGranules

 Description:
   Checks the granule chain for errors.

 Inputs:
   zl5011xParams      Pointer to the structure for this device instance

 Outputs:
    None

 Returns:
   zlStatusE

 Remarks:
   This function can only be run when no granule chain operations are being
   performed - that is, the device should be in freeze state.

*******************************************************************************/

zlStatusE zl5011xGmCheckGranules(zl5011xParamsS *zl5011xParams)
{
   zlStatusE status = ZL5011X_OK;
   Uint32T headPtr, tailPtr, numGranules;
   Uint32T loop;
   Uint32T currPtr, address;

   ZL5011X_TRACE(ZL5011X_GM_FN_ID, "zl5011xGmCheckGranules:", 0, 0, 0, 0, 0, 0);

   /* get the current granule info from the device */
   status = zl5011xGmGetTailGranule(zl5011xParams, &tailPtr);

   if (status == ZL5011X_OK)
   {
      status = zl5011xGmGetHeadGranule(zl5011xParams, &headPtr);
   }

   if (status == ZL5011X_OK)
   {
      status = zl5011xGmGetNumFreeGranules(zl5011xParams, &numGranules);
   }

   /* check that there aren't more free granules than when the device
      was initialised */
   if (status == ZL5011X_OK)
   {
      if ((zl5011xParams->packetMemory.granuleTailIndex > zl5011xParams->packetMemory.granuleCount) ||
         (zl5011xParams->packetMemory.granuleHeadIndex > zl5011xParams->packetMemory.granuleCount))
      {
         status = ZL5011X_NUM_FREE_GRANULES_ERROR;
      }
   }

   /* starting at the head of the granule chain, check that the chain
      is consistent and that the tail pointer is correct */
   currPtr = headPtr;

   for (loop = 0; loop < numGranules; loop++)
   {
      /* check that haven't reached the end of the chain yet */
      if ((status != ZL5011X_OK) || (currPtr == tailPtr))
      {
         break;
      }

      address = zl5011xParams->packetMemory.granDescBaseAddr +
            (currPtr * ZL5011X_GRANULE_DESCRIPTOR_SIZE);

      status = zl5011xRead(zl5011xParams, address, &currPtr);

      currPtr = (currPtr >> ZL5011X_GRANULE_NEXT_GRN_BITS) & ZL5011X_GRANULE_NEXT_GRN_MASK;

      if (currPtr > zl5011xParams->packetMemory.granuleCount + 1)
      {
         status = ZL5011X_GRANULE_CHAIN_ERROR;
      }
   }

   if (status == ZL5011X_OK)
   {
      /* the loop been exited on the tail pointer, so check that the loop
         had completed i.e. the tail is at the end of the chain */
      if ((loop != numGranules) || (currPtr != tailPtr))
      {
         status = ZL5011X_GRANULE_CHAIN_ERROR;
      }
   }

   return(status);
}


/*******************************************************************************

 Function:
    zl5011xGmEnableInterrupts

 Description:
   This function is used to enable granule interrupts.

Inputs:
   zl5011xParams   Pointer to the structure for this device instance
   interruptMask  interrupt bit= ONE in this parameter to enable an interrupt

 Outputs:
    None

 Returns:
   zlStatusE

 Remarks:
      clear the intr reg by reading  the value back. Assume this is correct method.


*******************************************************************************/
zlStatusE zl5011xGmEnableInterrupts(zl5011xParamsS *zl5011xParams,
          Uint32T interruptMask)
{
   zlStatusE status = ZL5011X_OK;
   Uint32T bitMask, readValue;

   ZL5011X_TRACE(ZL5011X_GM_FN_ID, "zl5011xGmEnableInterrupts: enable %08X", interruptMask, 0, 0, 0, 0, 0);

   bitMask = (ZL5011X_1BIT_MASK << ZL5011X_GM_GRANULE_ERROR_INT) |
         (ZL5011X_1BIT_MASK << ZL5011X_GM_GRANULE_OVERRUN_INT) |
         (ZL5011X_1BIT_MASK << ZL5011X_GM_GRANULE_THRESHOLD_INT);

   if ((interruptMask & ~bitMask) != 0)
   {
      status = ZL5011X_PARAMETER_INVALID;
   }
   if(status == ZL5011X_OK)
   {
      /* read the value back from the register, to clear - I hope */
      status = zl5011xRead(zl5011xParams, ZL5011X_GM_INTERRUPT_STATUS, &readValue);
   }


   if(status == ZL5011X_OK)
   {
      /* clear the mask bits from the parameter to enable the interrupt */
      status = zl5011xReadModWrite(zl5011xParams,
            ZL5011X_GM_INTERRUPT_MASK,
            0, interruptMask);
   }

   if(status == ZL5011X_OK)
   {
      /* read the value back from the register, to save in the device structure */
      status = zl5011xRead(zl5011xParams, ZL5011X_GM_INTERRUPT_MASK,
            &readValue);

      /* mask out the bits that aren't to do with the interrupts */
      readValue &= bitMask;

      zl5011xParams->interruptMasks.gmMask = readValue;
   }

   return(status);
}

/*******************************************************************************

 Function:
    zl5011xGmDisableInterrupts

 Description:
   This function is used to disable granule interrupts.

Inputs:
   zl5011xParams   Pointer to the structure for this device instance
   interruptMask  interrupt bit= ONE in this parameter to disable an interrupt

 Outputs:
    None

 Returns:
   zlStatusE

 Remarks:
    None

*******************************************************************************/
zlStatusE zl5011xGmDisableInterrupts(zl5011xParamsS *zl5011xParams,
                                    Uint32T interruptMask)
{
   zlStatusE status = ZL5011X_OK;
   Uint32T bitMask, readValue;

   ZL5011X_TRACE(ZL5011X_GM_FN_ID, "zl5011xGmDisableInterrupts: disable %08X", interruptMask, 0, 0, 0, 0, 0);

   bitMask = (ZL5011X_1BIT_MASK << ZL5011X_GM_GRANULE_ERROR_INT) |
         (ZL5011X_1BIT_MASK << ZL5011X_GM_GRANULE_OVERRUN_INT) |
         (ZL5011X_1BIT_MASK << ZL5011X_GM_GRANULE_THRESHOLD_INT);

   if ((interruptMask & ~bitMask) != 0)
   {
      status = ZL5011X_PARAMETER_INVALID;
   }

   if(status == ZL5011X_OK)
   {
      /* set the mask bits from the parameter to disable the interrupt */
      status = zl5011xReadModWrite(zl5011xParams,
            ZL5011X_GM_INTERRUPT_MASK,
            interruptMask, interruptMask);
   }

   if(status == ZL5011X_OK)
   {
      /* read the value back from the register, to save in the device structure */
      status = zl5011xRead(zl5011xParams, ZL5011X_GM_INTERRUPT_MASK,
            &readValue);

      /* mask out the bits that aren't to do with the interrupts */
      readValue &= bitMask;

      zl5011xParams->interruptMasks.gmMask = readValue;
   }

   return(status);
}

/*******************************************************************************

 Function:
    zl5011xGmGetStatus

 Description:
   Returns the value from the status register

 Inputs:
   zl5011xParams      Pointer to the structure for this device instance

 Outputs:
    gmStatus         returns the status of the interrupt bits

 Returns:
   zlStatusE

 Remarks:
    None
*******************************************************************************/
zlStatusE zl5011xGmGetStatus(zl5011xParamsS *zl5011xParams, Uint32T *gmStatus)
{

   zlStatusE status = ZL5011X_OK;

   ZL5011X_TRACE(ZL5011X_GM_FN_ID, "zl5011xGmGetStatus:", 0, 0, 0, 0, 0, 0);

   status = zl5011xRead(zl5011xParams, ZL5011X_GM_INTERRUPT_STATUS, gmStatus);

   *gmStatus &= (ZL5011X_1BIT_MASK << ZL5011X_GM_GRANULE_ERROR_INT) |
         (ZL5011X_1BIT_MASK << ZL5011X_GM_GRANULE_OVERRUN_INT) |
         (ZL5011X_1BIT_MASK << ZL5011X_GM_GRANULE_THRESHOLD_INT);

   return(status);
}


/*****************   END   ****************************************************/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕免费观看一区| 亚洲综合久久久久| 欧美日韩视频在线观看一区二区三区 | 亚洲精品欧美二区三区中文字幕| 国产色一区二区| 2024国产精品| 欧美日韩国产高清一区二区三区| 欧美亚洲自拍偷拍| 欧美人xxxx| 欧美日韩精品一区二区三区 | 成人av在线观| youjizz久久| 亚洲国产精品一区二区www在线| 18欧美乱大交hd1984| 亚洲精品免费电影| 国产精品正在播放| 91日韩在线专区| 国产福利电影一区二区三区| 亚洲综合在线观看视频| 欧美亚洲国产一区二区三区va| 亚洲国产人成综合网站| 自拍av一区二区三区| 国产老女人精品毛片久久| 久久久久久久综合日本| 色欧美乱欧美15图片| 国产一区在线观看视频| 欧美疯狂做受xxxx富婆| 一区二区三区**美女毛片| 日本丰满少妇一区二区三区| 国产精品美女久久久久久2018| 高清shemale亚洲人妖| 亚洲国产精品国自产拍av| 亚洲成人激情自拍| 国产一区免费电影| 国产馆精品极品| 99久久久无码国产精品| 欧美日韩国产高清一区二区三区| 91精品国产综合久久久蜜臀粉嫩| 国产在线不卡一区| 日韩电影网1区2区| 琪琪一区二区三区| 日韩区在线观看| 日本韩国一区二区三区视频| 亚洲成av人片| 日韩欧美在线影院| 国产成人在线视频网站| 综合亚洲深深色噜噜狠狠网站| 欧美在线影院一区二区| 岛国精品在线播放| 天使萌一区二区三区免费观看| 制服.丝袜.亚洲.中文.综合| 国产精品电影一区二区| 亚洲精品成人在线| 亚洲电影视频在线| 国产精品理论片| 精品久久久久久无| 欧美日韩一级黄| 91麻豆swag| 成人免费视频一区| 国产一区二区三区免费播放 | 国内精品久久久久影院色| 尤物在线观看一区| 国产精品毛片a∨一区二区三区| 欧美一区二区三区免费| 日本三级亚洲精品| 亚洲一区在线观看视频| 国产色一区二区| 精品视频在线免费观看| 麻豆精品在线播放| 国产欧美一区二区三区在线老狼| 99久久伊人精品| 免费在线看成人av| 夜夜嗨av一区二区三区四季av| 国产一区欧美一区| 精品99一区二区| 九色综合国产一区二区三区| 在线视频欧美精品| 不卡在线视频中文字幕| 国产精品久久久久久久久果冻传媒| 一区二区不卡在线视频 午夜欧美不卡在| 欧美一区二区精品在线| 亚洲国产精品一区二区www在线| 亚洲高清中文字幕| 国产精品12区| 另类调教123区| 中文字幕五月欧美| 欧美日韩精品一区二区天天拍小说 | 成人av免费网站| 欧美最猛黑人xxxxx猛交| 色国产综合视频| 欧美精品日韩一本| 久久免费偷拍视频| 色婷婷久久久久swag精品| 亚洲综合激情另类小说区| 一区二区欧美国产| 国产精品乱人伦| 久久久久久久久久久久久久久99| 欧美日高清视频| 欧美性猛片xxxx免费看久爱| 99国产精品久久久久| 色偷偷成人一区二区三区91| 久久久久久亚洲综合影院红桃| 欧美日韩国产一区二区三区地区| 国产精品一区2区| 奇米色777欧美一区二区| 午夜精品一区二区三区免费视频| 自拍偷拍亚洲综合| 亚洲国产美国国产综合一区二区| 欧美极品美女视频| 国产精品素人视频| 久久久久久久av麻豆果冻| 欧美一区三区四区| 国产亚洲综合在线| 蜜臀久久久99精品久久久久久| 国产成人av电影在线| 久久精品国产免费| 91精品国产乱码久久蜜臀| 亚洲视频在线观看三级| 伊人开心综合网| 成人精品免费看| 久久久综合视频| 国产精品 日产精品 欧美精品| 欧美一级片在线| 亚洲色图都市小说| 秋霞午夜av一区二区三区| 国产成人精品一区二区三区网站观看| 91麻豆蜜桃一区二区三区| 日韩欧美的一区| 亚洲人成伊人成综合网小说| 久久66热re国产| 欧美在线视频你懂得| 中文字幕 久热精品 视频在线| 亚洲国产成人av网| 不卡影院免费观看| 精品国内二区三区| 午夜视黄欧洲亚洲| 成人福利在线看| 亚洲精品在线免费播放| 亚洲电影在线播放| eeuss鲁一区二区三区| 精品国产一区二区三区四区四 | av激情亚洲男人天堂| 制服丝袜成人动漫| 亚洲一区二区在线免费看| 国产91精品入口| 精品粉嫩超白一线天av| 日韩av二区在线播放| 欧美午夜影院一区| 中文字幕日韩av资源站| 国产精品一区专区| 精品不卡在线视频| 青青青伊人色综合久久| 欧美日韩一区二区三区在线看 | 亚洲精品在线一区二区| 亚洲福利一区二区| 91蝌蚪porny成人天涯| 成人av电影在线| 色婷婷综合久久久久中文一区二区| 精品剧情v国产在线观看在线| 一区二区三区欧美久久| 91一区二区三区在线观看| 久久精品视频免费| 国产精品综合一区二区| 欧美大尺度电影在线| 日本伊人色综合网| 91精品国产高清一区二区三区蜜臀 | 国产日产欧美一区| 国产又粗又猛又爽又黄91精品| 欧美一区永久视频免费观看| 麻豆精品在线观看| xfplay精品久久| 国产激情91久久精品导航| 久久精品男人天堂av| 成人午夜视频在线观看| 日本一区二区三区免费乱视频| 国产乱码精品一区二区三区忘忧草 | 国产精品久久久久一区| 成人美女在线观看| 中文字幕一区二区视频| 99久久精品费精品国产一区二区| 中文字幕免费不卡| 成人黄色免费短视频| 国产精品久久久久9999吃药| aaa欧美大片| 亚洲最大成人网4388xx| 4438x成人网最大色成网站| 日韩激情一区二区| 日韩一区二区精品葵司在线 | 亚洲bt欧美bt精品777| 日韩一二三区不卡| 蜜桃一区二区三区四区| 精品国产乱码久久久久久蜜臀| 国产精品一区二区果冻传媒| 国产精品久久久久9999吃药| 欧美日韩一区二区在线观看| 裸体歌舞表演一区二区| 国产精品不卡在线| 欧美日韩另类国产亚洲欧美一级| 青青草精品视频| 欧美高清在线一区二区|