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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? toucan.c

?? 美國wind river 公司的CAN總線源代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
}/************************************************************************** TouCAN_Tx - Transmits the CAN message** This function transmits the CAN Id and data currently in the channel of* the specified controller on the device. The mode of the channel must be* WNCAN_CHN_TRANSMIT or WNCAN_CHN_RTR_REQUESTER** RETURNS:        OK or ERROR*   * ERRNO:          S_can_illegal_channel_no*                 S_can_illegal_config**/static STATUS TouCAN_Tx( struct WNCAN_Device *pDev, UCHAR channelNum ){    struct canAccess *pcanAccess;        TouCAN            pTouCanRegs;    TouCANBuf         pTouCanBufs;    volatile TouCAN_StandardMsgType *buffer;        STATUS            retCode = ERROR; /* pessimistic */        volatile USHORT   len=0;        if (channelNum >= TOUCAN_MAX_MSG_OBJ)    {        errnoSet(S_can_illegal_channel_no);        goto exit;    }    else if((pDev->pCtrl->chnMode[channelNum] != WNCAN_CHN_TRANSMIT) &&        (pDev->pCtrl->chnMode[channelNum] != WNCAN_CHN_RTR_REQUESTER))    {        errnoSet(S_can_illegal_config);                goto exit;    }        /*    * Get pointer to TouCAN registers and channels.        */      pcanAccess = (struct canAccess *)pDev->pCtrl->csData;    pTouCanRegs = (TouCAN)pcanAccess->pTouCanRegs;          pTouCanBufs = (TouCANBuf)pcanAccess->pTouCanBufs;           buffer = &pTouCanBufs->can_MSG[channelNum];                 /*    * Check if tx request is set before transmitting     * only a write access will deactivate a transmit     * buffer, so this is safe    */       if((buffer->Control & 0x00c0) == 0x00c0)    {        errnoSet(S_can_busy);        goto exit;    }        /*    * Make a copy of the length before writing to control field    * of channel. This is done since we want to clear any previous    * control code setting.    */    len = buffer->Control & 0x000f;                     /*    * Request a transmission and write length if channel is marked    * as a transmit or remote requester channel    */                buffer->Control = (TOUCAN_TX | len);                                    retCode = OK;           exit:       return retCode;}/************************************************************************** TouCAN_SetGlobalRxFilter - set the global receive filter** This function sets the global HW filter mask for incoming messages on the * device controller. If the controller does not have a global filter this* function is a no-op. If the ext parameter is TRUE, the mask value applies* to extended messages; otherwise, the mask values applies to standard * messages. A value of "0" for a particular bit position of the mask means * don't care (i.e. the incoming message Id could have a value of zero or * one for this bit position); otherwise, a value of 1 means the * corresponding bit of the message Id must match identically.** WARNING: Only one global filter exists on the controller. This is shared* by standard and extended identifiers. These routines cannot be called from* an interrupt level.** RETURNS: OK ** ERRNO:   N/A**/static STATUS TouCAN_SetGlobalRxFilter( struct WNCAN_Device *pDev, long maskVal,  BOOL  ext ){    struct canAccess *pcanAccess;    TouCAN     pTouCANRegs;        ULONG      mask;    ULONG      temp;    USHORT     regMCR;        /*    * Get pointer to TouCAN registers and channels.        */        pcanAccess = (struct canAccess *)pDev->pCtrl->csData;    pTouCANRegs = (TouCAN)pcanAccess->pTouCanRegs;            /*    Check if controller is in configuration change enable mode    if not set HALT bit    */    regMCR = pTouCANRegs->can_MCR;        if((regMCR & TOUCAN_HALT) != TOUCAN_HALT)        TouCANSetHaltFrz(pTouCANRegs);              if (ext == TRUE)    {        /* Adjust mask bit 28 to be the MSB */        temp = (ULONG)maskVal;        temp = temp << 3;                /* create the holes (the 0x8) between mask bits 18 and 17 */        /* Put mask bits 17 to 0 in place */        mask = (temp & TOUCAN_M17TO0) >> 2;                /* Put mask bits 28 to 18 in place */        mask |= (temp & TOUCAN_M28TO18);            }    else    {        temp = (ULONG)maskVal;        /* Adjust mask bit 28 to be the MSB */              mask = (temp << 21) & 0xffe00000;    }        /* Place 01 between mask bits 18 and 17 */    mask |= 0x00080000;        pTouCANRegs->can_RxGlobalMask = mask;        /* restore controller mode */    if((regMCR & TOUCAN_HALT) != TOUCAN_HALT)        TouCANResetHaltFrz(pTouCANRegs);                return OK;}/************************************************************************** TouCAN_GetGlobalRxFilter - Gets the global HW filter mask programmed.** This function return the programmed value in the Global filter resgiter* Based on the value of ext passed to the function, this function reads the * appropriate format of the global mask, and returns the value in the specified,* extended or standard identifier format.* If the controller does not have a global mask, a value of -1 is returned.** RETURNS: long: mask** ERRNO:   N/A**/static long TouCAN_GetGlobalRxFilter( struct WNCAN_Device *pDev, BOOL   ext ){    struct canAccess *pcanAccess;    TouCAN            pTouCanRegs;        ULONG             mask, val;        /*    * Get pointer to TouCAN registers and channels.        */        pcanAccess = (struct canAccess *)pDev->pCtrl->csData;    pTouCanRegs = (TouCAN)pcanAccess->pTouCanRegs;            mask = pTouCanRegs->can_RxGlobalMask;        if(ext == TRUE)    {                /* get bits 17:0 */        val = (mask & TOUCAN_GetM17TO0) << 2;                /* get bits 28 to 18*/        val |= mask & TOUCAN_M28TO18;                /* adjust bit positions */        val = val >> 3;    }    else    {        /* get bits 28 to 18*/        val = (mask & TOUCAN_M28TO18) >> 21;            }        return (long)val; }/************************************************************************** TouCAN_SetLocalMsgFilter -  sets the TouCAN message object 14/15 filter*                           * Sets the HW filter mask for message object 14/15. Message object 14 and 15* incorporates a hardware buffer to store incoming messages, thereby allowing* the CPU more time to process messages. Because the functionality of message* object 15 is specific to the TouCAN, this function is not part of the CAN common * interface. This function is provided here for developers who specifically* require the functionality of message object 14/15. The mask values applies * to both standard and extended messages. A value of "0" for a particular * bit position of the mask means don't care (i.e. the incoming message Id * could have a value of zero or one for this bit position); otherwise, a * value of 1 means the corresponding bit of the message Id must match * identically.** RETURNS: OK, ERROR*   * ERRNO: S_can_illegal_channel_no**/static STATUS TouCAN_SetLocalMsgFilter( struct WNCAN_Device *pDev, /* CAN device pointer */ UCHAR channel,             /* identifies filter 14/ 15*/  long  maskVal,             /* filter mask value  */ BOOL  ext ){    struct canAccess *pcanAccess;    TouCAN            pTouCanRegs;        TouCANBuf         pTouCanBufs;    volatile TouCAN_StandardMsgType *buffer;    ULONG             mask;    ULONG             temp;            UCHAR             tempRead;     STATUS            retCode=OK;        if(channel<14)    {        errnoSet(S_can_illegal_channel_no);             retCode=ERROR;        goto exit;    }            /*    * Get pointer to TouCAN registers and channels.        */        pcanAccess = (struct canAccess *)pDev->pCtrl->csData;    pTouCanRegs = (TouCAN)pcanAccess->pTouCanRegs;        pTouCanBufs = (TouCANBuf)pcanAccess->pTouCanBufs;                   buffer = &pTouCanBufs->can_MSG[channel];                 /*Read channel control field to lock the channel*/    tempRead = buffer->Control;        if (ext)    {        /* Adjust mask bit 28 to be the MSB */        temp = (ULONG)maskVal;        temp = temp << 3;                /* create the holes (the 0x8) between mask bits 18 and 17 */        /* Put mask bits 17 to 0 in place */        mask = (temp & TOUCAN_M17TO0) >> 2;                /* Put mask bits 28 to 18 in place */        mask |= (temp & TOUCAN_M28TO18);            }    else    {        temp = (ULONG)maskVal;        /* Adjust mask bit 28 to be the MSB */              mask = (temp << 21) & 0xffe00000;    }        /* Place 01 between mask bits 18 and 17 */    mask |= 0x00080000;        switch (channel) {    case TOUCAN_RXBUF14_MASK:        pTouCanRegs->can_RxBuff14Mask = mask;        break;    case TOUCAN_RXBUF15_MASK:        pTouCanRegs->can_RxBuff15Mask = mask;    }        /*    * Release lock on channel by reading the timer    */    timerRead = pTouCanRegs->can_TIMER;  exit:    return retCode;}/************************************************************************** TouCAN_GetLocalMsgFilter - get local message object filter** This function returns the programmed value in the local filter resgiter* Based on the value of ext passed to the function, this function reads the * appropriate format of the local mask, and returns the value in the specified,* extended or standard identifier format.* The channel argument identifies the local filter associated with the particular* channel number** RETURNS: long:mask or -1 on error *   * ERRNO:   S_can_hwfeature_not_available*          (for channels not supporting local filters)**/static long TouCAN_GetLocalMsgFilter( struct WNCAN_Device *pDev, UCHAR channel,             /* identifies filter 14/ 15*/  BOOL   ext ){    struct canAccess *pcanAccess;    TouCAN            pTouCanRegs;        ULONG             mask;    ULONG             val=0xffffffff;        /*    * Get pointer to TouCAN registers and channels.        */        pcanAccess = (struct canAccess *)pDev->pCtrl->csData;    pTouCanRegs = (TouCAN)pcanAccess->pTouCanRegs;            switch (channel) {    case TOUCAN_RXBUF14_MASK:        mask = pTouCanRegs->can_RxBuff14Mask;        break;    case TOUCAN_RXBUF15_MASK:        mask = pTouCanRegs->can_RxBuff15Mask;        break;    default:        /*channel number does not have a local filter*/        errnoSet(S_can_hwfeature_not_available);        goto exit;    }        if(ext == TRUE)    {                /* get bits 17:0 */        val = (mask & TOUCAN_GetM17TO0) << 2;                /* get bits 28 to 18*/        val |= mask & TOUCAN_M28TO18;                /* adjust bit positions */        val = val >> 3;    }    else    {        /* get bits 28 to 18*/        val = (mask & TOUCAN_M28TO18) >> 21;            }    exit:    return (long)val; }/************************************************************************** TouCAN_IsMessageLost - Test if message is lost** This function tests if the current message data in the channel overwrote * the old message data before CAN_ReadData() was called. Valid only for * channels with mode = WNCAN_CHN_RECEIVE or WNCAN_CHN_RTR_REQUESTER** RETURNS:        0 if FALSE, 1 if TRUE, or -1 if ERROR** ERRNO:          S_can_illegal_channel_no, S_can_illegal_config**/static int TouCAN_IsMessageLost( struct WNCAN_Device *pDev, UCHAR channelNum ){        struct canAccess *pcanAccess;       TouCANBuf         pTouCanBufs;    TouCAN            pTouCanRegs;    volatile TouCAN_StandardMsgType *buffer;    int               retCode = -1; /* pessimistic */    USHORT            buffCtrl;        if (channelNum >= TOUCAN_MAX_MSG_OBJ)    {        errnoSet(S_can_illegal_channel_no);        goto exit;    }        if((pDev->pCtrl->chnMode[channelNum] != WNCAN_CHN_RECEIVE) &&        (pDev->pCtrl->chnMode[channelNum] != WNCAN_CHN_RTR_REQUESTER))    {        errnoSet(S_can_illegal_config);                goto exit;    }        /*    * Get pointer to TouCAN registers and channels.        */    pcanAccess = (struct canAccess *)pDev->pCtrl->csData;    pTouCanRegs = (TouCAN)pcanAccess->pTouCanRegs;        pTouCanBufs = (TouCANBuf)pcanAccess->pTouCanBufs;                   buffer = &pTouCanBufs->can_MSG[channelNum];                 /*Read channel control field to lock the channel*/    buffCtrl = buffer->Control;        if((buffer->Control & TOUCAN_BUFFER_OVERRUN) == TOUCAN_BUFFER_OVERRUN)    {                               retCode = 1;            }    else        retCode = 0;            /*        * Release lock on channel by reading the timer    */    timerRead = pTouCanRegs->can_TIMER;     exit:    return retCode;}/************************************************************************** TouCAN_ClearMessageLost - Clear message lost indication 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
奇米亚洲午夜久久精品| 久久91精品国产91久久小草| 日韩成人一级片| a4yy欧美一区二区三区| 欧美一区二区国产| 中文字幕中文字幕在线一区| 成人av资源下载| 欧美精品三级日韩久久| 婷婷综合五月天| 国产精品国产精品国产专区不蜜| 欧美一区二区视频在线观看| 91视频国产资源| 国产99久久久国产精品| 久久精品国产999大香线蕉| 无码av中文一区二区三区桃花岛| 国产美女一区二区三区| 一区二区三区不卡在线观看| 欧美国产成人在线| 精品精品欲导航| 欧美日韩国产美| 在线观看亚洲精品| 欧美另类高清zo欧美| 97久久精品人人做人人爽50路| 精品一区二区三区蜜桃| 日韩成人精品视频| 五月婷婷综合在线| 亚洲国产精品久久一线不卡| 亚洲另类春色国产| 亚洲免费观看高清在线观看| 国产精品久久久久久久久动漫| 久久久久久电影| 欧美v国产在线一区二区三区| 日韩一区二区在线观看视频| 91精品国产一区二区三区香蕉| 欧美性感一类影片在线播放| 一本到高清视频免费精品| 91在线观看成人| 99在线精品观看| 91日韩精品一区| 99精品一区二区三区| 亚洲国产日韩综合久久精品| 欧美色精品在线视频| 日韩国产精品久久| 亚洲综合精品久久| 一区二区三区精品视频| 一区二区在线看| 亚洲亚洲精品在线观看| 视频一区免费在线观看| 久久超级碰视频| 国产麻豆日韩欧美久久| 成人爽a毛片一区二区免费| 国产精品一区二区x88av| 成人免费电影视频| 91视频在线观看| 欧美日韩成人综合天天影院| 欧美一区二区三区在| 精品美女在线观看| 亚洲国产精品av| 一区二区久久久| 日韩av一区二区三区四区| 麻豆国产欧美一区二区三区| 成人一区在线观看| 色婷婷久久综合| 午夜精品福利一区二区三区蜜桃| 亚洲欧洲日韩在线| 国产视频一区不卡| 成人欧美一区二区三区在线播放| 亚洲一区在线免费观看| 奇米影视一区二区三区小说| 国产成人在线看| 99re这里只有精品首页| 在线免费不卡视频| 精品美女在线播放| 亚洲精品成a人| 精品影院一区二区久久久| 成人午夜精品在线| 91精品久久久久久蜜臀| 久久九九全国免费| 亚洲一区二区五区| 蜜臀久久99精品久久久久久9| 国产成人日日夜夜| 欧美蜜桃一区二区三区| 久久久99精品久久| 午夜电影网一区| 国产不卡免费视频| 欧美精品aⅴ在线视频| 国产午夜精品久久久久久久| 亚洲午夜av在线| 国产精品一卡二| 欧美久久久久久久久久| 国产清纯在线一区二区www| 亚洲国产精品精华液网站| 国产suv精品一区二区6| 91精品一区二区三区在线观看| 欧美国产欧美综合| 蜜乳av一区二区| 欧美私模裸体表演在线观看| 国产视频一区二区在线| 免费在线成人网| 欧洲精品视频在线观看| 国产亚洲美州欧州综合国| 日韩精品三区四区| 91视频国产资源| 中文字幕av一区二区三区高| 日韩电影在线观看网站| 91国偷自产一区二区三区成为亚洲经典 | 成人黄页在线观看| 6080日韩午夜伦伦午夜伦| 亚洲欧美国产高清| 粉嫩嫩av羞羞动漫久久久| 日韩一级免费观看| 亚洲成年人影院| 欧洲生活片亚洲生活在线观看| 中文字幕精品一区二区精品绿巨人| 日韩不卡一区二区三区| 欧美性感一区二区三区| 亚洲精品乱码久久久久久久久| 粉嫩aⅴ一区二区三区四区五区| 欧美一区二区黄| 日韩电影在线一区二区| 在线观看91视频| 亚洲激情一二三区| 91美女在线视频| 中文字幕一区二区视频| 粉嫩嫩av羞羞动漫久久久 | 一区二区三区在线高清| 国产不卡视频在线播放| 久久精品欧美日韩精品| 国产久卡久卡久卡久卡视频精品| 日韩午夜三级在线| 男女激情视频一区| 日韩欧美亚洲国产精品字幕久久久| 天天色天天爱天天射综合| 欧美视频精品在线观看| 亚洲va在线va天堂| 欧美日本国产视频| 日本欧美在线看| 日韩精品在线看片z| 国产最新精品精品你懂的| www日韩大片| 成人黄色小视频| 亚洲欧洲av一区二区三区久久| jiyouzz国产精品久久| 亚洲欧美激情一区二区| 欧美性猛片xxxx免费看久爱| 亚洲高清在线视频| 6080亚洲精品一区二区| 九九九久久久精品| 久久久久久97三级| 99精品热视频| 亚洲国产精品麻豆| 欧美一区二区成人| 国产精品一区久久久久| 亚洲欧洲日本在线| 欧美亚洲动漫精品| 日本91福利区| 国产色一区二区| 91在线精品一区二区三区| 亚洲自拍偷拍九九九| 911精品国产一区二区在线| 久久se这里有精品| 日韩一区在线看| 91精品国产综合久久久久久漫画 | 国产亚洲欧美日韩在线一区| 91亚洲精品久久久蜜桃网站| 亚洲高清久久久| 337p粉嫩大胆色噜噜噜噜亚洲| 成人免费视频app| 亚洲国产美女搞黄色| 精品日韩在线一区| aaa国产一区| 久久精品国产精品亚洲综合| 国产精品高潮久久久久无| 91麻豆精品国产91久久久久久| 国产一区二区毛片| 亚洲福利一二三区| 国产亚洲欧美在线| 777xxx欧美| 成人手机在线视频| 日产欧产美韩系列久久99| 国产欧美日韩在线视频| 欧美日韩国产综合一区二区三区| 国产在线麻豆精品观看| 亚洲免费在线看| 2023国产一二三区日本精品2022| 99精品1区2区| 韩日av一区二区| 亚洲高清中文字幕| 国产精品青草久久| 日韩欧美在线不卡| 91在线视频免费91| 国产制服丝袜一区| 午夜电影一区二区三区| 国产精品沙发午睡系列990531| 91精品国产色综合久久不卡电影 | 亚洲精品综合在线| 久久影视一区二区| 日韩一级免费一区| 欧美日韩精品一区二区三区蜜桃 | 国产69精品久久久久毛片|