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

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

?? can_net.c

?? 最新版IAR FOR ARM(EWARM)5.11中的代碼例子
?? C
?? 第 1 頁 / 共 2 頁
字號:
//*****************************************************************************
//
// can_net.c - This is the portion of the quick start application for CAN.
//
// Copyright (c) 2007 Luminary Micro, Inc.  All rights reserved.
// 
// Software License Agreement
// 
// Luminary Micro, Inc. (LMI) is supplying this software for use solely and
// exclusively on LMI's microcontroller products.
// 
// The software is owned by LMI and/or its suppliers, and is protected under
// applicable copyright laws.  All rights are reserved.  You may not combine
// this software with "viral" open-source software in order to form a larger
// program.  Any use in violation of the foregoing restrictions may subject
// the user to criminal sanctions under applicable laws, as well as to civil
// liability for the breach of the terms and conditions of this license.
// 
// THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED
// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
// LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
// CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
// 
// This is part of revision 1952 of the Stellaris Peripheral Driver Library.
//
//*****************************************************************************

#include "../../../hw_types.h"
#include "../../../hw_memmap.h"
#include "../../../hw_ints.h"
#include "../../../src/debug.h"
#include "../../../src/interrupt.h"
#include "../../../src/sysctl.h"
#include "../../../src/systick.h"
#include "../../../src/gpio.h"
#include "../../../utils/diag.h"
#include "../../../src/can.h"
#include "../can_device_qs/can_common.h"
#include "can_net.h"
#include "audio.h"

//*****************************************************************************
//
// This holds the information for the data receive message object that is used
// to receive commands.
//
//*****************************************************************************
tCANMsgObject g_MsgObjectRx;

//*****************************************************************************
//
// This holds the information for the data send message object that is used
// to send commands and to send command responses.
//
//*****************************************************************************
tCANMsgObject g_MsgObjectTx;

//*****************************************************************************
//
// This holds the information for the LED message object that is used
// to transmit updates for the LED.  This message object transmits a single
// byte that indicates the brightness level for the LED on the target board.
//
//*****************************************************************************
tCANMsgObject g_MsgObjectLED;

//*****************************************************************************
//
// This holds the information for the button receive message object.  It is
// used to receive messages from the target board when button press and
// release events occur.  There are two buttons and two events(press/release).
//
//*****************************************************************************
tCANMsgObject g_MsgObjectButton;

//*****************************************************************************
//
// This is the message identifier used to transmit data to the host
// application board. The host application must use the message identifier
// specified by MSGOBJ_ID_DATA_0 to receive data successfully.
//
//*****************************************************************************
#define MSGOBJ_ID_DATA_TX       (MSGOBJ_ID_DATA_0)

//*****************************************************************************
//
// This is the message identifier used to receive data from the host
// application board. The host application must use the message identifier
// specified by MSGOBJ_ID_DATA_1 to transmit data successfully.
//
//*****************************************************************************
#define MSGOBJ_ID_DATA_RX       (MSGOBJ_ID_DATA_1)

//****************************************************************************
//
// This is the message object number used by the Button message object.
//
//*****************************************************************************
#define MSGOBJ_NUM_BUTTON       1

//*****************************************************************************
//
// This is the message object number used by the LED message object.
//
//*****************************************************************************
#define MSGOBJ_NUM_LED          2

//*****************************************************************************
//
// This is the message object number used to transfer data.
//
//*****************************************************************************
#define MSGOBJ_NUM_DATA_TX      3

//*****************************************************************************
//
// This is the message object number used to receive data.
//
//*****************************************************************************
#define MSGOBJ_NUM_DATA_RX      4

//*****************************************************************************
//
// This flag is used by the g_ulFlags global variable to indicate that a
// request to update the LED brightness is being transmitted.  This flag will
// be cleared once the message has been sent.
//
//*****************************************************************************
#define FLAG_LED_TX_PEND        0x00000002

//*****************************************************************************
//
// This flag is used by the g_ulFlags global variable to indicate that a
// data transmission is in process and that no further commands or responses
// can be sent until this flag is cleared.  This flag will be cleared by the
// interrupt handler when the tramission has completed.
//
//*****************************************************************************
#define FLAG_DATA_TX_PEND       0x00000004

//*****************************************************************************
//
// This flag is used by the g_ulFlags global variable to indicate that data
// has been received and ready to be read.  The data  may either be a command
// or response to a command.  This flag will be cleared once the data has
// been processed.
//
//*****************************************************************************
#define FLAG_DATA_RECV          0x00000008

//*****************************************************************************
//
// This global holds the flags used to indicate the state of the message
// objects.
//
//*****************************************************************************
static volatile unsigned long g_ulFlags=0;

//*****************************************************************************
//
// This holds the constant that holds the firmware version for this
// application.
//
//*****************************************************************************
unsigned long const g_ulVersion = CURRENT_VERSION;

//*****************************************************************************
//
// This global is used by the button message object to store the events that
// are coming back from the target board.
//
//*****************************************************************************
static unsigned char g_pucButtonMsg[2];

//*****************************************************************************
//
// This value holds the current LED brightness level.
//
//*****************************************************************************
unsigned char g_ucLEDLevel=0;

//*****************************************************************************
//
// This function handles connection with the other CAN device and also
// handles incoming commands.
//
// /return None.
//
//*****************************************************************************
void
CANMain(void)
{
    unsigned char pucData[8];

    //
    // The data has been received.
    //
    if((g_ulFlags & FLAG_DATA_RECV) == 0)
    {
        return;
    }

    //
    // Read the data from the message object.
    //
    g_MsgObjectRx.pucMsgData = pucData;
    g_MsgObjectRx.ulMsgLen = 8;
    CANMessageGet(CAN0_BASE, MSGOBJ_NUM_DATA_RX, &g_MsgObjectRx, 1);

    //
    // Indicate that the data has been read.
    //
    g_ulFlags &= (~FLAG_DATA_RECV);

    switch(g_MsgObjectRx.pucMsgData[0])
    {
        case CMD_GET_VERSION:
        {
            //
            // Send the Version.
            //
            g_ulFlags |= FLAG_DATA_TX_PEND;

            g_MsgObjectTx.pucMsgData = (unsigned char *)&g_ulVersion;
            g_MsgObjectTx.ulMsgLen = 4;
            CANMessageSet(CAN0_BASE, MSGOBJ_NUM_DATA_TX, &g_MsgObjectTx,
                          MSG_OBJ_TYPE_TX);
        }
    }

    //
    // Clear the flag.
    //
    g_ulFlags &= ~(FLAG_DATA_RECV);
}

//*****************************************************************************
//
// This function sends a message to retrieve the firmware version from the
// target board.
//
//*****************************************************************************
int
CANGetTargetVersion(unsigned long *pulVersion)
{
    static unsigned char ucVerCmd = CMD_GET_VERSION;

    //
    // If there was already a previous message being transmitted then just
    // return.
    //
    if(g_ulFlags & FLAG_DATA_TX_PEND)
    {
        return(-1);
    }

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

    //
    // Send the button update request.
    //
    g_MsgObjectTx.pucMsgData = &ucVerCmd;
    g_MsgObjectTx.ulMsgLen = 1;

    CANMessageSet(CAN0_BASE, MSGOBJ_NUM_DATA_TX, &g_MsgObjectTx,
                  MSG_OBJ_TYPE_TX);

    //
    // Wait for some data back from the target.
    //
    while ((g_ulFlags & FLAG_DATA_RECV) == 0)
    {
    }

    //
    // Read the data from the message object.
    //
    g_MsgObjectRx.pucMsgData = (unsigned char *)pulVersion;
    g_MsgObjectRx.ulMsgLen = 4;
    CANMessageGet(CAN0_BASE, MSGOBJ_NUM_DATA_RX, &g_MsgObjectRx, 1);

    return(0);
}

//*****************************************************************************
//
// This function sends a message to set the current brightness for the LED on
// the target board.
//
//*****************************************************************************
void
CANUpdateTargetLED(unsigned char ucLevel, tBoolean bFlash)
{
    //
    // If there was already a previous message being transmitted then just
    // return.
    //
    if(g_ulFlags & FLAG_LED_TX_PEND)
    {
        return;
    }

    //
    // Set the global LED level.
    //
    g_ucLEDLevel = ucLevel;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
不卡的av在线播放| 菠萝蜜视频在线观看一区| 亚洲蜜臀av乱码久久精品| 26uuu国产一区二区三区| 欧美日韩国产综合视频在线观看| 91国产免费观看| 99久久精品免费观看| 色999日韩国产欧美一区二区| 91丝袜国产在线播放| 欧美日本韩国一区二区三区视频| 欧美日韩国产首页| 日韩一区二区三区精品视频| 日韩一区二区三区观看| 久久婷婷久久一区二区三区| 亚洲欧洲色图综合| 日韩中文字幕区一区有砖一区| 日韩电影免费一区| 国内精品第一页| 91国产免费看| 精品免费视频.| 一区二区三区在线影院| 激情成人综合网| 在线观看亚洲a| 亚洲人成影院在线观看| 午夜视频一区二区三区| 丁香婷婷综合网| 欧美在线free| 国产精品伦一区| 奇米色一区二区| 欧美在线三级电影| 欧美精品一区二区三区蜜桃视频 | 日韩一二三区视频| 国产精品免费视频一区| 美脚の诱脚舐め脚责91| 欧美在线一区二区三区| 亚洲免费色视频| 91女神在线视频| 久久精品视频在线免费观看 | 91丨九色丨蝌蚪丨老版| 91精品蜜臀在线一区尤物| 国产精品成人午夜| 丰满白嫩尤物一区二区| 精品国产免费一区二区三区四区 | 日本韩国精品一区二区在线观看| 国产欧美在线观看一区| 国产在线播放一区二区三区| 亚洲国产精品激情在线观看| 日本人妖一区二区| 久久蜜桃香蕉精品一区二区三区| 韩国在线一区二区| 亚洲婷婷在线视频| 3atv一区二区三区| 不卡区在线中文字幕| 秋霞午夜鲁丝一区二区老狼| 中文字幕一区视频| 欧美三级资源在线| 国产91精品精华液一区二区三区| **性色生活片久久毛片| 日韩精品自拍偷拍| 色综合久久综合| 韩国av一区二区三区四区| 亚洲精品视频自拍| 久久色.com| 欧美精三区欧美精三区| 色妞www精品视频| 成人精品亚洲人成在线| 免费av成人在线| 亚洲伊人色欲综合网| 最新国产の精品合集bt伙计| 久久―日本道色综合久久| 555www色欧美视频| 欧美日韩视频一区二区| 色就色 综合激情| 91丨porny丨国产入口| 国产成人久久精品77777最新版本| 香蕉加勒比综合久久| 亚洲国产日韩a在线播放| 夜夜操天天操亚洲| 中文字幕一区三区| 中文字幕色av一区二区三区| 亚洲女与黑人做爰| 一区二区三区在线视频免费 | 91丨国产丨九色丨pron| 91精品久久久久久久99蜜桃 | 亚洲一区电影777| 午夜精品久久久久久久久久久| 亚洲国产精品精华液网站| 日韩精品福利网| 国产在线日韩欧美| kk眼镜猥琐国模调教系列一区二区| 国产成人激情av| 色狠狠色噜噜噜综合网| 欧美日韩在线观看一区二区| 日韩一级黄色大片| 国产精品色在线| 无码av免费一区二区三区试看 | 日韩精品一区二区三区蜜臀| 国产欧美日韩亚州综合 | 欧美精品第一页| 国产精品五月天| 亚洲成国产人片在线观看| 国模无码大尺度一区二区三区| av不卡在线观看| 精品人伦一区二区色婷婷| 亚洲欧美中日韩| 久久99精品国产麻豆不卡| www.亚洲免费av| 精品国产凹凸成av人导航| 亚洲免费资源在线播放| 国产精品123区| 欧美一二三区在线| 亚洲福中文字幕伊人影院| 国产91富婆露脸刺激对白| 欧美日韩成人高清| 一区二区三区.www| 丁香亚洲综合激情啪啪综合| 精品电影一区二区| 久久99精品久久久久久| 日韩视频免费观看高清完整版在线观看| 国产精品久久久久aaaa樱花| 国产二区国产一区在线观看| 2023国产精华国产精品| 日韩电影在线免费| 欧美日韩国产高清一区二区三区 | 亚洲精品免费一二三区| 亚洲欧美另类久久久精品| 国产在线观看一区二区| 欧美日韩国产免费一区二区| 国产女人aaa级久久久级 | 亚洲精品一区二区三区影院| 青青草国产精品亚洲专区无| 在线不卡一区二区| 97精品久久久午夜一区二区三区 | 日韩一级免费观看| 久久99在线观看| 国产欧美日韩精品a在线观看| 成人一区在线观看| 亚洲综合丁香婷婷六月香| 欧美人妇做爰xxxⅹ性高电影| 蜜臀av性久久久久蜜臀aⅴ| 久久网这里都是精品| 在线视频你懂得一区二区三区| 日韩成人伦理电影在线观看| 久久亚洲综合色| 欧美在线免费观看亚洲| 韩国女主播成人在线观看| 亚洲美女屁股眼交3| 欧美r级电影在线观看| www.亚洲人| 国产一区二区在线影院| 亚洲mv大片欧洲mv大片精品| 国产欧美日韩综合精品一区二区| 日韩一区二区在线观看| 波多野洁衣一区| 激情六月婷婷久久| 亚洲va天堂va国产va久| 国产精品国产三级国产专播品爱网| 777色狠狠一区二区三区| 91免费视频网址| 国产精品系列在线观看| 久久精品99国产精品| 丝袜亚洲另类欧美综合| 亚洲一卡二卡三卡四卡| 国产精品福利一区二区| 国产女主播视频一区二区| 26uuu久久天堂性欧美| 欧美精品一区二区三区在线播放| 欧美日韩国产经典色站一区二区三区| 成人av午夜影院| 色综合久久88色综合天天| 在线免费观看一区| 在线播放视频一区| 日韩限制级电影在线观看| 欧美日韩精品免费观看视频| 欧美日韩一级视频| 91精品国产一区二区| 日韩女优视频免费观看| 久久久久久久久久久电影| 国产精品乱人伦| 亚洲一区在线看| 国产真实乱对白精彩久久| 成人动漫在线一区| 欧美片网站yy| 日本一区二区三区电影| 亚洲色图色小说| 国产福利一区二区三区视频| 99久精品国产| 欧美一级精品大片| 一区二区免费在线| 国内久久婷婷综合| 99re这里都是精品| 欧美www视频| 亚洲午夜久久久久久久久久久| 欧美aⅴ一区二区三区视频| 成人激情开心网| 日韩欧美高清dvd碟片| 一区二区三区中文字幕精品精品 | 日韩欧美国产麻豆| 亚洲精品v日韩精品| 成人免费福利片|