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

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

?? set_pinout.c

?? 基于TI公司Cortex-M3的uart超級通信開發
?? C
?? 第 1 頁 / 共 4 頁
字號:
//*****************************************************************************
//
// set_pinout.c - Functions related to configuration of the device pinout.
//
// Copyright (c) 2009 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.
// 
//
//*****************************************************************************

#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "inc/hw_gpio.h"
#include "driverlib/sysctl.h"
#include "driverlib/i2c.h"
#include "driverlib/gpio.h"
#include "driverlib/epi.h"
#include "driverlib/debug.h"
#include "set_pinout.h"

//*****************************************************************************
//
//! \addtogroup set_pinout_api
//! @{
//
//*****************************************************************************

//*****************************************************************************
//
// NOTE: This module can be built in two ways.  If the label SIMPLE_PINOUT_SET
// is not defined, the PinoutSet() function will attempt to read an I2C EEPROM
// to determine which daughter board is attached to the development kit board
// and use information from that EEPROM to dynamically configure the EPI
// appropriately.  In this case, if no EEPROM is found, the EPI configuration
// will default to that required to use the SDRAM daughter board which is
// included with the base development kit.
//
// If SIMPLE_PINOUT_SET is defined, however, all the dynamic configuration code
// is replaced with a very simple function which merely sets the pinout and EPI
// configuration statically.  This is a better representation of how a real-
// world application would likely initialize the pinout and EPI timing and
// takes significantly less code space than the dynamic, daughter-board
// detecting version.  The example offered here sets the pinout and EPI
// configuration appropriately for the Flash/SRAM/LCD daughter board.
//
//*****************************************************************************

//*****************************************************************************
//
// A global variable indicating which daughter board, if any, is currently
// connected to the lm3s9b96 development board.
//
//*****************************************************************************
tDaughterBoard g_eDaughterType;

#ifndef SIMPLE_PINOUT_SET
//*****************************************************************************
//
// The maximum number of GPIO ports.
//
//*****************************************************************************
#define NUM_GPIO_PORTS  9

//*****************************************************************************
//
// Base addresses of the GPIO ports that may contain EPI signals.  The index
// into this array must correlate with the index in the ucPortIndex field of
// tEPIPinInfo.
//
//*****************************************************************************
const unsigned long g_pulGPIOBase[NUM_GPIO_PORTS] =
{
    GPIO_PORTA_BASE,
    GPIO_PORTB_BASE,
    GPIO_PORTC_BASE,
    GPIO_PORTD_BASE,
    GPIO_PORTE_BASE,
    GPIO_PORTF_BASE,
    GPIO_PORTG_BASE,
    GPIO_PORTH_BASE,
    GPIO_PORTJ_BASE
};

//*****************************************************************************
//
// Structure used to map an EPI signal to a GPIO port and pin on the target
// part (lm3s9b96 in this case).  Field ucPortIndex is the index into the
// g_pulGPIOBase array containing the base address of the port.
//
//*****************************************************************************
typedef struct
{
    unsigned char ucPortIndex;
    unsigned char ucPctl;
    unsigned char ucPin;
}
tEPIPinInfo;

//*****************************************************************************
//
// The maximum number of EPI interface signals (EPI0Sxx).
//
//*****************************************************************************
#define NUM_EPI_SIGNALS 32

//*****************************************************************************
//
// The number of EPI clock periods for a write access with no wait states.
//
//*****************************************************************************
#define EPI_WRITE_CYCLES 4

//*****************************************************************************
//
// The number of EPI clock periods for a read access with no wait states.
//
//*****************************************************************************
#define EPI_READ_CYCLES  4

//*****************************************************************************
//
// The number of EPI clock periods added for each wait state.
//
//*****************************************************************************
#define EPI_WS_CYCLES    2

//*****************************************************************************
//
// This array holds the information necessary to map an EPI signal to a
// particular GPIO port and pin on the target part (lm3s9b96 in this case) and
// also the port control nibble required to enable that EPI signal.  The index
// into the array is the EPI signal number.
//
//*****************************************************************************
static const tEPIPinInfo g_psEPIPinInfo[NUM_EPI_SIGNALS] =
{
    {7, 8, 3},       // EPI0S00 on PH3
    {7, 8, 2},       // EPI0S01 on PH2
    {2, 8, 4},       // EPI0S02 on PC4
    {2, 8, 5},       // EPI0S03 on PC5
    {2, 8, 6},       // EPI0S04 on PC6
    {2, 8, 7},       // EPI0S05 on PC7
    {7, 8, 0},       // EPI0S06 on PH0
    {7, 8, 1},       // EPI0S07 on PH1
    {4, 8, 0},       // EPI0S08 on PE0
    {4, 8, 1},       // EPI0S09 on PE1
    {7, 8, 4},       // EPI0S10 on PH4
    {7, 8, 5},       // EPI0S11 on PH5
    {5, 8, 4},       // EPI0S12 on PF4
    {6, 8, 0},       // EPI0S13 on PG0
    {6, 8, 1},       // EPI0S14 on PG1
    {5, 8, 5},       // EPI0S15 on PF5
    {8, 8, 0},       // EPI0S16 on PJ0
    {8, 8, 1},       // EPI0S17 on PJ1
    {8, 8, 2},       // EPI0S18 on PJ2
    {8, 8, 3},       // EPI0S19 on PJ3
    {3, 8, 2},       // EPI0S20 on PD2
    {3, 8, 3},       // EPI0S21 on PD3
    {1, 8, 5},       // EPI0S22 on PB5
    {1, 8, 4},       // EPI0S23 on PB4
    {4, 8, 2},       // EPI0S24 on PE2
    {4, 8, 3},       // EPI0S25 on PE3
    {7, 8, 6},       // EPI0S26 on PH6
    {7, 8, 7},       // EPI0S27 on PH7
    {8, 8, 4},       // EPI0S28 on PJ4
    {8, 8, 5},       // EPI0S29 on PJ5
    {8, 8, 6},       // EPI0S30 on PJ6
    {6, 9, 7}        // EPI0S31 on PG7
};

//*****************************************************************************
//
// Bit mask defining the EPI signals (EPI0Snn, for 0 <= n < 32) required for
// the default configuration (in this case, we assume the SDRAM daughter board
// is present).
//
//*****************************************************************************
#define EPI_PINS_SDRAM 0xF00FFFFF

//*****************************************************************************
//
// I2C connections for the EEPROM device used on DK daughter boards to provide
// an ID to applications.
//
//*****************************************************************************
#define ID_I2C_PERIPH              (SYSCTL_PERIPH_I2C0)
#define ID_I2C_MASTER_BASE         (I2C0_MASTER_BASE)
#define ID_I2CSCL_GPIO_PERIPH      (SYSCTL_PERIPH_GPIOB)
#define ID_I2CSCL_GPIO_PORT        (GPIO_PORTB_BASE)
#define ID_I2CSCL_PIN              (GPIO_PIN_2)

#define ID_I2CSDA_GPIO_PERIPH      (SYSCTL_PERIPH_GPIOB)
#define ID_I2CSDA_GPIO_PORT        (GPIO_PORTB_BASE)
#define ID_I2CSDA_PIN              (GPIO_PIN_3)

#define ID_I2C_ADDR                0x50

//*****************************************************************************
//
// Reads from the I2C-attached EEPROM device.
//
// \param pucData points to storage for the data read from the EEPROM.
// \param ulOffset is the EEPROM address of the first byte to read.
// \param ulCount is the number of bytes of data to read from the EEPROM.
//
// This function reads one or more bytes of data from a given address in the
// ID EEPROM found on several of the lm3s9b96 development kit daughter boards.
// The return code indicates whether the read was successful.
//
// \return Returns \b true on success of \b false on failure.
//
//*****************************************************************************
static tBoolean
EEPROMReadPolled(unsigned char *pucData, unsigned long ulOffset,
                 unsigned long ulCount)
{
    unsigned long ulToRead;

    //
    // Clear any previously signalled interrupts.
    //
    I2CMasterIntClear(ID_I2C_MASTER_BASE);

    //
    // Start with a dummy write to get the address set in the EEPROM.
    //
    I2CMasterSlaveAddrSet(ID_I2C_MASTER_BASE, ID_I2C_ADDR, false);

    //
    // Place the address to be written in the data register.
    //
    I2CMasterDataPut(ID_I2C_MASTER_BASE, ulOffset);

    //
    // Perform a single send, writing the address as the only byte.
    //
    I2CMasterControl(ID_I2C_MASTER_BASE, I2C_MASTER_CMD_BURST_SEND_START);

    //
    // Wait until the current byte has been transferred.
    //
    while(I2CMasterIntStatus(ID_I2C_MASTER_BASE, false) == 0)
    {
    }

    if(I2CMasterErr(ID_I2C_MASTER_BASE) != I2C_MASTER_ERR_NONE)
    {
        I2CMasterIntClear(ID_I2C_MASTER_BASE);
        return(false);
    }

    //
    // Clear any interrupts set.
    //
    I2CMasterIntClear(ID_I2C_MASTER_BASE);

    //
    // Put the I2C master into receive mode.
    //
    I2CMasterSlaveAddrSet(ID_I2C_MASTER_BASE, ID_I2C_ADDR, true);

    //
    // Start the receive.
    //
    I2CMasterControl(ID_I2C_MASTER_BASE,
                     ((ulCount > 1) ? I2C_MASTER_CMD_BURST_RECEIVE_START :
                     I2C_MASTER_CMD_SINGLE_RECEIVE));

    //
    // Receive the required number of bytes.
    //
    ulToRead = ulCount;

    while(ulToRead)
    {
        //
        // Wait until the current byte has been read.
        //
        //while(I2CMasterIntStatus(ID_I2C_MASTER_BASE, false) == 0)
        //{
        //}

        //
        // Read the received character.
        //
        *pucData++ = I2CMasterDataGet(ID_I2C_MASTER_BASE);
        ulToRead--;

        //
        // Clear pending interrupt notifications.
        //
        I2CMasterIntClear(ID_I2C_MASTER_BASE);

        //
        // Set up for the next byte if any more remain.
        //
        if(ulToRead)
        {
            I2CMasterControl(ID_I2C_MASTER_BASE,
                             ((ulToRead == 1) ?
                              I2C_MASTER_CMD_BURST_RECEIVE_FINISH :
                              I2C_MASTER_CMD_BURST_RECEIVE_CONT));
        }
    }

    //
    // Clear pending interrupt notification.
    //
    I2CMasterIntClear(ID_I2C_MASTER_BASE);

    //
    // Tell the caller we read the required data.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品欧美黑人一区二区三区| 日韩一区二区三区在线| 国产美女在线观看一区| 蜜臀av性久久久久蜜臀av麻豆 | 亚瑟在线精品视频| 亚洲国产乱码最新视频| 亚洲国产精品久久久久婷婷884 | 久久国产人妖系列| 国产一区二区三区蝌蚪| 国产成人在线视频网站| aa级大片欧美| 欧美视频在线一区二区三区 | 亚洲国产综合在线| 午夜视频久久久久久| 免费一区二区视频| 岛国精品在线播放| 欧美性三三影院| 欧美一级夜夜爽| 久久精品日产第一区二区三区高清版 | 欧美精品 国产精品| 欧美挠脚心视频网站| 99re热这里只有精品免费视频| 国产东北露脸精品视频| 99久久久精品| 欧美亚洲动漫另类| 久久欧美中文字幕| 亚洲精品国产成人久久av盗摄| 丝袜亚洲另类丝袜在线| 国产高清无密码一区二区三区| jlzzjlzz欧美大全| 91精品国产色综合久久ai换脸| 精品国产青草久久久久福利| 国产视频一区在线播放| 亚洲另类中文字| 国产精品一区二区你懂的| 在线观看日韩国产| 久久久久国产精品麻豆ai换脸| 国产精品免费人成网站| 日韩高清在线不卡| 99国产精品一区| 日韩视频国产视频| 亚洲天堂中文字幕| 精品一区二区三区在线观看国产| 91同城在线观看| 久久综合丝袜日本网| 亚洲www啪成人一区二区麻豆| 国产电影精品久久禁18| 欧美一区二区三区免费在线看| 国产精品萝li| 国产精品18久久久久久久久久久久 | 欧美日韩国产一级片| 国产精品视频一二三区| 奇米一区二区三区| 99久久精品国产毛片| 久久婷婷色综合| 日本欧美一区二区| 欧美三级视频在线| 中文字幕佐山爱一区二区免费| 国产一区二区三区香蕉 | 国产精品123区| 91精品国产综合久久精品app| 亚洲免费av网站| av在线播放不卡| 欧美激情资源网| 丁香激情综合五月| 国产精品视频一区二区三区不卡| 激情文学综合丁香| 日韩久久精品一区| 日av在线不卡| 欧美一区二区三区四区久久| 一级做a爱片久久| 欧美亚洲高清一区二区三区不卡| 亚洲欧美日韩中文播放| 99久久精品免费看| 国产精品成人一区二区三区夜夜夜| 成人免费视频app| 一区视频在线播放| 99热99精品| 亚洲精品视频免费观看| 一本久久精品一区二区| 亚洲一区二区三区中文字幕在线| 色噜噜夜夜夜综合网| 亚洲国产精品一区二区www在线| 欧美三级电影在线看| 婷婷亚洲久悠悠色悠在线播放| 91精品蜜臀在线一区尤物| 久久机这里只有精品| 久久久久国产精品厨房| 成人高清视频在线观看| 亚洲男人的天堂网| 制服丝袜亚洲网站| 国产在线播放一区二区三区| 成人免费在线视频| 欧美日韩精品专区| 国产美女视频91| 亚洲视频在线观看一区| 欧美三级视频在线| 黄一区二区三区| 国产精品初高中害羞小美女文| 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 秋霞电影网一区二区| 日韩视频免费观看高清完整版在线观看 | 北条麻妃一区二区三区| 一区二区三区四区在线播放| 日本久久电影网| 久久超碰97人人做人人爱| 欧美国产精品中文字幕| 在线观看日韩av先锋影音电影院| 美女免费视频一区二区| 亚洲丝袜自拍清纯另类| 日韩欧美一二三区| 色婷婷精品久久二区二区蜜臂av| 日本视频在线一区| 亚洲精品欧美综合四区| 久久先锋影音av鲁色资源| 91久久线看在观草草青青| 九九九久久久精品| 午夜精品一区二区三区三上悠亚| 国产亚洲欧美日韩俺去了| 欧美日韩一区精品| 成人精品国产一区二区4080| 日本va欧美va精品| 一区二区三区在线不卡| 亚洲国产高清aⅴ视频| 日韩欧美三级在线| 欧美日韩视频专区在线播放| 成人ar影院免费观看视频| 激情综合网av| 秋霞午夜av一区二区三区| 亚洲自拍偷拍九九九| 1区2区3区国产精品| 久久久精品免费免费| 精品日韩欧美一区二区| 在线电影欧美成精品| 欧洲精品中文字幕| 一本一道久久a久久精品 | 中文字幕中文乱码欧美一区二区| 日韩免费福利电影在线观看| 欧美在线三级电影| 色综合久久中文综合久久97| 成人av在线影院| 国产91精品一区二区麻豆亚洲| 狠狠v欧美v日韩v亚洲ⅴ| 激情综合色播激情啊| 蜜桃久久精品一区二区| 日本aⅴ精品一区二区三区| 日韩一区精品字幕| 美女精品自拍一二三四| 美女视频网站久久| 激情五月婷婷综合| 国产一区二区三区四区五区入口| 国内精品视频666| 国产精品一区二区免费不卡| 国产精选一区二区三区 | 日韩理论片在线| 亚洲欧美aⅴ...| 亚洲妇熟xx妇色黄| 天天免费综合色| 蜜桃av噜噜一区| 国内久久精品视频| 成人免费视频免费观看| 91麻豆免费看| 69堂国产成人免费视频| 日韩午夜在线影院| 亚洲精品一区二区精华| 久久久久久久久久久久久夜| 欧美激情综合网| 亚洲一卡二卡三卡四卡无卡久久| 自拍偷拍欧美精品| 午夜精品久久久久久久久久| 捆绑紧缚一区二区三区视频 | 亚洲欧美精品午睡沙发| 亚洲综合成人网| 极品少妇一区二区三区精品视频| 国产成人午夜视频| 色综合久久中文字幕综合网 | 色香色香欲天天天影视综合网| 91黄色免费版| 精品欧美一区二区三区精品久久| 国产精品久久久久婷婷二区次| 亚洲女同ⅹxx女同tv| 看片的网站亚洲| 本田岬高潮一区二区三区| 欧美美女一区二区| 久久久99久久| 亚洲国产成人av| 国产成人日日夜夜| 欧美老女人第四色| 中文字幕的久久| 日韩不卡一区二区| 91在线观看视频| 久久欧美一区二区| 天天色天天操综合| 91丨九色丨国产丨porny| 精品精品国产高清a毛片牛牛 | 亚洲欧美视频一区| 老司机精品视频导航| 欧美网站大全在线观看| 国产欧美日本一区视频| 日本欧美一区二区三区乱码|