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

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

?? can_net.c

?? 最新版IAR FOR ARM(EWARM)5.11中的代碼例子
?? C
?? 第 1 頁 / 共 2 頁
字號:
    //
    // If a flash was requested then set the flag.
    //
    if(bFlash == true)
    {
        g_ucLEDLevel |= LED_FLASH_ONCE;
    }

    //
    // A transmit request is about to be pending.
    //
    g_ulFlags |= FLAG_LED_TX_PEND;

    //
    // Send the button update request.
    //
    CANMessageSet(CAN0_BASE, MSGOBJ_NUM_LED, &g_MsgObjectLED,
                  MSG_OBJ_TYPE_TX);
}

//*****************************************************************************
//
// This function configures the message objects used by this application.
// The following four message objects used by this application:
// MSGOBJ_ID_BUTTON, MSGOBJ_ID_LED, MSGOBJ_ID_DATA_TX, and MSGOBJ_ID_DATA_RX.
//
//*****************************************************************************
void
CANConfigureNetwork(void)
{
    //
    // Set the identifier and mask for the button object.
    //
    g_MsgObjectButton.ulMsgID = MSGOBJ_ID_BUTTON;
    g_MsgObjectButton.ulMsgIDMask = 0;

    //
    // This enables interrupts for received messages.
    //
    g_MsgObjectButton.ulFlags = MSG_OBJ_RX_INT_ENABLE;

    //
    // Set the size of the message and the data buffer used.
    //
    g_MsgObjectButton.ulMsgLen = 2;
    g_MsgObjectButton.pucMsgData = g_pucButtonMsg;

    //
    // Configure the Button receive message object.
    //
    CANMessageSet(CAN0_BASE, MSGOBJ_NUM_BUTTON, &g_MsgObjectButton,
                  MSG_OBJ_TYPE_RX);

    //
    // This message object will receive updates to the LED.
    //
    g_MsgObjectLED.ulMsgID = MSGOBJ_ID_LED;
    g_MsgObjectLED.ulMsgIDMask = 0;

    //
    // This enables interrupts for received messages.
    //
    g_MsgObjectLED.ulFlags = MSG_OBJ_TX_INT_ENABLE;

    //
    // Set the length of the message and the data buffer used.
    //
    g_MsgObjectLED.ulMsgLen = 1;
    g_MsgObjectLED.pucMsgData = &g_ucLEDLevel;

    //
    // This message object will transmit commands.
    //
    g_MsgObjectTx.ulMsgID = MSGOBJ_ID_DATA_TX;
    g_MsgObjectTx.ulMsgIDMask = 0;

    //
    // This enables interrupts for received messages.
    //
    g_MsgObjectTx.ulFlags = MSG_OBJ_TX_INT_ENABLE;

    //
    // The length of the message, which should only be one byte.  Don't set
    // the pointer until it is used.
    //
    g_MsgObjectTx.ulMsgLen = 1;
    g_MsgObjectTx.pucMsgData = (unsigned char *)0xffffffff;

    //
    // This message object will received data from commands.
    //
    g_MsgObjectRx.ulMsgID = MSGOBJ_ID_DATA_RX;
    g_MsgObjectRx.ulMsgIDMask = 0;

    //
    // This enables interrupts for received messages.
    //
    g_MsgObjectRx.ulFlags = MSG_OBJ_RX_INT_ENABLE;

    //
    // The length of the message, which should only be one byte.  Don't set
    // the pointer until it is used.
    //
    g_MsgObjectRx.ulMsgLen = 1;
    g_MsgObjectRx.pucMsgData = (unsigned char *)0xffffffff;

    //
    // Configure the data receive message object.
    //
    CANMessageSet(CAN0_BASE, MSGOBJ_NUM_DATA_RX, &g_MsgObjectRx,
                  MSG_OBJ_TYPE_RX);
}

//*****************************************************************************
//
// The CAN controller Interrupt handler.
//
//*****************************************************************************
void
CANHandler(void)
{
    unsigned long ulStatus;

    //
    // Find the cause of the interrupt, if it is a status interrupt then just
    // acknowledge the interrupt by reading the status register.
    //
    ulStatus = CANIntStatus(CAN0_BASE, CAN_INT_STS_CAUSE);

    switch(ulStatus)
    {
        //
        // Let the forground loop handle sending this, just set a flag to
        // indicate that the data should be sent.
        //
        case MSGOBJ_NUM_BUTTON:
        {
            //
            // Read the Button Message.
            //
            CANMessageGet(CAN0_BASE, MSGOBJ_NUM_BUTTON,
                &g_MsgObjectButton, 1);

            //
            // Only respond to buttons being release.
            //
            if(g_MsgObjectButton.pucMsgData[0] == EVENT_BUTTON_RELEASED)
            {
                //
                // Check if the up button was released.
                //
                if(g_MsgObjectButton.pucMsgData[1] == TARGET_BUTTON_UP)
                {
                    //
                    // Adjust the volume up by 10.
                    //
                    AudioVolumeUp(10);
                }

                //
                // Check if the down button was released.
                //
                if(g_MsgObjectButton.pucMsgData[1] == TARGET_BUTTON_DN)
                {
                    //
                    // Adjust the volume down by 10.
                    //
                    AudioVolumeDown(10);
                }
            }
            break;
        }

        //
        // When the LED message object interrupts, just clear the flag so that
        // more LED messages are allowed to transfer.
        //
        case MSGOBJ_NUM_LED:
        {
            g_ulFlags &= (~FLAG_LED_TX_PEND);
            break;
        }

        //
        // When the transmit data message object interrupts, clear the
        // flag so that more data can be trasferred.
        //
        case MSGOBJ_NUM_DATA_TX:
        {
            g_ulFlags &= (~FLAG_DATA_TX_PEND);
            break;
        }

        //
        // When a receive data message object interrupts, set the flag to
        // indicate that new data is ready.
        //
        case MSGOBJ_NUM_DATA_RX:
        {
            g_ulFlags |= FLAG_DATA_RECV;
            break;
        }

        //
        // This was a status interrupt so read the current status to
        // clear the interrupt and return.
        //
        default:
        {
            //
            // Read the controller status to acknowledge this interrupt.
            //
            CANStatusGet(CAN0_BASE, CAN_STS_CONTROL);

            //
            // If there was a LED transmission pending, then stop it and
            // clear the flag.
            //
            if(g_ulFlags & FLAG_LED_TX_PEND)
            {
                //
                // Disable this message object until we retry it later.
                //
                CANMessageClear(CAN0_BASE, MSGOBJ_NUM_LED);

                //
                // Clear the transmit pending flag.
                //
                g_ulFlags &= (~FLAG_LED_TX_PEND);
            }

            //
            // If there was a Data transmission pending, then stop it and
            // clear the flag.
            //
            if(g_ulFlags & FLAG_DATA_TX_PEND)
            {
                //
                // Disable this message object until we retry it later.
                //
                CANMessageClear(CAN0_BASE, MSGOBJ_NUM_DATA_TX);

                //
                // Clear the transmit pending flag.
                //
                g_ulFlags &= (~FLAG_DATA_TX_PEND);
            }
            return;
        }
    }

    //
    // Acknowledge the CAN controller interrupt has been handled.
    //
    CANIntClear(CAN0_BASE, ulStatus);
}

//*****************************************************************************
//
// This function configures the CAN hardware and the message objects so that
// they are ready to use once the application returns from this function.
//
//*****************************************************************************
void
CANConfigure(void)
{
    //
    // Configure CAN Pins
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
    GPIOPinTypeCAN(GPIO_PORTD_BASE, GPIO_PIN_0 | GPIO_PIN_1);

    //
    // Enable the CAN controllers.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_CAN0);

    //
    // Reset the state of all the message object and the state of the CAN
    // module to a known state.
    //
    CANInit(CAN0_BASE);

    //
    // Configure the bit clock parameters for the CAN device.
    //
    CANSetBitTiming(CAN0_BASE,
        (tCANBitClkParms *)&CANBitClkSettings[CANBAUD_250K]);

    //
    // Take the CAN1 device out of INIT state.
    //
    CANEnable(CAN0_BASE);

    //
    // Enable interrups from CAN controller.
    //
    CANIntEnable(CAN0_BASE, CAN_INT_MASTER | CAN_INT_ERROR);

    //
    // Set up the message object that will receive all messages on the CAN
    // bus.
    //
    CANConfigureNetwork();

    //
    // Enable interrupts for the CAN in the NVIC.
    //
    IntEnable(INT_CAN0);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美在线观看你懂的| 懂色av一区二区夜夜嗨| 久久久久久9999| 91免费国产视频网站| 久久精品国产精品青草| 1000精品久久久久久久久| 91精品福利在线一区二区三区| 国产高清一区日本| 午夜不卡av免费| 最新成人av在线| www国产精品av| 欧美人牲a欧美精品| 97se亚洲国产综合在线| 国产真实乱偷精品视频免| 精品一区二区免费| 91视频观看免费| 欧美大片在线观看一区二区| 成人激情文学综合网| 日本三级韩国三级欧美三级| 亚洲黄色录像片| 国产精品欧美久久久久一区二区 | 一区二区三区精密机械公司| 精品福利一区二区三区 | 精品视频色一区| 成人免费视频免费观看| 国产在线一区观看| 久久精品国产99| 视频一区二区三区中文字幕| 一区二区三区不卡在线观看| 欧美激情一区二区三区在线| 日韩精品中文字幕一区| 国产精品视频麻豆| 欧美一二三四在线| 欧美中文字幕一区二区三区| 亚洲精品日韩专区silk| 国产最新精品免费| 《视频一区视频二区| 中文字幕免费不卡| 国产欧美一区二区精品仙草咪| 欧美日韩国产成人在线91| 在线观看www91| 91在线国内视频| www.亚洲色图| aaa欧美色吧激情视频| 不卡在线视频中文字幕| 菠萝蜜视频在线观看一区| 成人夜色视频网站在线观看| 成人午夜又粗又硬又大| 大陆成人av片| 99精品欧美一区二区三区综合在线| 波波电影院一区二区三区| 91在线云播放| 色婷婷亚洲综合| 成人免费视频视频在线观看免费 | 国产91丝袜在线播放0| 老司机精品视频导航| 久久精品国产999大香线蕉| 亚洲国产精品欧美一二99| 国产女主播在线一区二区| 国产盗摄精品一区二区三区在线 | www.日韩av| 色狠狠一区二区| 欧美日韩一区视频| 91麻豆精品国产91久久久久久久久 | 亚洲黄色录像片| 亚洲成人av在线电影| 日本午夜一本久久久综合| 麻豆国产欧美一区二区三区| 国产精品亚洲一区二区三区妖精 | 久久亚洲精品国产精品紫薇| 久久久久久久久久久黄色| 国产精品理伦片| 亚洲一区二区三区激情| 久久国产精品99久久久久久老狼| 国产v综合v亚洲欧| 在线精品视频免费观看| 欧美一级夜夜爽| 国产精品美女久久久久aⅴ| 玉足女爽爽91| 国产真实精品久久二三区| 国产欧美日韩视频在线观看| 91精品免费观看| 国产拍欧美日韩视频二区 | 亚洲永久免费视频| 日本成人在线电影网| 国产aⅴ精品一区二区三区色成熟| 99re成人精品视频| 91麻豆精品91久久久久同性| 国产精品国产三级国产a| 洋洋av久久久久久久一区| 精品写真视频在线观看| 91首页免费视频| 欧美电影精品一区二区| 亚洲精品一二三| 韩国v欧美v亚洲v日本v| 欧美综合在线视频| 亚洲精品一线二线三线| 亚洲制服丝袜av| 91极品视觉盛宴| 欧美国产1区2区| 日本在线不卡视频| 色网综合在线观看| 久久先锋影音av| 亚洲线精品一区二区三区| 国产福利一区在线| 777a∨成人精品桃花网| 国产视频一区在线观看| 亚洲男人的天堂在线观看| 久久99精品视频| 欧美少妇性性性| 亚洲日本中文字幕区| 国产精品资源在线看| 91精品国产欧美一区二区| 亚洲精选视频在线| 波多野结衣中文字幕一区| 日韩美女天天操| 亚洲超碰精品一区二区| 91亚洲大成网污www| 中文字幕成人av| 国内成人免费视频| 日韩欧美一区二区在线视频| 亚洲一区二区三区精品在线| 色综合久久综合网97色综合 | 成人伦理片在线| 久久精品夜夜夜夜久久| 六月婷婷色综合| 欧美另类高清zo欧美| 亚洲最色的网站| 91视视频在线观看入口直接观看www| 国产女人aaa级久久久级 | 亚洲国产精品久久艾草纯爱| 91麻豆福利精品推荐| 亚洲三级免费观看| 97精品久久久久中文字幕| 欧美国产精品一区二区| 成人性色生活片| 国产欧美日韩卡一| 粉嫩一区二区三区在线看| 久久九九影视网| 国产精品一级二级三级| 国产人伦精品一区二区| 国产成人在线视频免费播放| 国产亚洲自拍一区| 国产精品综合一区二区| 欧美国产禁国产网站cc| 不卡的电影网站| 亚洲视频在线一区观看| 在线一区二区观看| 亚洲成人av免费| 91精品国产91久久久久久一区二区 | 色综合久久久久| 亚洲精品久久久久久国产精华液| 色婷婷亚洲精品| 亚洲国产三级在线| 日韩一级欧美一级| 国产在线精品一区二区不卡了| 久久久久久久久久电影| 成人三级在线视频| 曰韩精品一区二区| 91精品国产综合久久久久久漫画| 裸体一区二区三区| 国产婷婷一区二区| 一本一道综合狠狠老| 午夜精品久久久久久久99樱桃| 欧美精选午夜久久久乱码6080| 麻豆成人久久精品二区三区小说| 久久亚洲精品国产精品紫薇| a4yy欧美一区二区三区| 香蕉av福利精品导航| 精品国产一区二区三区四区四| 国产福利精品一区二区| 亚洲伦理在线精品| 日韩视频在线你懂得| 成人免费黄色在线| 亚洲国产精品嫩草影院| 精品国产乱码久久久久久免费| 国产成人综合亚洲网站| 亚洲主播在线观看| 精品久久国产97色综合| 不卡电影一区二区三区| 日韩精品欧美成人高清一区二区| 久久精品无码一区二区三区| 一本久久综合亚洲鲁鲁五月天| 麻豆精品视频在线| 综合亚洲深深色噜噜狠狠网站| 日韩亚洲欧美成人一区| 成人午夜免费视频| 日本人妖一区二区| 一色屋精品亚洲香蕉网站| 日韩午夜精品视频| 色综合久久中文综合久久牛| 精品一区二区三区蜜桃| 亚洲国产色一区| 国产精品国产自产拍在线| 日韩视频123| 欧美在线一二三| www.99精品| 国产一区二区三区视频在线播放| 午夜久久久影院| 亚洲欧美另类图片小说|