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

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

?? toucan.c

?? CAN例程 源碼 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 

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕免费在线观看视频一区| 欧美色综合天天久久综合精品| 精品国产乱子伦一区| 狠狠色狠狠色综合| 久久久综合视频| 99在线精品一区二区三区| 亚洲欧美激情小说另类| 欧美日韩视频一区二区| 久久成人18免费观看| 国产日本欧美一区二区| 94-欧美-setu| 午夜精品视频在线观看| 精品少妇一区二区三区视频免付费| 国产经典欧美精品| 一区二区三区日韩欧美精品| 777午夜精品视频在线播放| 狠狠色伊人亚洲综合成人| 国产精品福利影院| 欧美日韩国产美女| 国产一区二区三区四| 亚洲视频一二区| 日韩欧美成人激情| eeuss影院一区二区三区| 亚洲成人1区2区| 日本一区二区三区视频视频| 欧美写真视频网站| 国产一区二区不卡| 伊人婷婷欧美激情| 久久色成人在线| 精品视频免费看| 成人精品免费视频| 午夜精品视频在线观看| 国产精品丝袜91| 日韩欧美123| 91国偷自产一区二区开放时间 | 亚洲国产成人高清精品| 日韩欧美国产一区二区在线播放| 99久久国产综合色|国产精品| 天堂久久一区二区三区| 亚洲婷婷在线视频| 2017欧美狠狠色| 欧美福利电影网| 色综合久久天天综合网| 国产91对白在线观看九色| 香蕉加勒比综合久久| 国产精品灌醉下药二区| 久久影院午夜片一区| 91精品国产综合久久久蜜臀图片| 成人激情免费视频| 国产精品77777| 久久国产成人午夜av影院| 图片区小说区区亚洲影院| 亚洲欧美日韩成人高清在线一区| 久久久国产一区二区三区四区小说 | 成人国产精品免费网站| 日本中文字幕一区二区视频| 亚洲一级二级三级| 国产精品白丝在线| 日本一区二区高清| 国产午夜亚洲精品午夜鲁丝片| 日韩美女视频一区二区在线观看| 欧美视频在线一区| 在线观看国产日韩| 91丨九色丨国产丨porny| 粉嫩一区二区三区在线看| 国产成人av一区| 懂色av一区二区在线播放| 国产精品中文字幕日韩精品 | 久久精品国产精品亚洲综合| 五月婷婷另类国产| 香蕉久久夜色精品国产使用方法| 亚洲精品成人精品456| 亚洲精品中文字幕在线观看| 亚洲嫩草精品久久| 亚洲精品免费在线| 亚洲一区二区四区蜜桃| 亚洲成av人影院| 午夜精品福利在线| 免费观看在线综合| 另类小说视频一区二区| 久草在线在线精品观看| 国产一区二区三区综合| 国产91精品欧美| 粉嫩13p一区二区三区| 成人高清视频在线| 91亚洲国产成人精品一区二区三 | 亚洲欧美区自拍先锋| 中文字幕色av一区二区三区| 亚洲视频1区2区| 亚洲一区二区三区国产| 日本成人中文字幕在线视频| 韩国欧美国产1区| 国产精品一区二区在线观看不卡| 粗大黑人巨茎大战欧美成人| 91蜜桃在线观看| 欧美肥胖老妇做爰| 久久久无码精品亚洲日韩按摩| 欧美激情中文字幕| 亚洲综合久久久久| 久久99精品国产麻豆不卡| 国产成人精品一区二区三区网站观看| www.激情成人| 精品视频免费看| 久久久亚洲精品一区二区三区| 国产精品传媒视频| 午夜视频在线观看一区二区三区| 激情久久五月天| 色综合久久综合| 欧美大胆人体bbbb| 中文字幕中文字幕一区二区 | 精品一区二区久久久| 99久久99久久综合| 欧美一级专区免费大片| 国产精品第五页| 日韩不卡一区二区三区| 成人免费观看视频| 欧美精品777| 最新国产成人在线观看| 蜜臀久久99精品久久久久久9 | 国产精品系列在线观看| 在线观看视频一区二区| 久久久亚洲精品石原莉奈| 婷婷综合另类小说色区| 国产精品自拍在线| 欧美日韩一区二区在线视频| 国产日韩欧美一区二区三区综合| 亚洲精品视频免费看| 国产另类ts人妖一区二区| 欧美三级电影网站| 国产精品久久久久精k8| 久久精品国产77777蜜臀| 欧美性生活久久| 国产精品全国免费观看高清| 美女免费视频一区| 欧美日韩国产另类不卡| 亚洲天堂福利av| 成人午夜av电影| 26uuu另类欧美亚洲曰本| 日日摸夜夜添夜夜添精品视频| 色综合色狠狠综合色| 欧美极品aⅴ影院| 国产在线看一区| 日韩欧美在线1卡| 五月婷婷色综合| 欧洲av一区二区嗯嗯嗯啊| 中文字幕在线不卡一区| 国产福利一区二区三区视频在线 | 欧美一区二区三区成人| 依依成人综合视频| 91丝袜美女网| 1000部国产精品成人观看| 国产成人午夜片在线观看高清观看| 91精品国产91综合久久蜜臀| 亚洲一区二区在线免费观看视频 | 欧美亚洲精品一区| 亚洲你懂的在线视频| 白白色 亚洲乱淫| 国产精品黄色在线观看| 粉嫩av一区二区三区| 国产欧美日韩视频在线观看| 国产高清精品在线| 欧美激情一区不卡| 国产成人无遮挡在线视频| 久久人人爽爽爽人久久久| 国产精品影视在线| 久久精品亚洲国产奇米99| 国产永久精品大片wwwapp| 久久久精品2019中文字幕之3| 国产麻豆日韩欧美久久| 久久久精品国产99久久精品芒果| 国产一区二区看久久| 欧美韩国一区二区| www.色综合.com| 亚洲视频中文字幕| 欧美午夜精品免费| 视频一区视频二区中文| 日韩一区二区电影在线| 精品制服美女久久| 中文字幕av一区二区三区高| 成人动漫视频在线| 18成人在线观看| 欧美人动与zoxxxx乱| 奇米一区二区三区av| 精品国产不卡一区二区三区| 国产盗摄一区二区| 国产精品成人网| 欧美私模裸体表演在线观看| 日本强好片久久久久久aaa| 日韩免费成人网| av成人免费在线| 亚洲成人福利片| 久久综合九色综合欧美就去吻| www.综合网.com| 亚洲成a人片在线观看中文| 欧美精品一区二区三区一线天视频| 成人一区二区视频| 午夜精品久久久久久久99水蜜桃| 精品国产一区二区三区久久久蜜月| 成人污视频在线观看| 五月天激情综合|