亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
亚洲国产精品t66y| 久久久久久亚洲综合影院红桃| 成人免费视频一区二区| 午夜亚洲国产au精品一区二区| 精品久久一二三区| 26uuu精品一区二区| 久久久久久久久久久久久夜| 久久免费精品国产久精品久久久久| 久久久综合视频| 久久久久久久电影| 久久一区二区视频| 久久久久久久久久久久久女国产乱| 精品少妇一区二区三区| 精品日韩av一区二区| xnxx国产精品| 亚洲日本一区二区| 午夜一区二区三区在线观看| 午夜私人影院久久久久| 国内精品在线播放| 成人性色生活片| 国产精品一区二区不卡| 国产在线视频不卡二| 国产精品美女久久福利网站| 国产精品伦一区二区三级视频| 中文av字幕一区| 免费一级片91| 91小视频免费观看| 欧美日韩一区国产| 国产精品乱码一区二区三区软件| 亚洲一区二区不卡免费| 国产精品一品视频| 欧美精品乱人伦久久久久久| 在线播放91灌醉迷j高跟美女 | 97久久人人超碰| 久久中文娱乐网| 日韩成人一区二区| 91亚洲精品久久久蜜桃| 精品成人a区在线观看| 亚洲同性gay激情无套| 久久激情五月婷婷| 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 国产福利精品一区| 美女www一区二区| 国产成人在线视频网站| 欧美日韩国产免费一区二区| 亚洲欧美一区二区视频| 国产不卡高清在线观看视频| 国产日韩精品一区二区三区| 粉嫩av一区二区三区粉嫩| 日韩欧美在线综合网| 国内久久精品视频| 亚洲欧美一区二区久久 | 欧美日韩一卡二卡| 性做久久久久久免费观看| 国产精品99久久久久| 国产欧美一区二区三区网站| 国产激情一区二区三区桃花岛亚洲| 国产精品盗摄一区二区三区| 日本精品视频一区二区| 亚洲v日本v欧美v久久精品| 777奇米四色成人影色区| 激情文学综合网| 一区二区三区欧美视频| 精品国产乱码久久久久久久久| 国产精品久久精品日日| 欧美日韩一区二区三区高清 | 裸体一区二区三区| 精品国产乱子伦一区| av一区二区三区四区| 亚洲18女电影在线观看| 国产午夜亚洲精品理论片色戒| 欧美性大战久久久| 国产精品影音先锋| 亚洲色图欧美在线| 欧美mv和日韩mv国产网站| 国产成人免费高清| 亚洲午夜免费视频| 一区二区三区成人| 亚洲少妇中出一区| 亚洲精品乱码久久久久久日本蜜臀| 日韩三级电影网址| 3d成人h动漫网站入口| 欧美性大战久久久久久久蜜臀| voyeur盗摄精品| 色综合久久六月婷婷中文字幕| 99综合电影在线视频| 91在线无精精品入口| 亚洲美女视频在线| 中文字幕一区二| 国产精品初高中害羞小美女文| 久久男人中文字幕资源站| 久久婷婷久久一区二区三区| 2023国产精品视频| 精品国产一区二区三区av性色 | 91精品国产91久久久久久最新毛片| 欧美曰成人黄网| 欧美午夜精品一区| 欧美激情一区二区三区四区| 中文字幕在线不卡视频| 欧美高清在线精品一区| 国产精品日韩成人| 亚洲欧美乱综合| 一区二区不卡在线视频 午夜欧美不卡在 | 亚洲欧洲日本在线| 亚洲人成亚洲人成在线观看图片 | 91精品婷婷国产综合久久性色| 精品国产一二三| 亚洲韩国一区二区三区| 国产在线日韩欧美| 欧美体内she精视频| 日韩欧美你懂的| 中文字幕在线一区二区三区| 中文字幕日本乱码精品影院| 亚洲成人免费电影| 高清beeg欧美| 欧美日韩一区二区三区在线看| 久久久99免费| 亚洲欧洲国产专区| 国产成人在线免费| 欧美xxxx老人做受| 麻豆高清免费国产一区| 色综合一区二区| 国产精品国产a| 成人综合日日夜夜| 精品精品国产高清一毛片一天堂| 一区二区三区在线观看国产| 成人深夜福利app| 国产精品女同一区二区三区| 美腿丝袜亚洲色图| 日韩精品中文字幕在线不卡尤物| 国产精品久久夜| 国产精品综合一区二区| 天天综合网 天天综合色| 欧美日韩中文精品| 日本不卡一区二区三区高清视频| 91久久精品一区二区三| 亚洲欧美成人一区二区三区| 成人爽a毛片一区二区免费| 久久一区二区三区四区| 精品中文av资源站在线观看| 精品久久人人做人人爰| 韩国一区二区三区| 欧美α欧美αv大片| 久草这里只有精品视频| 日韩免费看的电影| 久久97超碰国产精品超碰| 欧美性猛片xxxx免费看久爱| 樱花草国产18久久久久| 日本精品一区二区三区四区的功能| 1区2区3区国产精品| 国产精品一区二区无线| 欧美精品一区二区三区在线| 精品在线亚洲视频| 国产精品成人网| 欧美二区在线观看| 一本久久综合亚洲鲁鲁五月天| 亚洲成人黄色小说| 中文无字幕一区二区三区| 色美美综合视频| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 色综合天天综合网国产成人综合天 | 99精品国产99久久久久久白柏| 亚洲精品视频自拍| 欧美日韩中文字幕精品| av电影在线观看一区| 国产自产视频一区二区三区| 捆绑变态av一区二区三区| 26uuu另类欧美亚洲曰本| 97精品国产露脸对白| 国产成人自拍网| 国产一区在线视频| 日韩国产欧美三级| 日本在线不卡视频| 夜夜嗨av一区二区三区四季av| 亚洲国产精品二十页| 精品久久久久一区| 欧美大片一区二区三区| 欧美伦理电影网| 欧美日韩情趣电影| 91麻豆精品国产91久久久久久久久 | 精品国产亚洲在线| 欧美成人video| 91精品国产综合久久久久久漫画| 在线观看免费视频综合| 欧美无砖砖区免费| 欧美一区二区黄色| 日韩无一区二区| 欧美精品一区二| 色婷婷综合五月| 欧美日韩aaaaaa| 国产网红主播福利一区二区| 国产精品国产三级国产aⅴ中文| 一区二区三区欧美在线观看| 五月婷婷激情综合| 国产一区二区三区四区五区美女| 国内精品第一页| 在线观看精品一区| 欧美精品一区在线观看| 亚洲国产精品激情在线观看| 亚洲午夜一区二区|