⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qs_ev-lm3s811.c

📁 Stellaris公司推出1美元ARM,这是Stellaris驱动库源程序
💻 C
📖 第 1 页 / 共 3 页
字号:
//*****************************************************************************
//
// qs_ev-lm3s811.c - The quick start application for the LM3S811 Evaluation
//                   Board.
//
// Copyright (c) 2006 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 Stellaris Family of microcontroller products.
//
// The software is owned by LMI and/or its suppliers, and is protected under
// applicable copyright laws.  All rights are reserved.  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 920 of the Stellaris Driver Library.
//
//*****************************************************************************

#include "../../hw_ints.h"
#include "../../hw_memmap.h"
#include "../../hw_types.h"
#include "../../src/adc.h"
#include "../../src/debug.h"
#include "../../src/gpio.h"
#include "../../src/interrupt.h"
#include "../../src/sysctl.h"
#include "../../src/timer.h"
#include "../../src/uart.h"
#include "../osram96x16.h"
#include "game.h"
#include "globals.h"
#include "random.h"
#include "screen_saver.h"

//*****************************************************************************
//
//! \addtogroup ev_lm3s811_list
//! <h1>EV-LM3S811 Quickstart Application (qs_ev-lm3s811)</h1>
//!
//! A game in which a ship is navigated through an endless tunnel.  The
//! potentiometer is used to move the ship up and down, and the user push
//! button is used to fire a missile to destroy obstacles in the tunnel.  Score
//! accumulates for survival and for destroying obstacles.  The game lasts for
//! only one ship; the score is displayed on the virtual UART at 115,200, 8-N-1
//! during game play and will be displayed on the screen at the end of the
//! game.
//!
//! Since the OLED display on the evaluation board has burn-in characteristics
//! similar to a CRT, the application also contains a screen saver.  The screen
//! saver will only become active if two minutes have passed without the user
//! push button being pressed while waiting to start the game (i.e. it will
//! never come on during game play).  An implementation of the Game of Life is
//! run with a field of random data as the seed value.
//!
//! After two minutes of running the screen saver, the display will be turned
//! off and the user LED will blink.  Either mode of screen saver (Game of Life
//! or blank display) will be exited by pressing the user push button.  The
//! button will then need to be pressed again to start the game.
//
//*****************************************************************************

//*****************************************************************************
//
// A bitmap for the Luminary Micro logo.  The bitmap is as follows:
//
//     xx...xxxxxxx.........
//     xx...xxxxxxxxx.......
//     xx...xx...xxxxx......
//     xx...xx...xx..xx.....
//     xx...xx...xx..xx.....
//     xx...xx...xx...xx....
//     xx...xx...xx...xx....
//     xx...xx...xx...xx....
//     xx...xx...xx...xx....
//     xx...xx...xx...xx....
//     xx....x...xx...xx....
//     .xx...x...xx...xx....
//     .xx............xx....
//     ..xxx..........xx....
//     ...xxxxxxxxxxxxxx....
//     .....xxxxxxxxxxxx....
//
// Continued...
//
//     xx......xx..xx..xx.....xx..xx..xx...xx...xxxx...xxxxx...xx..xx
//     xx......xx..xx..xxx...xxx..xx..xxx..xx..xxxxxx..xxxxxx..xx..xx
//     xx......xx..xx..xxxx.xxxx..xx..xxxx.xx..xx..xx..xx..xx..xx..xx
//     xx......xx..xx..xx.xxx.xx..xx..xx.xxxx..xxxxxx..xxxxx....xxxx.
//     xx......xx..xx..xx..x..xx..xx..xx..xxx..xxxxxx..xxxxx.....xx..
//     xxxxxx..xxxxxx..xx.....xx..xx..xx...xx..xx..xx..xx..xx....xx..
//     xxxxxx...xxxx...xx.....xx..xx..xx...xx..xx..xx..xx..xx....xx..
//     ..............................................................
//     x.....x..x...xxxx...xxxxx....xxxx.............................
//     xx...xx..x..x....x..x....x..x....x............................
//     x.x.x.x..x..x.......x....x..x....x............................
//     x..x..x..x..x.......xxxxx...x....x............................
//     x.....x..x..x.......x....x..x....x............................
//     x.....x..x..x....x..x....x..x....x............................
//     x.....x..x...xxxx...x....x...xxxx.............................
//     ..............................................................
//
//*****************************************************************************
static const unsigned char g_pucLMILogo[166] =
{
    0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x03, 0x03, 0x03, 0xff, 0xff,
    0x06, 0x06, 0x1c, 0xf8, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x7f, 0x60,
    0x60, 0x60, 0x60, 0x00, 0x00, 0x3f, 0x7f, 0x60, 0x60, 0x7f, 0x3f, 0x00,
    0x00, 0x7f, 0x7f, 0x06, 0x0c, 0x18, 0x0c, 0x06, 0x7f, 0x7f, 0x00, 0x00,
    0x7f, 0x7f, 0x00, 0x00, 0x7f, 0x7f, 0x06, 0x0c, 0x18, 0x7f, 0x7f, 0x00,
    0x00, 0x7e, 0x7f, 0x1b, 0x1b, 0x7f, 0x7e, 0x00, 0x00, 0x7f, 0x7f, 0x1b,
    0x1b, 0x7f, 0x76, 0x00, 0x00, 0x07, 0x0f, 0x78, 0x78, 0x0f, 0x07,
    0x07, 0x1f, 0x38, 0x60, 0x60, 0xc3, 0xcf, 0xc0, 0xc0, 0xc0, 0xcf, 0xcf,
    0xc0, 0xc0, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f,
    0x02, 0x04, 0x08, 0x04, 0x02, 0x7f, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x3e,
    0x41, 0x41, 0x41, 0x22, 0x00, 0x00, 0x7f, 0x09, 0x09, 0x09, 0x09, 0x76,
    0x00, 0x00, 0x3e, 0x41, 0x41, 0x41, 0x41, 0x3e, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

//*****************************************************************************
//
// A bitmap for the Keil/ARM logo.  The bitmap is as follows:
//
//     x..xxxxxxxxxxxxxxx...
//     xx..x............x...
//     x.x..x...........x...
//     x..x..x..........x...
//     x...x..x.........x...
//     x....x..x........x...
//     x.....x..x.......x...
//     x......x..x......x...
//     x.....x..x.......x...
//     x....x..x........x...
//     x...x..x.........x...
//     x..x..x..........x...
//     x.x..x...........x...
//     xx..x............x...
//     x..xxxxxxxxxxxxxxx...
//     .....................
//
// Continued...
//
//     xxx.......xxxx....xxxxxxxxxxxxx....xxx....xxx..........
//     xxx.....xxxx......xxxxxxxxxxxxx....xxx....xxx..........
//     xxx...xxxx........xxx..............xxx....xxx..........
//     xxxxxxxx..........xxxxxxxxxxxxx....xxx....xxx..........
//     xxxxxxxx..........xxxxxxxxxxxxx....xxx....xxx..........
//     xxx...xxxx........xxx..............xxx....xxx..........
//     xxx.....xxxx......xxxxxxxxxxxxx....xxx....xxxxxxxxxxxxx
//     xxx.......xxxx....xxxxxxxxxxxxx....xxx....xxxxxxxxxxxxx
//     .......................................................
//     .......................................................
//     .x.........x..xx..x...x....xx..........................
//     x.x.......x.x.x.x.xx.xx...x............................
//     xxx.xx....xxx.xx..x.x.x...x....x..xx.x..xx...xx.xx..x.x
//     x.x.x.x...x.x.x.x.x...x...x...x.x.x.x.x.x.x.x.x.x.x.x.x
//     x.x.x.x...x.x.x.x.x...x....xx..x..x.x.x.xx...xx.x.x..x.
//     ........................................x...........x..
//
//*****************************************************************************
static const unsigned char g_pucKeilLogo[152] =
{
    0xff, 0x02, 0x04, 0x09, 0x13, 0x25, 0x49, 0x91, 0x21, 0x41, 0x81, 0x01,
    0x01, 0x01, 0x01, 0x01, 0x01, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
    0x18, 0x18, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3, 0xc3, 0x81, 0x81, 0x00,
    0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb,
    0xdb, 0xdb, 0xdb, 0xdb, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00,
    0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0,
    0xc0, 0xc0, 0xc0, 0xc0,
    0x7f, 0x20, 0x10, 0x48, 0x64, 0x52, 0x49, 0x44, 0x42, 0x41, 0x40, 0x40,
    0x40, 0x40, 0x40, 0x40, 0x40, 0x7f, 0x00, 0x00, 0x00, 0x78, 0x14, 0x78,
    0x00, 0x70, 0x10, 0x60, 0x00, 0x00, 0x00, 0x78, 0x14, 0x78, 0x00, 0x7c,
    0x14, 0x68, 0x00, 0x7c, 0x08, 0x10, 0x08, 0x7c, 0x00, 0x00, 0x00, 0x38,
    0x44, 0x44, 0x00, 0x20, 0x50, 0x20, 0x00, 0x70, 0x10, 0x60, 0x10, 0x60,
    0x00, 0xf0, 0x50, 0x20, 0x00, 0x20, 0x50, 0x70, 0x00, 0x70, 0x10, 0x60,
    0x00, 0xb0, 0x40, 0x30
};

//*****************************************************************************
//
// A bitmap for the design context URL.  The bitmap is as follows:
//
//     ........................................................................
//     ........................................................................
//     ....................................xx.......................xx.........
//     ....................................xx.......................xx.........
//     ....................................xx..................................
//     xx......xx.xx......xx.xx......xx....xx......xx...xx.xxxx.xx..xx.xxxxxx..
//     xx..xx..xx.xx..xx..xx.xx..xx..xx....xx......xx...xx.xxxxxxxx.xx.xxxxxxx.
//     xx..xx..xx.xx..xx..xx.xx..xx..xx....xx......xx...xx.xx.xx.xx.xx.xx...xx.
//     xx..xx..xx.xx..xx..xx.xx..xx..xx....xx......xx...xx.xx.xx.xx.xx.xx...xx.
//     xx..xx..xx.xx..xx..xx.xx..xx..xx....xx......xx...xx.xx.xx.xx.xx.xx...xx.
//     .xxxxxxxx...xxxxxxxx...xxxxxxxx.....xx......xx...xx.xx.xx.xx.xx.xx...xx.
//     .xxxxxxxx...xxxxxxxx...xxxxxxxx..xx.xxxxxxx.xxxxxxx.xx.xx.xx.xx.xx...xx.
//     ..xx..xx.....xx..xx.....xx..xx...xx.xxxxxxx..xxxxx..xx.xx.xx.xx.xx...xx.
//     ........................................................................
//     ........................................................................
//     ........................................................................
//
// Continued...
//
//     ........................................................................
//     ........................................................................
//     ........................xx.......xx.xx..................................
//     ........................xxx.....xxx.xx..................................
//     ........................xxxx...xxxx.....................................
//     .xxxxx..xx.xxx..xx...xx.xx.xx.xx.xx.xx..xxxxx..xx.xxx...xxxxx......xxxxx
//     xxxxxxx.xxxxxxx.xx...xx.xx..xxx..xx.xx.xxxxxxx.xxxxxxx.xxxxxxx....xxxxxx
//     xx...xx.xxx..xx.xx...xx.xx...x...xx.xx.xx......xxx..xx.xx...xx....xx....
//     xx...xx.xx......xx...xx.xx.......xx.xx.xx......xx......xx...xx....xx....
//     xx...xx.xx......xx...xx.xx.......xx.xx.xx......xx......xx...xx....xx....
//     xx...xx.xx......xx...xx.xx.......xx.xx.xx......xx......xx...xx....xx....
//     xxxxxxx.xx......xxxxxxx.xx.......xx.xx.xxxxxxx.xx......xxxxxxx.xx.xxxxxx
//     .xxx.xx.xx.......xxx.xx.xx.......xx.xx..xxxxx..xx.......xxxxx..xx..xxxxx
//     .....................xx.................................................
//     ................xxxxxxx.................................................
//     .................xxxxx..................................................
//
// Continued...
//
//     ........................................................................
//     ........................................................................
//     .......................xx.xxxxxx..................xx..................xx
//     .......................xx.xxxxxxx.................xx.................xxx
//     ......................xx..xx...xx....................................xx.
//     ...xxxxx..xxxx.xx.....xx..xx...xx..xxxxx...xxxxx..xx..xxxxx..xxxxxx..xx.
//     x.xxxxxxx.xxxxxxxx...xx...xx...xx.xxxxxxx.xxxxxxx.xx.xxxxxxx.xxxxxxx.xxx
//     ..xx...xx.xx.xx.xx...xx...xx...xx.xx...xx.xx......xx.xx...xx.xx...xx..xx
//     ..xx...xx.xx.xx.xx...xx...xx...xx.xxxxxxx.xxxxxx..xx.xx...xx.xx...xx....
//     ..xx...xx.xx.xx.xx..xx....xx...xx.xxxxxxx..xxxxxx.xx.xx...xx.xx...xx....
//     ..xx...xx.xx.xx.xx..xx....xx...xx.xx...........xx.xx.xx...xx.xx...xx....
//     x.xxxxxxx.xx.xx.xx.xx.....xxxxxxx.xxxxxxx.xxxxxxx.xx.xxxxxxx.xx...xx.xxx
//     ...xxxxx..xx.xx.xx.xx.....xxxxxx...xxxxx...xxxxx..xx..xxx.xx.xx...xx..xx
//     ..........................................................xx............
//     .....................................................xxxxxxx............
//     ......................................................xxxxx.............
//
// Continued...
//
//     ........................................................................
//     ........................................................................
//     xxx.................xx.xx.................xx..........xxxxx...xxxxx...xx
//     xxxx...xx...........xx.xx.................xx.........xxxxxxx.xxxxxxx.xxx
//     .......xx...........xx.xx............................xx...xx.xx...xx.xx.
//     .....xxxxxx..xxxxx..xx.xx..xxxxx..xx.xxx..xx..xxxxx.......xx.xx..xxx.xx.
//     xxx..xxxxxx.xxxxxxx.xx.xx.xxxxxxx.xxxxxxx.xx.xxxxxxx.....xx..xx.xxxx.xx.
//     xxxx...xx...xx...xx.xx.xx.xx...xx.xxx..xx.xx.xx.........xx...xxxx.xx.xxx
//     ..xx...xx...xxxxxxx.xx.xx.xx...xx.xx......xx.xxxxxx....xx....xxx..xx.xxx
//     ..xx...xx...xxxxxxx.xx.xx.xx...xx.xx......xx..xxxxxx..xx.....xx...xx.xx.
//     ..xx...xx...xx......xx.xx.xx...xx.xx......xx......xx.xx......xx...xx.xx.
//     xxxx...xxxx.xxxxxxx.xx.xx.xxxxxxx.xx......xx.xxxxxxx.xxxxxxx.xxxxxxx.xxx
//     xxx.....xx...xxxxx..xx.xx..xxx.xx.xx......xx..xxxxx..xxxxxxx..xxxxx...xx
//     ........................................................................
//     ........................................................................
//     ........................................................................
//
// Continued...
//
//     ............
//     ............
//     xxx...xxxxx.
//     xxxx.xxxxxxx
//     ..xx.xx.....
//     .xxx.xx.....
//     xxxx.xxxxxx.
//     x.xx.xxxxxxx
//     ..xx.xx...xx
//     ..xx.xx...xx
//     ..xx.xx...xx
//     xxxx.xxxxxxx
//     xxx...xxxxx.
//     ............
//     ............
//     ............
//
//*****************************************************************************
static const unsigned char g_pucDesignLogo[600] =
{
    0xe0, 0xe0, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x00, 0xe0, 0xe0, 0x00, 0xe0,
    0xe0, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x00, 0xe0, 0xe0, 0x00, 0xe0, 0xe0,
    0x00, 0x00, 0xc0, 0xc0, 0x00, 0x00, 0xe0, 0xe0, 0x00, 0x00, 0x00, 0x00,
    0xfc, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xe0, 0x00, 0x00,
    0x00, 0xe0, 0xe0, 0x00, 0xe0, 0xe0, 0x60, 0xe0, 0xc0, 0x60, 0xe0, 0xc0,
    0x00, 0xec, 0xec, 0x00, 0xe0, 0xe0, 0x60, 0x60, 0x60, 0xe0, 0xc0, 0x00,
    0xc0, 0xe0, 0x60, 0x60, 0x60, 0xe0, 0xc0, 0x00, 0xe0, 0xe0, 0xc0, 0x60,
    0x60, 0xe0, 0xc0, 0x00, 0xe0, 0xe0, 0x00, 0x00, 0x00, 0xe0, 0xe0, 0x00,
    0xfc, 0xfc, 0x18, 0x30, 0x60, 0xc0, 0x60, 0x30, 0x18, 0xfc, 0xfc, 0x00,
    0xec, 0xec, 0x00, 0xc0, 0xe0, 0x60, 0x60, 0x60, 0x60, 0x40, 0x00, 0xe0,
    0xe0, 0xc0, 0x60, 0x60, 0xe0, 0xc0, 0x00, 0xc0, 0xe0, 0x60, 0x60, 0x60,
    0xe0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xe0, 0x60, 0x60, 0x60, 0x60,
    0x40, 0x00, 0xc0, 0xe0, 0x60, 0x60, 0x60, 0xe0, 0xc0, 0x00, 0xe0, 0xe0,
    0x60, 0xe0, 0xc0, 0x60, 0xe0, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0xf0, 0x3c,
    0x0c, 0x00, 0xfc, 0xfc, 0x0c, 0x0c, 0x0c, 0xfc, 0xf8, 0x00, 0xc0, 0xe0,
    0x60, 0x60, 0x60, 0xe0, 0xc0, 0x00, 0xc0, 0xe0, 0x60, 0x60, 0x60, 0x60,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -