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

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

?? toucan.c

?? CAN SJA1000 LINUX driver
?? C
?? 第 1 頁(yè) / 共 5 頁(yè)
字號(hào):
** This function clears data overrun flag for a particular channel* Valid only for channels with mode = WNCAN_CHN_RECEIVE or* WNCAN_CHN_RTR_REQUESTER** RETURNS:        Ok or ERROR** ERRNO:          S_can_illegal_channel_no, S_can_illegal_config**/static STATUS TouCAN_ClearMessageLost( struct WNCAN_Device *pDev, UCHAR channelNum ){        struct canAccess *pcanAccess;       TouCANBuf         pTouCanBufs;    TouCAN            pTouCanRegs;    volatile TouCAN_StandardMsgType *buffer;    volatile USHORT   len;    int               retCode = ERROR; /* pessimistic */        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];                     /*Save and later restore data length*/    len = buffer->Control & 0x000f;        /*Clear overflow code, and replace with buffer full indicaition*/    buffer->Control = TOUCAN_BUFFER_FULL | len;        retCode = OK;    exit:    return retCode;}/************************************************************************** TouCAN_IsRTR - Tests if the message has the RTR bit set. * The RTR bit of an incoming remote request is not stored in the channel* registers on the TouCAN. CAN_IsRTR cannot be implemented directly. The* TouCAN has an automatic response feature, that must be used to respond * to incoming remote requests.* To do this:* 1. Select channel mode WNCAN_CHN_RTR_RESPONDER * 2. On this channel call CAN_WriteID and set up matching id for incoming*    remote request* 3. Set up response data by calling CAN_WriteData** RETURNS:        -1 *   * ERRNO:          S_can_use_auto_response_feature**/static int TouCAN_IsRTR( struct WNCAN_Device *pDev, UCHAR channelNum ){    errnoSet(S_can_use_auto_response_feature);    return -1;}/************************************************************************** TouCAN_SetRTR - Sets RTR bit** The TouCAN supports transmitting and receiving a message in the same * channel. The driver supports special channel modes namely * WNCAN_CHN_RTR_REQUESTER and WMCAN_CHN_RTR_RESPONDER to handle setting up* RTR messages easier. * ** RETURNS:        ERROR*   * ERRNO:          S_can_use_rtr_requester_channel_mode**/static STATUS TouCAN_SetRTR( struct WNCAN_Device *pDev, UCHAR channelNum, BOOL  rtr ){    errnoSet(S_can_use_rtr_requester_channel_mode);    return ERROR;}/************************************************************************** TouCAN_TxAbort - abort the current CAN transmission** This routine aborts any current CAN transmissions on the controller.** RETURNS:        N/A** ERRNO:          N/A**/static void TouCAN_TxAbort( struct WNCAN_Device *pDev ){    struct canAccess *pcanAccess;       TouCANBuf         pTouCanBufs;    volatile TouCAN_StandardMsgType *buffer;            UCHAR         i;              /*    * Get pointer to TouCAN registers and channels.        */    pcanAccess = (struct canAccess *)pDev->pCtrl->csData;    pTouCanBufs = (TouCANBuf)pcanAccess->pTouCanBufs;                           for(i=0;i<TOUCAN_MAX_MSG_OBJ;i++)    {        if((pDev->pCtrl->chnMode[i] == WNCAN_CHN_TRANSMIT) &&            ~(pDev->pCtrl->chnMode[i] & WNCAN_IS_CHN_RTR))        {                        buffer = &pTouCanBufs->can_MSG[i];                          /*Make the channel inactive*/                            /*            * A write access to the control field of the channel            * will make deactivate it, unless the message has been            * tranferred to the serial channel.            * However, no interrupt will be requested.            */            buffer->Control = 0x0080;        }    }        return;}/************************************************************************** TouCAN_Sleep - puts the CAN controller of the device into sleep mode* Auto awake feature is always enabled** RETURNS:        OK always*   * ERRNO:          N/A**/static STATUS TouCAN_Sleep( struct WNCAN_Device *pDev ){    struct canAccess *pcanAccess;       TouCAN            pTouCanRegs;            USHORT            temp;        /* Get pointer to TouCAN registers. */       pcanAccess = (struct canAccess *)pDev->pCtrl->csData;    pTouCanRegs = (TouCAN)pcanAccess->pTouCanRegs;        temp = pTouCanRegs->can_MCR;        /*Enable low power stop (sleep) mode*/    pTouCanRegs->can_MCR = (temp | TOUCAN_STOP | TOUCAN_SELFWAKE);        while((pTouCanRegs->can_MCR & TOUCAN_STOPACK) != TOUCAN_STOPACK)        ;            return OK;}/************************************************************************** TouCAN_WakeUp - gets the CAN controller out of sleep mode* Auto awake feature is always enabled** RETURNS:        OK always*   * ERRNO:          N/A**/static STATUS TouCAN_WakeUp( struct WNCAN_Device *pDev ){    struct canAccess *pcanAccess;       TouCAN            pTouCanRegs;            USHORT            temp;        /* Get pointer to TouCAN registers. */       pcanAccess = (struct canAccess *)pDev->pCtrl->csData;    pTouCanRegs = (TouCAN)pcanAccess->pTouCanRegs;        temp = pTouCanRegs->can_MCR;        temp &= ~(TOUCAN_STOP |TOUCAN_SELFWAKE);    /*Disable  sleep  mode*/    pTouCanRegs->can_MCR = temp;        while((pTouCanRegs->can_MCR & TOUCAN_STOPACK) == TOUCAN_STOPACK)        ;           return OK;}/************************************************************************** TouCAN_GetIntStatus - get the interrupt status on the controller** This function returns the interrupt status on the controller: **    WNCAN_INT_NONE     = no interrupt occurred*    WNCAN_INT_ERROR    = bus error*    WNCAN_INT_TX       = interrupt resuting from a CAN transmission*    WNCAN_INT_RX       = interrupt resulting form message reception*    WNCAN_INT_BUS_OFF  = interrupt resulting from bus off condition*    WNCAN_INT_WAKE_UP  = interrupt resulting from controller waking up*                         after being put in sleep mode*    WNCAN_INT_SPURIOUS = unknown interrupt** NOTE: If the interrupt was caused by the transmission or reception of a * message, the channel number that generated the interrupt is set; otherwise,* this value is undefined. * ERRNO: N/A **/static WNCAN_IntType TouCAN_GetIntStatus( struct WNCAN_Device *pDev, UCHAR *channelNum ){    WNCAN_IntType   intStatus = WNCAN_INT_NONE;    struct canAccess *pcanAccess;    TouCAN            pTouCanRegs;    TouCANBuf         pTouCanBufs;    volatile TouCAN_StandardMsgType *buffer;    volatile USHORT   regInt;    volatile USHORT   msgCode;    volatile USHORT   statusTemp;        /*    * Get pointer to TouCAN registers and channels.        */    pcanAccess = (struct canAccess *)pDev->pCtrl->csData;    pTouCanRegs = (TouCAN)pcanAccess->pTouCanRegs;                  pTouCanBufs = (TouCANBuf)pcanAccess->pTouCanBufs;        /*    * And the interrupt register and the interrupt mask register        */    regInt = pTouCanRegs->can_IFLAG & pTouCanRegs->can_IMASK;    statusTemp = pTouCanRegs->can_ESTAT;         if(regInt == 0)    {        if(pTouCanRegs->can_CR0 & TOUCAN_ERROR_MASK_ENABLE)        {            if( statusTemp & TOUCAN_ERRINT)            {                intStatus = WNCAN_INT_ERROR;            }                    }                if(pTouCanRegs->can_CR0 & TOUCAN_BOFF_MASK_ENABLE)        {            if( statusTemp & TOUCAN_BOFFINT)            {                intStatus = WNCAN_INT_ERROR;            }        }                if(pTouCanRegs->can_MCR & TOUCAN_WAKEUPINT_ENABLE)        {            if( statusTemp & TOUCAN_WAKEINT)            {                intStatus = WNCAN_INT_WAKE_UP;                            }                    }            }    else    {        for(*channelNum = 0; *channelNum < TOUCAN_MAX_MSG_OBJ ; ++*channelNum)        {            if( regInt & (1 << *channelNum))            {                buffer = &pTouCanBufs->can_MSG[*channelNum];                        msgCode = buffer->Control & 0x00f0;                                                /*                * Check in case busy bit is set. May be set if a                * response to remote request is being transferred from the                * serial buffer. Busy bit should not be set for a data rx,                * as we poll the IFLAG register before accessing the channel.                * If set, return error.                */                if(msgCode & TOUCAN_BUFFER_BUSY) {                    /*break as channel is busy*/                    break;                }                                                switch(msgCode) {                case TOUCAN_BUFFER_FULL:                    intStatus = WNCAN_INT_RX;                    break;                case TOUCAN_RESPONSE_TO_REMOTE:                                             intStatus = WNCAN_INT_RTR_RESPONSE;                    break;                                  case  TOUCAN_TX_NOT_READY:                    intStatus = WNCAN_INT_TX;                    break;                case TOUCAN_BUFFER_OVERRUN:                    intStatus = WNCAN_INT_ERROR;                    break;                case TOUCAN_BUFFER_READY_TO_RX:                    intStatus = WNCAN_INT_TX;                                            break;                default:                    /*To add errnoset to flag a fatal error*/                    intStatus = WNCAN_INT_NONE;                }                            }        }                /* Read the free running timer to unlock the controller */        timerRead = pTouCanRegs->can_TIMER;    }            return intStatus;}        /************************************************************************** TouCANISR - interrupt service routine ** RETURNS: N/A*   * ERRNO: N/A**/void TouCANISR( ULONG context ){    WNCAN_IntType      intStatus;    struct WNCAN_Device  *pDev;    struct canAccess     *pcanAccess;    TouCAN               pTouCanRegs;            TouCANBuf            pTouCanBufs;    volatile TouCAN_StandardMsgType *buffer;        volatile USHORT      regInt;    volatile USHORT      msgCode;    volatile USHORT      statusTemp;    UCHAR                chnNum=16;        /*    * Get pointer to TouCAN registers and channels.        */        if ((pDev = (struct WNCAN_Device *)context) == NULL) return;    pcanAccess  = (struct canAccess *)pDev->pCtrl->csData;    pTouCanRegs = (TouCAN)pcanAccess->pTouCanRegs;                  pTouCanBufs = (TouCANBuf)pcanAccess->pTouCanBufs;        while(1)    {        /* And the interrupt register and the interrupt mask register */          intStatus  = WNCAN_INT_NONE;        regInt     = pTouCanRegs->can_IFLAG & pTouCanRegs->can_IMASK;        statusTemp = pTouCanRegs->can_ESTAT;                 if(regInt == 0) {            if(pTouCanRegs->can_CR0 & TOUCAN_ERROR_MASK_ENABLE)            {                if( statusTemp & TOUCAN_ERRINT)                {                    intStatus = WNCAN_INT_ERROR;                                        /*                    * Clear the error interrupt bit in the ESTAT register                     * by reading it as a 1 and writing a 0                    */                    pTouCanRegs->can_ESTAT &= ~(TOUCAN_ERRINT);                }                            }                        if(pTouCanRegs->can_CR0 & TOUCAN_BOFF_MASK_ENABLE)            {                if( statusTemp & TOUCAN_BOFFINT)                {                    intStatus = WNCAN_INT_ERROR;                    /*                    * Clear the BUS OFF interrupt bit in the ESTAT register                     * by reading it as a 1 and writing a 0                    */                    pTouCanRegs->can_ESTAT &= ~(TOUCAN_BOFFINT);                                    }            }                        if(pTouCanRegs->can_MCR & TOUCAN_WAKEUPINT_ENABLE)            {                if( statusTemp & TOUCAN_WAKEINT)                {                    intStatus = WNCAN_INT_WAKE_UP;                                        /*                    * Clear the error interrupt bit in the ESTAT register                     * by reading it as a 1 and writing a 0                    */                    pTouCanRegs->can_ESTAT &= ~(TOUCAN_WAKEINT);                }                            }                    } else {            /* Find the channel with the highest pending interrupt */            for(chnNum = 0; chnNum < TO

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美国产丝袜视频| 精品播放一区二区| 菠萝蜜视频在线观看一区| 九一久久久久久| 精品一区二区三区免费视频| 午夜免费欧美电影| 日本成人在线不卡视频| 久久综合网色—综合色88| 精品久久久久久久人人人人传媒| 欧美一卡2卡3卡4卡| 日韩亚洲欧美高清| 精品国产免费久久 | 欧美成va人片在线观看| 欧美一级免费大片| 欧美一二三区在线观看| 日韩久久精品一区| 久久综合狠狠综合| 中文字幕在线不卡视频| 亚洲另类在线制服丝袜| 一区二区三区在线免费视频| 亚洲尤物视频在线| 免费不卡在线观看| 国产激情精品久久久第一区二区| 国产成人超碰人人澡人人澡| 99久久久国产精品免费蜜臀| 色噜噜偷拍精品综合在线| 欧美日韩精品欧美日韩精品一 | 久久久美女艺术照精彩视频福利播放| 国产无遮挡一区二区三区毛片日本| 国产精品伦理一区二区| 亚洲午夜久久久久久久久久久 | 91丝袜高跟美女视频| 在线观看av一区| 日韩一区二区三区电影在线观看| 久久久久久久电影| 一区二区三区资源| 久久99久久99小草精品免视看| 粉嫩13p一区二区三区| 色婷婷综合五月| 日韩三区在线观看| 国产精品久久三| 日韩国产精品久久久久久亚洲| 国内成人自拍视频| 色综合天天综合在线视频| 91精品国产综合久久久久久久久久| 亚洲精品一线二线三线无人区| 自拍av一区二区三区| 蜜芽一区二区三区| 91色porny| 欧美变态凌虐bdsm| 亚洲综合久久久久| 国产在线观看免费一区| 色素色在线综合| 精品国产一二三| 一区二区三区在线播| 久久99国内精品| 色综合久久综合网97色综合 | 亚洲人成网站影音先锋播放| 日韩高清电影一区| av一区二区三区| 精品日韩欧美在线| 一区二区三区在线影院| 国产成人综合在线| 欧美高清视频在线高清观看mv色露露十八| 成人小视频在线| 国产凹凸在线观看一区二区| 欧美日本乱大交xxxxx| 亚洲精品第1页| 国产成人一级电影| 日韩精品一区二区三区视频播放 | 久久av资源站| 奇米888四色在线精品| 亚洲欧美日韩电影| 欧美美女网站色| 国产福利视频一区二区三区| 精品久久久久久最新网址| 免播放器亚洲一区| 亚洲伦在线观看| 久久久久久久免费视频了| 国产九色sp调教91| 欧美亚洲高清一区二区三区不卡| 国产亚洲成aⅴ人片在线观看| 日韩成人免费在线| 波多野结衣一区二区三区| 日韩一区二区在线播放| 麻豆91精品视频| 久久这里只精品最新地址| 免费成人av资源网| 国产精品美女久久久久av爽李琼 | 国产精品中文欧美| 日本一区二区视频在线观看| 国产99精品国产| 亚洲国产综合在线| 欧美日韩国产综合久久| 亚洲成在人线在线播放| 欧美在线free| 亚洲国产成人tv| 欧美日韩精品一区二区天天拍小说| 中文字幕国产一区二区| 91高清视频免费看| 免费看日韩精品| 欧美一区日本一区韩国一区| 国产精品久久久久一区 | 欧美三区在线视频| 亚洲精选一二三| 欧美日韩精品欧美日韩精品一| 一区二区三区四区蜜桃| 欧美疯狂做受xxxx富婆| 一区二区三区久久久| 精品视频在线看| 不卡视频免费播放| 午夜精品久久久久| 1024成人网色www| 国产日韩精品视频一区| 日本高清不卡视频| 婷婷一区二区三区| 中文字幕乱码久久午夜不卡 | 国产精品电影院| 91精品婷婷国产综合久久性色| 欧美疯狂做受xxxx富婆| caoporn国产一区二区| 日本中文字幕一区二区视频| 亚洲欧美综合在线精品| 91欧美激情一区二区三区成人| 亚洲丝袜精品丝袜在线| 欧美在线一区二区三区| 亚洲成人你懂的| 精品福利二区三区| 成人激情小说乱人伦| 亚洲麻豆国产自偷在线| 欧美日韩高清在线播放| 精品一区二区三区不卡| 国产精品无遮挡| 欧美性猛交xxxxxx富婆| 精品制服美女丁香| 国产精品二区一区二区aⅴ污介绍| 在线看不卡av| 九九精品视频在线看| 中文字幕亚洲欧美在线不卡| 欧美性猛片xxxx免费看久爱| 经典三级在线一区| 亚洲天堂a在线| 91精品国产高清一区二区三区蜜臀| 精品午夜一区二区三区在线观看| 中文字幕中文在线不卡住| 欧美日韩亚洲国产综合| 国产剧情一区在线| 亚洲一区二区中文在线| 欧美videossexotv100| 波多野结衣中文字幕一区| 日日欢夜夜爽一区| 久久久久久久综合狠狠综合| 欧美午夜宅男影院| 国产精品一二三四| 亚洲福利视频一区| 久久精品亚洲精品国产欧美| 在线日韩av片| 高清国产一区二区| 亚洲一区二区在线观看视频| 久久精品亚洲乱码伦伦中文| 欧美日韩www| 成人一区二区三区视频在线观看| 亚洲大型综合色站| 国产精品女同一区二区三区| 日韩亚洲电影在线| 欧美怡红院视频| 风间由美一区二区三区在线观看| 婷婷成人综合网| 中文字幕日韩av资源站| 欧美变态tickle挠乳网站| 欧美伊人精品成人久久综合97| 国产一区二区调教| 亚洲一区二区三区四区不卡| 久久一日本道色综合| 欧美一区二区三区在线| 99久久99久久综合| 国产精品影音先锋| 美女mm1313爽爽久久久蜜臀| 亚洲乱码中文字幕| 中文一区二区在线观看| 精品精品国产高清a毛片牛牛| 色视频欧美一区二区三区| 成人妖精视频yjsp地址| 久99久精品视频免费观看| 日本aⅴ精品一区二区三区| 一区二区三区加勒比av| 国产精品福利电影一区二区三区四区| 2023国产精品| 日韩精品在线看片z| 欧美精品在线一区二区三区| 在线看国产一区二区| 色老汉一区二区三区| 99久久精品免费看| 成人午夜电影久久影院| 国产高清一区日本| 激情五月婷婷综合网| 久久av资源网| 卡一卡二国产精品| 美腿丝袜亚洲一区| 另类小说欧美激情|