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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? qs_dk-lm3s801.c

?? 最新版IAR FOR ARM(EWARM)5.11中的代碼例子
?? C
?? 第 1 頁 / 共 2 頁
字號:
//*****************************************************************************
//
// qs_dk-lm3s801.c - A quick start sample application to demo chip features
//
// Copyright (c) 2006-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_memmap.h"
#include "../../../hw_types.h"
#include "../../../src/comp.h"
#include "../../../src/debug.h"
#include "../../../src/gpio.h"
#include "../../../src/interrupt.h"
#include "../../../src/sysctl.h"
#include "../../../src/systick.h"
#include "../../../src/pwm.h"
#include "../../../src/adc.h"
#include "../../../src/uart.h"
#include "../pdc.h"

//*****************************************************************************
//
// Define I/O configuration.
//
//*****************************************************************************
#define COMPARATOR_ID   1
#define GPIO_PIN_MUTE   GPIO_PIN_4

//*****************************************************************************
//
//! \addtogroup dk_lm3s801_list
//! <h1>DK-LM3S801 Quickstart Application (qs_dk-lm3s801)</h1>
//!
//! This example uses the potentiometer on the development board to vary the
//! rate and frequency of a repetitive beep from the piezo buzzer.  Turning the
//! knob in one direction will result in slower beeps at lower frequency, while
//! turning it the other direction will result in faster beeps at a higher
//! frequency.  The potentiometer setting along with the tone ``note'' is
//! displayed on the LCD, and a log of the readings is output on the UART at
//! 115,200, 8-n-1.  The push button can be used to turn the beeping noise on
//! and off; when off the LCD and UART still show the setting.
//
//*****************************************************************************

//*****************************************************************************
//
// The voltage levels of the internal voltage reference to use for comparison
// to the photocell input.
//
//*****************************************************************************
static const unsigned long g_pulCompLevels[] =
{
    COMP_REF_0_1375V, COMP_REF_0_275V, COMP_REF_0_4125V, COMP_REF_0_55V,
    COMP_REF_0_6875V, COMP_REF_0_825V, COMP_REF_0_9625V, COMP_REF_1_1V,
    COMP_REF_1_2375V, COMP_REF_1_375V, COMP_REF_1_5125V, COMP_REF_1_65V,
    COMP_REF_1_7875V, COMP_REF_1_925V, COMP_REF_2_0625V
};

//*****************************************************************************
//
// Table of frequencies to use for each of the 16 levels for tone generation.
//
//*****************************************************************************
static const unsigned long g_ulFreqMap[] =
{
     440,  494,  523,  587,  659,  698,  784,
     880,  988, 1046, 1174, 1318, 1396, 1568,
    1760, 1976
};

//*****************************************************************************
//
// Table of note names corresponding to the tones.
//
//*****************************************************************************
static const char g_chNoteMap[] =
{
    'A', 'B', 'C', 'D', 'E', 'F', 'G',
    'a', 'b', 'c', 'd', 'e', 'f', 'g', 'A', 'B'
};
static char g_chNote = '-';

//*****************************************************************************
//
// Frequency of tone to be played on the piezo buzzer.
//
//*****************************************************************************
static unsigned long g_ulToneFreq;

//*****************************************************************************
//
// The frequency of the system clock, in Hz.
//
//*****************************************************************************
static unsigned long g_ulSystemClock;

//*****************************************************************************
//
// The current index into the internal voltage reference array.
//
//*****************************************************************************
static unsigned long g_ulCompIdx;

//*****************************************************************************
//
// The current accumulation of results from the comparator.
//
//*****************************************************************************
static unsigned long g_ulCompAccum;

//*****************************************************************************
//
// The most recent setting of the potentiometer.
//
//*****************************************************************************
static unsigned long g_ulPotSetting;

//*****************************************************************************
//
// The number of SysTick counts between clicks of the piezo.
//
//*****************************************************************************
static unsigned long g_ulClickRate;

//*****************************************************************************
//
// Counts SysTick events.  Used to determine when the piezo should make a
// sound.
//
//*****************************************************************************
static unsigned long g_ulClickRateCount;

//*****************************************************************************
//
// The counter of the number of consecutive times that the push button has a
// value different than the currently debounced state.
//
//*****************************************************************************
static unsigned long g_ulDebounceCounter;

//*****************************************************************************
//
// A set of flags.  The flag bits are defined as follows:
//
//     0 -> The mute flag; when clear, the piezo will not be clicked and the
//          comparator results will only be available on the LCD and over the
//          UART.  When set, the piezo will click.
//     1 -> An indicator from the SysTick interrupt handler to the main code
//          that new comparator results are available.
//     2 -> The current debounced state of the push button.
//     3 -> An indicator that a SysTick interrupt has occurred.
//
//*****************************************************************************
#define FLAG_UNMUTE     0
#define FLAG_RESULTS    1
#define FLAG_BUTTON     2
#define FLAG_SYSTICK    3
static volatile unsigned long g_ulFlags;

//*****************************************************************************
//
// The error routine that is called if the driver library encounters an error.
//
//*****************************************************************************
#ifdef DEBUG
void
__error__(char *pcFilename, unsigned long ulLine)
{
}
#endif

//*****************************************************************************
//
// The interrupt handler for the SysTick interrupt.
//
//*****************************************************************************
void
SysTickIntHandler(void)
{
    //
    // Indicate that a SysTick interrupt has occurred.
    //
    HWREGBITW(&g_ulFlags, FLAG_SYSTICK) = 1;

    //
    // Determine the tick rate.  Get the current comparator value.  Increment
    // the accumulator if it is one.
    //
    if(ComparatorValueGet(COMP_BASE, COMPARATOR_ID))
    {
        g_ulCompAccum++;
    }

    //
    // Increment the internal reference voltage array index and see if the end
    // has been reached.
    //
    g_ulCompIdx++;
    if(g_ulCompIdx == (sizeof(g_pulCompLevels) / sizeof(g_pulCompLevels[0])))
    {
        //
        // Go back to the beginning of the array.
        //
        g_ulCompIdx = 0;

        //
        // Save the comparison results and reset the accumulator.
        //
        g_ulPotSetting = g_ulCompAccum;
        g_ulCompAccum = 0;

        //
        // Set the bit in g_ulFlags indicating that new results are available.
        //
        HWREGBITW(&g_ulFlags, FLAG_RESULTS) = 1;

        //
        // Compute the new rate at which to click the piezo.
        //
        g_ulClickRate = ((15 - g_ulPotSetting) + 3) * 5;

        //
        // If the current count is greater than the click rate then set the
        // count to the click rate so that the click will happen sooner.
        //
        if(g_ulClickRateCount > g_ulClickRate)
        {
            g_ulClickRateCount = g_ulClickRate;
        }
    }

    //
    // Set the internal reference voltage to the next comparison value.
    //
    ComparatorRefSet(COMP_BASE, g_pulCompLevels[g_ulCompIdx]);

    //
    // Determine the tone frequency of the piezo buffer.  The input for tone
    // level is the comparator.  Look up the tone freq based on 1 of 16 levels.
    //
    g_ulToneFreq = g_ulFreqMap[g_ulPotSetting];
    g_chNote = g_chNoteMap[g_ulPotSetting];

    //
    // Determine if the piezo should be muted.  See if the push button is in a
    // different state than the currently debounced state.
    //
    if((GPIOPinRead(GPIO_PORTB_BASE, GPIO_PIN_MUTE) ? 1 : 0) !=
       HWREGBITW(&g_ulFlags, FLAG_BUTTON))
    {
        //
        // Increment the number of counts with the push button in a different
        // state.
        //
        g_ulDebounceCounter++;

        //
        // If four consecutive counts have had the push button in a different
        // state then the state has changed.
        //
        if(g_ulDebounceCounter == 4)
        {
            //
            // Toggle the debounced state of the push button.
            //
            HWREGBITW(&g_ulFlags, FLAG_BUTTON) ^= 1;

            //

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久综合精品| 久久久久久久久97黄色工厂| 久久99国产精品麻豆| 一区二区三区在线免费观看 | 久久激五月天综合精品| 中文字幕在线不卡视频| 日韩欧美中文字幕制服| 2023国产精华国产精品| 欧美美女激情18p| 欧美中文字幕亚洲一区二区va在线 | 国产精品高清亚洲| 亚洲欧美中日韩| 一区二区视频在线| 亚洲第一福利视频在线| 午夜久久福利影院| 亚洲香肠在线观看| 亚洲chinese男男1069| 久久蜜桃一区二区| 日本一区二区成人| 亚洲欧美色图小说| 亚洲成人精品影院| 美女在线一区二区| 国产成人亚洲综合a∨婷婷图片| 成人丝袜高跟foot| 成人激情免费电影网址| 丰满少妇久久久久久久 | 国产午夜精品美女毛片视频| 中文字幕不卡一区| 国产经典欧美精品| 国产一区欧美一区| 色综合色狠狠天天综合色| 欧美日韩日日摸| 精品对白一区国产伦| 国产欧美一区二区精品久导航 | 国产精品国产精品国产专区不蜜| 亚洲人成电影网站色mp4| 五月天欧美精品| 国产精品影视天天线| youjizz国产精品| 欧美日韩精品一区二区三区| 51久久夜色精品国产麻豆| 26uuu久久天堂性欧美| 亚洲欧美日韩在线不卡| 欧美aⅴ一区二区三区视频| 国产成人啪免费观看软件| 在线欧美一区二区| 精品国产露脸精彩对白| 4438x亚洲最大成人网| 中文字幕va一区二区三区| 亚洲国产精品久久久久婷婷884 | 欧美三级三级三级| 国产精品一区二区三区四区 | 国产传媒日韩欧美成人| 在线影视一区二区三区| 26uuu亚洲综合色欧美| 亚洲人成在线播放网站岛国 | 欧美精品乱码久久久久久| 日韩免费观看2025年上映的电影| 国产精品久久久久久久第一福利| 亚洲成年人网站在线观看| 国产精品一区二区男女羞羞无遮挡| 日本久久电影网| 久久久青草青青国产亚洲免观| 亚洲一区二区三区国产| 国产suv精品一区二区883| 正在播放亚洲一区| 一区二区高清免费观看影视大全 | 国产成人av资源| 欧美日韩和欧美的一区二区| 中文字幕精品一区二区三区精品| 日本强好片久久久久久aaa| 91香蕉视频在线| 久久久久久99久久久精品网站| 婷婷成人综合网| 91国产丝袜在线播放| 国产精品久久久久影院亚瑟| 国产在线播放一区二区三区| 欧美一二三在线| 制服丝袜中文字幕一区| 一区二区三区欧美在线观看| 国产·精品毛片| 精品毛片乱码1区2区3区| 亚洲在线免费播放| 99久久精品国产精品久久| 精品少妇一区二区三区免费观看 | 成人毛片老司机大片| 日韩欧美第一区| 亚洲第一久久影院| 欧美系列亚洲系列| 亚洲精品中文在线影院| 在线观看国产精品网站| 中文字幕亚洲区| 成人国产免费视频| 国产三级一区二区| 黄网站免费久久| 亚洲精品在线三区| 紧缚奴在线一区二区三区| 精品国产三级a在线观看| 美国十次综合导航| 91精品国产黑色紧身裤美女| 午夜在线成人av| 欧美一区二区三区四区视频| 国产精品久久看| 欧美经典一区二区| 国产成人在线观看免费网站| 精品国产不卡一区二区三区| 久久成人羞羞网站| 精品国产一区二区亚洲人成毛片| 免费看日韩a级影片| 欧美xxxxx牲另类人与| 国内久久精品视频| 91香蕉视频污在线| 亚洲乱码国产乱码精品精可以看 | 国产剧情在线观看一区二区| 国产亚洲一本大道中文在线| 粉嫩高潮美女一区二区三区| 亚洲欧洲av色图| 在线观看国产精品网站| 日韩黄色在线观看| 精品女同一区二区| 国产高清精品在线| 色综合欧美在线视频区| 精品久久国产老人久久综合| 精一区二区三区| 国产精品青草综合久久久久99| 99久久免费国产| 亚洲裸体xxx| 91免费在线播放| 亚洲国产aⅴ天堂久久| 精品美女在线播放| 成人免费视频app| 亚洲综合丁香婷婷六月香| 欧美日韩国产大片| 国内精品久久久久影院薰衣草| 国产精品视频观看| 欧美精品v日韩精品v韩国精品v| 久久99精品国产麻豆婷婷| 中文字幕精品一区| 欧美体内she精高潮| 日韩精品成人一区二区在线| 欧美成人三级电影在线| 成人短视频下载| 日韩激情一二三区| 国产欧美日韩不卡| 欧美日韩免费一区二区三区视频| 精品一区二区三区欧美| 国产精品狼人久久影院观看方式| 欧美日韩和欧美的一区二区| 成人免费在线播放视频| 欧美一级在线免费| 99精品在线免费| 欧美aaa在线| 亚洲男人电影天堂| 亚洲精品一区二区三区在线观看 | 欧美精品久久99久久在免费线| 日本韩国一区二区三区| 日韩av电影免费观看高清完整版| 久久网站最新地址| 在线看日韩精品电影| 国内精品免费**视频| 成人免费av网站| 成人免费一区二区三区在线观看| 日韩一区二区三区观看| 成人免费看黄yyy456| 美腿丝袜亚洲三区| 亚洲综合丝袜美腿| 国产性色一区二区| 欧美日韩色综合| 成人激情文学综合网| 奇米亚洲午夜久久精品| 亚洲国产视频一区| 国产精品美女久久久久高潮| 日韩一区二区电影| 欧美视频精品在线观看| 成人免费观看av| 黄色成人免费在线| 日本三级亚洲精品| 亚洲国产精品久久久久秋霞影院 | 国产iv一区二区三区| 美女爽到高潮91| 午夜精品一区二区三区电影天堂 | 轻轻草成人在线| 亚洲福利一区二区| 亚洲欧美激情视频在线观看一区二区三区 | 免费视频最近日韩| 午夜精品福利久久久| 亚洲视频精选在线| 国产精品国产自产拍高清av王其| 日韩片之四级片| 3751色影院一区二区三区| 欧美日韩一区二区三区免费看| 色欧美日韩亚洲| 91在线国内视频| 91免费版在线| 国产成人av自拍| 国产美女在线精品| 九九九精品视频| 国产麻豆一精品一av一免费 | 欧美色视频一区| 色综合久久88色综合天天6|