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

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

?? can.c

?? iar 安裝使用的方法。其中包括一些工程模板
?? C
?? 第 1 頁 / 共 5 頁
字號:
        else
        {
            //
            // Lower 16 bit are unused so set them to zero.
            //
            usMaskReg[0] = 0;

            //
            // Put the 11 bit Mask Identifier into the upper bits of the field
            // in the register.
            //
            usMaskReg[1] = ((pMsgObject->ulMsgIDMask << 2) &
                            CAN_IF1MSK2_IDMSK_M);
        }
    }

    //
    // If the caller wants to filter on the extended ID bit then set it.
    //
    if((pMsgObject->ulFlags & MSG_OBJ_USE_EXT_FILTER) ==
       MSG_OBJ_USE_EXT_FILTER)
    {
        usMaskReg[1] |= CAN_IF1MSK2_MXTD;
    }

    //
    // The caller wants to filter on the message direction field.
    //
    if((pMsgObject->ulFlags & MSG_OBJ_USE_DIR_FILTER) ==
       MSG_OBJ_USE_DIR_FILTER)
    {
        usMaskReg[1] |= CAN_IF1MSK2_MDIR;
    }

    if(pMsgObject->ulFlags & (MSG_OBJ_USE_ID_FILTER | MSG_OBJ_USE_DIR_FILTER |
                              MSG_OBJ_USE_EXT_FILTER))
    {
        //
        // Set the UMASK bit to enable using the mask register.
        //
        usMsgCtrl |= CAN_IF1MCTL_UMASK;

        //
        // Set the MASK bit so that this gets trasferred to the Message Object.
        //
        usCmdMaskReg |= CAN_IF1CMSK_MASK;
    }

    //
    // Set the Arb bit so that this gets transferred to the Message object.
    //
    usCmdMaskReg |= CAN_IF1CMSK_ARB;

    //
    // Configure the Arbitration registers.
    //
    if(bUseExtendedID)
    {
        //
        // Set the 29 bit version of the Identifier for this message object.
        //
        usArbReg[0] |= pMsgObject->ulMsgID & CAN_IF1ARB1_ID_M;
        usArbReg[1] |= (pMsgObject->ulMsgID >> 16) & CAN_IF1ARB2_ID_M;

        //
        // Mark the message as valid and set the extended ID bit.
        //
        usArbReg[1] |= CAN_IF1ARB2_MSGVAL | CAN_IF1ARB2_XTD;
    }
    else
    {
        //
        // Set the 11 bit version of the Identifier for this message object.
        // The lower 18 bits are set to zero.
        //
        usArbReg[1] |= (pMsgObject->ulMsgID << 2) & CAN_IF1ARB2_ID_M;

        //
        // Mark the message as valid.
        //
        usArbReg[1] |= CAN_IF1ARB2_MSGVAL;
    }

    //
    // Set the data length since this is set for all transfers.  This is also a
    // single transfer and not a FIFO transfer so set EOB bit.
    //
    usMsgCtrl |= (pMsgObject->ulMsgLen & CAN_IF1MCTL_DLC_M) | CAN_IF1MCTL_EOB;

    //
    // Enable transmit interrupts if they should be enabled.
    //
    if(pMsgObject->ulFlags & MSG_OBJ_TX_INT_ENABLE)
    {
        usMsgCtrl |= CAN_IF1MCTL_TXIE;
    }

    //
    // Enable receive interrupts if they should be enabled.
    //
    if(pMsgObject->ulFlags & MSG_OBJ_RX_INT_ENABLE)
    {
        usMsgCtrl |= CAN_IF1MCTL_RXIE;
    }

    //
    // Write the data out to the CAN Data registers if needed.
    //
    if(bTransferData)
    {
        CANDataRegWrite(pMsgObject->pucMsgData,
                        (unsigned long *)(ulBase + CAN_O_IF1DA1),
                        pMsgObject->ulMsgLen);
    }

    //
    // Write out the registers to program the message object.
    //
    CANRegWrite(ulBase + CAN_O_IF1CMSK, usCmdMaskReg);
    CANRegWrite(ulBase + CAN_O_IF1MSK1, usMaskReg[0]);
    CANRegWrite(ulBase + CAN_O_IF1MSK2, usMaskReg[1]);
    CANRegWrite(ulBase + CAN_O_IF1ARB1, usArbReg[0]);
    CANRegWrite(ulBase + CAN_O_IF1ARB2, usArbReg[1]);
    CANRegWrite(ulBase + CAN_O_IF1MCTL, usMsgCtrl);

    //
    // Transfer the message object to the message object specifiec by ulObjID.
    //
    CANRegWrite(ulBase + CAN_O_IF1CRQ, ulObjID & CAN_IF1CRQ_MNUM_M);

    return;
}

//*****************************************************************************
//
//! Reads a CAN message from one of the message object buffers.
//!
//! \param ulBase is the base address of the CAN controller.
//! \param ulObjID is the object number to read (1-32).
//! \param pMsgObject points to a structure containing message object fields.
//! \param bClrPendingInt indicates whether an associated interrupt should be
//! cleared.
//!
//! This function is used to read the contents of one of the 32 message objects
//! in the CAN controller, and return it to the caller.  The data returned is
//! stored in the fields of the caller-supplied structure pointed to by
//! \e pMsgObject.  The data consists of all of the parts of a CAN message,
//! plus some control and status information.
//!
//! Normally this is used to read a message object that has received and stored
//! a CAN message with a certain identifier.  However, this could also be used
//! to read the contents of a message object in order to load the fields of the
//! structure in case only part of the structure needs to be changed from a
//! previous setting.
//!
//! When using CANMessageGet, all of the same fields of the structure are
//! populated in the same way as when the CANMessageSet() function is used,
//! with the following exceptions:
//!
//! \e pMsgObject->ulFlags:
//!
//! - \b MSG_OBJ_NEW_DATA indicates if this is new data since the last time it
//! was read
//! - \b MSG_OBJ_DATA_LOST indicates that at least one message was received on
//! this message object, and not read by the host before being overwritten.
//!
//! \return None.
//
//*****************************************************************************
void
CANMessageGet(unsigned long ulBase, unsigned long ulObjID,
              tCANMsgObject *pMsgObject, tBoolean bClrPendingInt)
{
    unsigned short usCmdMaskReg;
    unsigned short usMaskReg[2];
    unsigned short usArbReg[2];
    unsigned short usMsgCtrl;

    //
    // Check the arguments.
    //
    ASSERT((ulBase == CAN0_BASE) ||
           (ulBase == CAN1_BASE) ||
           (ulBase == CAN2_BASE));
    ASSERT((ulObjID <= 32) && (ulObjID != 0));

    //
    // This is always a read to the Message object as this call is setting a
    // message object.
    //
    usCmdMaskReg = (CAN_IF1CMSK_DATAA | CAN_IF1CMSK_DATAB |
                    CAN_IF1CMSK_CONTROL | CAN_IF1CMSK_MASK | CAN_IF1CMSK_ARB);

    //
    // Clear a pending interrupt and new data in a message object.
    //
    if(bClrPendingInt)
    {
        usCmdMaskReg |= CAN_IF1CMSK_CLRINTPND;
    }

    //
    // Set up the request for data from the message object.
    //
    CANRegWrite(ulBase + CAN_O_IF2CMSK, usCmdMaskReg);

    //
    // Transfer the message object to the message object specifiec by ulObjID.
    //
    CANRegWrite(ulBase + CAN_O_IF2CRQ, ulObjID & CAN_IF1CRQ_MNUM_M);

    //
    // Wait for busy bit to clear
    //
    while(CANRegRead(ulBase + CAN_O_IF2CRQ) & CAN_IF1CRQ_BUSY)
    {
    }

    //
    // Read out the IF Registers.
    //
    usMaskReg[0] = CANRegRead(ulBase + CAN_O_IF2MSK1);
    usMaskReg[1] = CANRegRead(ulBase + CAN_O_IF2MSK2);
    usArbReg[0] = CANRegRead(ulBase + CAN_O_IF2ARB1);
    usArbReg[1] = CANRegRead(ulBase + CAN_O_IF2ARB2);
    usMsgCtrl = CANRegRead(ulBase + CAN_O_IF2MCTL);

    pMsgObject->ulFlags = MSG_OBJ_NO_FLAGS;

    //
    // Determine if this is a remote frame by checking the TXRQST and DIR bits.
    //
    if((!(usMsgCtrl & CAN_IF1MCTL_TXRQST) &&
        (usArbReg[1] & CAN_IF1ARB2_DIR)) ||
       ((usMsgCtrl & CAN_IF1MCTL_TXRQST) &&
        (!(usArbReg[1] & CAN_IF1ARB2_DIR))))
    {
        pMsgObject->ulFlags |= MSG_OBJ_REMOTE_FRAME;
    }

    //
    // Get the identifier out of the register, the format depends on size of
    // the mask.
    //
    if(usArbReg[1] & CAN_IF1ARB2_XTD)
    {
        //
        // Set the 29 bit version of the Identifier for this message object.
        //
        pMsgObject->ulMsgID = ((usArbReg[1] & CAN_IF1ARB2_ID_M) << 16) |
            usArbReg[0];

        pMsgObject->ulFlags |= MSG_OBJ_EXTENDED_ID;
    }
    else
    {
        //
        // The Identifier is an 11 bit value.
        //
        pMsgObject->ulMsgID = (usArbReg[1] & CAN_IF1ARB2_ID_M) >> 2;
    }

    //
    // Indicate that we lost some data.
    //
    if(usMsgCtrl & CAN_IF1MCTL_MSGLST)
    {
        pMsgObject->ulFlags |= MSG_OBJ_DATA_LOST;
    }

    //
    // Set the flag to indicate if ID masking was used.
    //
    if(usMsgCtrl & CAN_IF1MCTL_UMASK)
    {
        if(usArbReg[1] & CAN_IF1ARB2_XTD)
        {
            //
            // The Identifier Mask is assumed to also be a 29 bit value.
            //
            pMsgObject->ulMsgIDMask =
                ((usMaskReg[1] & CAN_IF1MSK2_IDMSK_M) << 16) | usMaskReg[0];
            //
            // If this is a fully specified Mask and a remote frame then don't
            // set the MSG_OBJ_USE_ID_FILTER because the ID was not really
            // filtered.
            //
            if((pMsgObject->ulMsgIDMask != 0x1fffffff) ||
               ((pMsgObject->ulFlags & MSG_OBJ_REMOTE_FRAME) == 0))
            {
                pMsgObject->ulFlags |= MSG_OBJ_USE_ID_FILTER;
            }
        }
        else
        {
            //
            // The Identifier Mask is assumed to also be an 11 bit value.
            //
            pMsgObject->ulMsgIDMask = ((usMaskReg[1] & CAN_IF1MSK2_IDMSK_M) >>
                                       2);

            //
            // If this is a fully specified Mask and a remote frame then don't
            // set the MSG_OBJ_USE_ID_FILTER because the ID was not really
            // filtered.
            //
            if((pMsgObject->ulMsgIDMask != 0x7ff) ||
               ((pMsgObject->ulFlags & MSG_OBJ_REMOTE_FRAME) == 0))
            {
                pMsgObject->ulFlags |= MSG_OBJ_USE_ID_FILTER;
            }
        }

        //
        // Indicate if the extended bit was used in filtering.
        //
        if(usMaskReg[1] & CAN_IF1MSK2_MXTD)
        {
            pMsgObject->ulFlags |= MSG_OBJ_USE_EXT_FILTER;
        }

        //
        // Indicate if direction filtering was enabled.
        //
        if(usMaskReg[1] & CAN_IF1MSK2_MDIR)
        {
            pMsgObject->ulFlags |= MSG_OBJ_USE_DIR_FILTER;
        }
    }

    //
    // Set the interupt flags.
    //
    if(usMsgCtrl & CAN_IF1MCTL_TXIE)
    {
        pMsgObject->ulFlags |= MSG_OBJ_TX_INT_ENABLE;
    }
    if(usMsgCtrl & CAN_IF1MCTL_RXIE)
    {
        pMsgObject->ulFlags |= MSG_OBJ_RX_INT_ENABLE;
    }

    //
    // See if there is new data available.
    //
    if(usMsgCtrl & CAN_IF1MCTL_NEWDAT)
    {
        //
        // Get the amount of data needed to be read.
        //
        pMsgObject->ulMsgLen = (usMsgCtrl & CAN_IF1MCTL_DLC_M);

        //
        // Don't read any data for a remote frame, there is nothing valid in
        // that buffer anyway.
        //
        if((pMsgObject->ulFlags & MSG_OBJ_REMOTE_FRAME) == 0)
        {
            //
            // Read out the data from the CAN registers.
            //
            CANDataRegRead(pMsgObject->pucMsgData,
                           (unsigned long *)(ulBase + CAN_O_IF2DA1),
                           pMsgObject->ulMsgLen);
        }

        //
        // Now clear out the new data flag.
        //
        CANRegWrite(ulBase + CAN_O_IF2CMSK, CAN_IF1CMSK_NEWDAT);

        //
        // Transfer the message object to the message object specifiec by
        // ulObjID.
        //
        CANRegWrite(ulBase + CAN_O_IF2CRQ, ulObjID & CAN_IF1CRQ_MNUM_M);

        //
        // Wait for busy bit to clear
        //
        while(CANRegRead(ulBase + CAN_O_IF2CRQ) & CAN_IF1CRQ_BUSY)
        {
        }

        //
        // Indicate that there is new data in this message.
        //
        pMsgObject->ulFlags |= MSG_OBJ_NEW_DATA;
    }
    else
    {
        //
        // Along with the MSG_OBJ_NEW_DATA not being set the amount of data

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久这里都是精品| 99vv1com这只有精品| 亚洲影院理伦片| 国产一区二区三区视频在线播放| 亚洲国产欧美一区二区三区丁香婷| 亚洲精品亚洲人成人网在线播放| 国产视频在线观看一区二区三区| 中文字幕欧美日本乱码一线二线 | 99这里都是精品| 国产成人夜色高潮福利影视| 黑人巨大精品欧美黑白配亚洲| 国产精品一区二区黑丝| 日本伦理一区二区| 欧美三级一区二区| 99国产精品久久久久久久久久 | 久久久久久亚洲综合影院红桃| 国产欧美综合在线观看第十页| 中文字幕在线播放不卡一区| 亚洲电影第三页| 成人国产亚洲欧美成人综合网| 91精品在线免费观看| 日韩美一区二区三区| 久久久久国产一区二区三区四区| 中文字幕高清不卡| 亚洲成人tv网| 久久电影网站中文字幕| 亚洲综合色网站| 亚洲国产日韩a在线播放性色| 一区二区三区不卡视频| 婷婷中文字幕综合| 9i在线看片成人免费| 国产偷国产偷亚洲高清人白洁| 亚洲成人tv网| 欧美日韩亚洲综合在线| 国产区在线观看成人精品| 久久激情综合网| 日韩一区二区在线看片| 一区二区三区四区乱视频| 懂色一区二区三区免费观看| 欧美日本精品一区二区三区| 日本一区二区三区国色天香 | 麻豆国产精品一区二区三区| 欧美色倩网站大全免费| 久久蜜臀中文字幕| 免费国产亚洲视频| 国产精品大尺度| 午夜成人免费电影| 91精品国产一区二区| 日本不卡1234视频| 狠狠色2019综合网| 久久99精品久久久久久动态图| 久久精品国产一区二区三| 成人综合日日夜夜| 日韩视频在线永久播放| 亚洲欧美激情在线| 精品在线一区二区| 欧美人动与zoxxxx乱| 中文字幕在线不卡| 蜜桃91丨九色丨蝌蚪91桃色| 91麻豆免费视频| 国产精品久久久久久久第一福利 | 亚洲午夜在线观看视频在线| 另类人妖一区二区av| 欧美三级在线视频| 亚洲人成人一区二区在线观看| 极品美女销魂一区二区三区免费| 欧美日韩一区二区三区免费看 | 中文字幕av资源一区| 日本高清不卡aⅴ免费网站| 天天色综合天天| 亚洲色欲色欲www| 91精品国产一区二区三区蜜臀 | 亚洲午夜精品17c| 精品国产精品网麻豆系列| 婷婷开心激情综合| 国产欧美日韩不卡免费| 欧美午夜精品久久久久久超碰| 国产成人a级片| 国产一区二区网址| 亚洲成人7777| 午夜久久久久久电影| 欧美a级一区二区| 亚洲人妖av一区二区| 欧美在线你懂的| 精品一区二区三区av| 亚洲一区二区三区中文字幕| 26uuu另类欧美亚洲曰本| 国产精品传媒在线| 国产.欧美.日韩| 亚洲精品写真福利| 欧美经典一区二区三区| 国产69精品久久99不卡| 亚洲国产成人自拍| 美洲天堂一区二卡三卡四卡视频| 色婷婷久久一区二区三区麻豆| 国产亚洲一区二区三区四区| 成人精品亚洲人成在线| 一区二区国产盗摄色噜噜| 欧美日韩情趣电影| 国产一区二三区| 亚洲欧洲精品天堂一级| 欧美日韩视频一区二区| 日韩精品视频网| 国产欧美精品一区二区三区四区| 色综合久久中文综合久久97| 日韩vs国产vs欧美| 国产日本欧美一区二区| 欧美日韩精品一区二区天天拍小说 | 欧美一区二区三区性视频| 国产真实精品久久二三区| 亚洲人亚洲人成电影网站色| 欧美精品一二三| 国产成人免费在线观看不卡| 亚洲自拍偷拍综合| 久久免费视频一区| 久久精品国产在热久久| 91亚洲国产成人精品一区二三| 日韩理论片一区二区| 久久av资源站| 亚洲卡通欧美制服中文| 26uuu精品一区二区在线观看| 波多野洁衣一区| 国产在线看一区| 亚洲一区二区三区四区不卡| 久久精品在线观看| 在线播放欧美女士性生活| 北条麻妃国产九九精品视频| 美脚の诱脚舐め脚责91| 国产午夜精品一区二区| 国产激情偷乱视频一区二区三区| 日韩精品免费专区| 亚洲一区视频在线观看视频| 国产精品污www在线观看| 日韩视频国产视频| 精品视频在线看| 99re热这里只有精品免费视频| 久久99在线观看| 男男gaygay亚洲| 日韩和欧美一区二区| 亚洲最新在线观看| 成人欧美一区二区三区| 国产女同互慰高潮91漫画| 精品嫩草影院久久| 欧美精品第1页| 欧美久久免费观看| 欧美日韩一区小说| 另类人妖一区二区av| 一区二区三区在线视频免费观看| 久久久久久久久久美女| 国产清纯美女被跳蛋高潮一区二区久久w| 韩日欧美一区二区三区| 一区二区三区四区在线| 精品日韩在线一区| 欧美日韩在线免费视频| 成人va在线观看| 久久欧美一区二区| 在线看一区二区| 成人黄色777网| 国产电影一区在线| 国产又粗又猛又爽又黄91精品| 欧美日韩视频在线第一区| 欧美日韩亚洲国产综合| 欧美私模裸体表演在线观看| 亚洲成人高清在线| 欧美国产综合色视频| 国产精品久久久久国产精品日日| 不卡的看片网站| 国产在线精品一区在线观看麻豆| 国产精品成人一区二区艾草| 欧美日韩亚洲综合一区| 久久久另类综合| 欧美成人艳星乳罩| 欧美一区二区三区视频在线| 国产日韩欧美电影| 岛国精品在线播放| 久久黄色级2电影| 国产盗摄女厕一区二区三区| 99这里都是精品| 制服丝袜一区二区三区| 久久久亚洲精华液精华液精华液| 国产精品美女久久久久久久久久久| 亚洲激情第一区| 美美哒免费高清在线观看视频一区二区| 国产一区欧美一区| 99久精品国产| 日韩欧美高清一区| 亚洲人123区| 日本成人在线电影网| 成人免费毛片app| 欧美日韩国产电影| 亚洲国产经典视频| 美女视频网站久久| 91丨porny丨国产入口| 日韩欧美一级精品久久| 国产精品毛片无遮挡高清| 日韩成人av影视| 91美女精品福利| 亚洲国产精品99久久久久久久久 | 成人美女在线观看| 在线成人免费观看|