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

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

?? toucan.c

?? CAN SJA1000 LINUX driver
?? 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一区二区三区免费野_久草精品视频
在线播放欧美女士性生活| 亚洲视频综合在线| 亚洲欧美乱综合| 日韩av午夜在线观看| 91在线精品一区二区| 日韩精品一区二区三区中文不卡| 国产精品三级视频| 蜜桃视频第一区免费观看| 日本精品免费观看高清观看| 精品久久久网站| 日韩中文欧美在线| 91成人网在线| 日韩毛片在线免费观看| 久草热8精品视频在线观看| 欧美色视频一区| 亚洲精品乱码久久久久久| 国产福利视频一区二区三区| 日韩女同互慰一区二区| 亚洲一级片在线观看| 99久久久久免费精品国产 | 国产欧美日韩综合| 久草精品在线观看| 日韩一二三四区| 日韩精品一二区| 欧美视频在线播放| 亚洲成人1区2区| 欧美日韩三级一区| 天天综合网天天综合色| 91精品国产一区二区三区蜜臀| 亚洲午夜久久久久久久久电影网 | 日韩激情av在线| 欧美精品日韩综合在线| 亚洲成人自拍偷拍| 欧美人伦禁忌dvd放荡欲情| 亚洲综合在线五月| 欧美绝品在线观看成人午夜影视| 偷拍自拍另类欧美| 91精品久久久久久久久99蜜臂| 五月激情综合色| 欧美mv和日韩mv的网站| 国产成人亚洲综合色影视| 国产精品视频一区二区三区不卡| 国产黑丝在线一区二区三区| 国产精品久久久久久久蜜臀 | 岛国精品在线播放| 中文一区一区三区高中清不卡| 成人av午夜影院| 一区二区视频在线| 欧美肥妇free| 国产精品亚洲一区二区三区在线 | 日韩欧美在线观看一区二区三区| 蜜桃av一区二区三区| 国产日产欧产精品推荐色| 99在线热播精品免费| 亚洲一级片在线观看| 日韩欧美另类在线| 成人的网站免费观看| 亚洲电影第三页| xnxx国产精品| 在线观看亚洲精品视频| 日韩成人伦理电影在线观看| 国产日产欧美精品一区二区三区| 色哟哟国产精品| 国产综合久久久久影院| 亚洲黄一区二区三区| 日韩一卡二卡三卡国产欧美| 国产91在线|亚洲| 亚洲va韩国va欧美va| 久久精品一区二区三区四区| 91福利国产成人精品照片| 久热成人在线视频| 一色屋精品亚洲香蕉网站| 日韩一区二区中文字幕| 91偷拍与自偷拍精品| 久久成人免费网| 一区二区欧美精品| 久久久久久一二三区| 欧美精品日韩一区| 99视频在线观看一区三区| 日韩 欧美一区二区三区| 亚洲免费观看高清完整版在线观看熊| 日韩欧美你懂的| 欧美日韩高清一区二区三区| 成人深夜在线观看| 久久99这里只有精品| 亚洲成a人片在线观看中文| 国产精品色一区二区三区| 日韩欧美一区在线| 欧美系列在线观看| www.日韩大片| 国产精品66部| 麻豆久久久久久| 五月婷婷激情综合网| 亚洲精品乱码久久久久久| 国产精品色哟哟网站| 久久精品这里都是精品| 精品国精品国产| 91精品在线麻豆| 日本高清不卡一区| 色综合av在线| 一本大道av伊人久久综合| 99久久精品免费精品国产| 国产乱理伦片在线观看夜一区| 久久 天天综合| 婷婷成人综合网| 亚洲成人自拍偷拍| 性久久久久久久| 亚洲电影一区二区| 天堂一区二区在线| 日韩黄色片在线观看| 午夜国产精品影院在线观看| 五月天一区二区| 日本美女一区二区三区| 日日骚欧美日韩| 青青草国产精品97视觉盛宴| 天堂va蜜桃一区二区三区漫画版| 亚洲愉拍自拍另类高清精品| 亚洲人成亚洲人成在线观看图片| 国产精品福利在线播放| 日韩一区在线看| 亚洲国产美女搞黄色| 亚洲成a人片在线观看中文| 日韩精品91亚洲二区在线观看| 免费在线观看一区二区三区| 久久精品国产在热久久| 国产在线不卡视频| www.日韩精品| 欧美日韩一区二区电影| 91精品综合久久久久久| 精品久久人人做人人爰| 国产精品每日更新| 亚洲一区电影777| 日韩精彩视频在线观看| 国产一区二区三区电影在线观看| 激情成人午夜视频| 成人av网站大全| 欧美精品日韩精品| 精品成a人在线观看| 国产精品白丝在线| 天天亚洲美女在线视频| 国产精品资源在线观看| 91视频xxxx| 91精品国产免费久久综合| 日本一区二区综合亚洲| 亚洲国产精品自拍| 韩国v欧美v日本v亚洲v| 91浏览器入口在线观看| 日韩一级免费一区| 国产精品看片你懂得| 日本成人在线电影网| 成人av在线影院| 欧美一级精品大片| 国产精品国模大尺度视频| 日韩不卡一二三区| 91免费版在线| 精品对白一区国产伦| 亚洲综合一区在线| 国产福利电影一区二区三区| 欧美日韩色一区| 中文字幕一区二区在线观看| 奇米影视一区二区三区小说| 99精品视频一区二区三区| 日韩一区二区影院| 亚洲男人的天堂在线观看| 国产一区在线不卡| 在线免费观看日韩欧美| 国产婷婷一区二区| 亚洲成人在线网站| 一本久道中文字幕精品亚洲嫩| 精品理论电影在线| 三级一区在线视频先锋| 91视频在线看| 国产精品免费久久| 国产伦精一区二区三区| 欧美一级片在线| 亚洲成在线观看| 91精彩视频在线| 中文字幕欧美一| 成人午夜免费视频| 久久色在线观看| 男人操女人的视频在线观看欧美| 欧美中文字幕一区二区三区| 国产精品―色哟哟| 国产高清亚洲一区| 久久综合久久综合久久综合| 美女脱光内衣内裤视频久久网站| 欧美三级中文字| 亚洲精品成a人| 色吧成人激情小说| 亚洲欧美日韩一区| 99精品欧美一区二区三区综合在线| 久久综合九色欧美综合狠狠 | 成人黄页毛片网站| 国产日韩欧美一区二区三区综合| 久久精品国产澳门| 久久综合久久久久88| 国内精品伊人久久久久影院对白| 日韩一区二区三区视频在线| 日本中文在线一区| 精品国产sm最大网站免费看|