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

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

?? qs_dk-lm3s811.c

?? Stellaris公司推出1美元ARM,這是Stellaris驅動庫源程序
?? C
?? 第 1 頁 / 共 2 頁
字號:
//*****************************************************************************
//
// qs_dk-lm3s811.c - A quick start sample application to demo chip features
//
// 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_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   0
#define GPIO_PIN_MUTE   GPIO_PIN_5

//*****************************************************************************
//
//! \addtogroup dk_lm3sxxx_list
//! <h1>DK-LM3S811 Quickstart Application (qs_dk-lm3s811)</h1>
//!
//! This example uses the potentiometer on the development board to vary the
//! rate of a repetitive beep from the piezo buzzer, while the light sensor
//! will vary the frequency of the beep.  Turning the knob in one direction
//! will result in slower beeps while turning it in the other direction will
//! result in faster beeps.  The amount of light falling on the light sensor
//! affects the frequency of the beep.  The more light falling on the sensor
//! the higher the pitch of the beep.  The potentiometer setting along with the
//! "note" representing the pitch of the beep 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 provide the settings.
//!
//! In the default jumper configuration of the development board, the push
//! button will not actually mute the beep.  In order for this example to fully
//! work, the following jumper wire connections must be made: JP19 pin 2 to
//! J6 pin 6.
//
//*****************************************************************************

//*****************************************************************************
//
// 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 = '-';

//*****************************************************************************
//
// Storage space for ADC results.
//
//*****************************************************************************
static unsigned long g_ulADCResults[8];

//*****************************************************************************
//
// 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.  Get the ADC value
    // from the previous acquisition cycle and start up the next acquisition.
    //
    ADCSequenceDataGet(ADC_BASE, 0, &g_ulADCResults[0]);
    ADCProcessorTrigger(ADC_BASE, 0);

    //
    // Look up the tone frequency, based on 1 of 16 levels.
    //
    g_ulToneFreq = g_ulFreqMap[g_ulADCResults[0] >> 6];
    g_chNote = g_chNoteMap[g_ulADCResults[0] >> 6];

    //
    // 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.
            //

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美国产三级| 三级欧美在线一区| 性做久久久久久免费观看 | **欧美大码日韩| 性做久久久久久久免费看| 精品一区二区三区日韩| 91官网在线观看| 久久久久久久av麻豆果冻| 婷婷丁香激情综合| 欧美在线视频全部完| 国产无一区二区| 激情伊人五月天久久综合| 欧美影院精品一区| 亚洲美女偷拍久久| 99精品视频一区二区| 国产日韩欧美电影| 伦理电影国产精品| 日韩一区二区三区观看| 亚洲高清免费视频| 欧美日韩一区中文字幕| 亚洲另类春色校园小说| av午夜一区麻豆| 国产视频视频一区| 国产精品一二三在| 国产欧美日韩另类视频免费观看| 麻豆成人久久精品二区三区小说| 欧美色网一区二区| 亚洲日本va午夜在线影院| 成人国产在线观看| 国产精品美女久久久久久久久久久| 韩国女主播成人在线观看| 4438x成人网最大色成网站| 一区二区三区高清在线| www.亚洲人| 亚洲视频在线观看一区| 91蜜桃传媒精品久久久一区二区| 国产精品福利一区二区| 成人性视频免费网站| 国产精品高潮呻吟| 色噜噜夜夜夜综合网| 亚洲成av人片在www色猫咪| 欧美视频一区二区在线观看| 午夜精品aaa| 日韩午夜激情电影| 国产麻豆9l精品三级站| 中文字幕欧美国产| 99国产精品久久久| 亚洲成av人在线观看| 精品少妇一区二区三区在线视频 | 欧美日韩国产综合一区二区 | 国产精品系列在线观看| 国产精品久久久久久久久免费相片 | 国产亚洲综合在线| av在线播放不卡| 亚洲电影视频在线| 欧美成人一区二区三区| 国产高清不卡二三区| 亚洲少妇屁股交4| 欧美日韩国产另类不卡| 国产一区二三区| 日韩毛片精品高清免费| 欧美日韩国产大片| 国产成人精品影视| 亚洲18色成人| 国产亚洲欧美激情| 欧美在线观看18| 久久国产综合精品| 一区二区三国产精华液| 精品捆绑美女sm三区| 色综合色狠狠天天综合色| 日本不卡高清视频| 亚洲精品亚洲人成人网在线播放| 欧美电影免费观看高清完整版在线观看 | 美女一区二区三区| 国产精品久久久久久久久图文区 | 国产精品美女久久久久久2018| 欧美三级乱人伦电影| 国产麻豆精品theporn| 亚洲国产精品麻豆| 国产精品美女久久久久久| 制服.丝袜.亚洲.另类.中文| 国产不卡免费视频| 另类欧美日韩国产在线| 亚洲欧美日韩小说| 国产欧美一区二区三区网站| 欧美一区二区三区视频在线| av亚洲精华国产精华| 久久se精品一区精品二区| 国产精品免费久久| 欧美一级黄色大片| 欧美三级中文字| 日本电影欧美片| 国产成人在线视频播放| 奇米色777欧美一区二区| 亚洲欧美日韩在线| 中文字幕一区二区三区四区 | 制服.丝袜.亚洲.另类.中文| 91浏览器在线视频| 成人午夜av影视| 国产一区二区三区av电影| 日本欧美一区二区三区乱码| 亚洲午夜一二三区视频| 亚洲免费观看高清| 亚洲天堂中文字幕| 中文字幕亚洲不卡| 国产精品久久久久久久久久免费看 | 自拍偷拍国产精品| 中文字幕精品一区二区精品绿巨人| 欧美变态口味重另类| 91精品国产综合久久精品麻豆| 欧洲国内综合视频| 91成人免费在线视频| 色婷婷综合在线| 欧美性猛片aaaaaaa做受| 91福利视频网站| 欧美探花视频资源| 777a∨成人精品桃花网| 日韩一级免费一区| 精品国产露脸精彩对白| 亚洲精品在线免费观看视频| www一区二区| 国产清纯美女被跳蛋高潮一区二区久久w | 国产福利一区二区三区在线视频| 国产精品影视网| 成人美女在线观看| 91麻豆swag| 欧美日韩国产成人在线免费| 欧美高清视频在线高清观看mv色露露十八 | 久久精品夜色噜噜亚洲a∨| 国产午夜亚洲精品理论片色戒| 色偷偷久久人人79超碰人人澡 | 欧美激情一区二区在线| 久久久精品国产免大香伊 | 国产精品888| 成人app软件下载大全免费| 91丝袜呻吟高潮美腿白嫩在线观看| 色av综合在线| 欧美肥大bbwbbw高潮| 精品久久国产字幕高潮| 国产欧美一区二区精品久导航| 亚洲国产精品激情在线观看| 亚洲综合视频在线| 奇米综合一区二区三区精品视频| 久久99精品国产麻豆婷婷| 成人美女视频在线看| 欧美四级电影在线观看| 精品国产乱码久久久久久蜜臀| 亚洲国产精品黑人久久久| 亚洲国产成人精品视频| 韩国精品久久久| 在线观看日韩精品| 精品蜜桃在线看| 亚洲夂夂婷婷色拍ww47| 韩国一区二区在线观看| 色婷婷av一区二区三区之一色屋| 91麻豆精品久久久久蜜臀| 国产精品嫩草久久久久| 日本成人在线看| 91免费国产在线| 精品久久一区二区三区| 一区二区日韩av| 国产成人av电影免费在线观看| 欧美日韩国产在线观看| 国产精品人妖ts系列视频| 美女一区二区三区在线观看| 91看片淫黄大片一级| 久久免费看少妇高潮| 婷婷夜色潮精品综合在线| 99久久er热在这里只有精品15 | 国产一区免费电影| 欧美日韩久久不卡| 亚洲同性同志一二三专区| 韩国成人在线视频| 欧美一区二区三区四区在线观看| 亚洲欧美日韩中文字幕一区二区三区 | 中文字幕字幕中文在线中不卡视频| 日本美女一区二区三区视频| 色噜噜久久综合| 国产精品免费视频一区| 国产夫妻精品视频| 欧美大片日本大片免费观看| 亚洲成av人片观看| 色综合久久中文综合久久97| 中文字幕精品在线不卡| 国产精品1区2区| 国产午夜亚洲精品理论片色戒 | 免费成人av在线| 欧美日韩国产综合一区二区三区| 成人欧美一区二区三区在线播放| 国产精品18久久久久久vr| 欧美精品一区二区在线播放 | 国产a久久麻豆| 久久网站最新地址| 狠狠网亚洲精品| 精品国产百合女同互慰| 国产综合色在线| 国产免费观看久久| 成人午夜在线视频| 亚洲丝袜精品丝袜在线| 日本精品裸体写真集在线观看|