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

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

?? set_pinout.c

?? 基于TI公司Cortex-M3的uart超級通信開發(fā)
?? 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.

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧洲国内综合视频| 99久久精品一区二区| 精品国产凹凸成av人网站| 免费黄网站欧美| 久久色在线视频| 成人成人成人在线视频| 伊人夜夜躁av伊人久久| 69成人精品免费视频| 精品午夜久久福利影院| 欧美国产一区在线| 欧美网站一区二区| 久久91精品久久久久久秒播| 国产亚洲女人久久久久毛片| 99久久精品情趣| 三级在线观看一区二区| 久久久精品国产99久久精品芒果| 波波电影院一区二区三区| 亚洲国产毛片aaaaa无费看| 日韩欧美国产麻豆| 99精品视频在线免费观看| 天堂在线一区二区| 国产精品美女久久久久久2018 | 在线观看欧美黄色| 麻豆视频观看网址久久| 亚洲国产高清不卡| 欧美日韩www| 成人午夜短视频| 日产精品久久久久久久性色| 国产精品入口麻豆九色| 欧美高清视频一二三区| 国产成人av电影在线| 五月婷婷久久综合| 中文字幕二三区不卡| 91精品国产麻豆国产自产在线| 国产99久久久国产精品潘金网站| 亚洲午夜在线观看视频在线| 国产女人水真多18毛片18精品视频| 欧美在线你懂的| 成人三级伦理片| 精品一区二区三区欧美| 亚洲国产成人高清精品| 国产人久久人人人人爽| 日韩美女一区二区三区| 欧美体内she精视频| 99国产一区二区三精品乱码| 久久国产婷婷国产香蕉| 婷婷中文字幕一区三区| 成人欧美一区二区三区1314| 久久综合久久99| 制服丝袜亚洲播放| 欧美日韩中文字幕一区| 91看片淫黄大片一级| 国产大陆精品国产| 久久99精品国产91久久来源| 午夜视频在线观看一区二区| 亚洲最大色网站| 亚洲精品国产第一综合99久久 | 91久久精品一区二区三区| 成人三级伦理片| 国产不卡一区视频| 国产一区二区中文字幕| 美女视频一区二区| 日本不卡一区二区三区高清视频| 亚洲电影第三页| 亚洲风情在线资源站| 亚洲一区二区三区在线播放| 亚洲欧美国产77777| 国产精品成人免费| 中文字幕一区三区| 日韩一区在线播放| 亚洲欧美激情小说另类| 亚洲摸摸操操av| 亚洲激情图片小说视频| 亚洲精品视频在线观看网站| 亚洲另类在线视频| 一区二区三区毛片| 亚洲国产美国国产综合一区二区| 亚洲最大色网站| 亚洲成人动漫一区| 肉肉av福利一精品导航| 日韩和的一区二区| 免费视频一区二区| 精品影视av免费| 国产成人免费在线观看| 94色蜜桃网一区二区三区| av在线不卡观看免费观看| 99久久综合99久久综合网站| 色偷偷88欧美精品久久久| 欧美三级电影一区| 欧美电影免费观看高清完整版在线| 精品国产乱码久久久久久久久 | 91免费国产在线| 在线看不卡av| 555www色欧美视频| 精品国产乱码久久久久久闺蜜| 久久综合色婷婷| 国产精品国产三级国产| 亚洲一二三区在线观看| 青青草91视频| 国产乱码精品一区二区三区忘忧草| 福利一区福利二区| 在线免费不卡视频| 欧美精品一区二区不卡| 国产精品成人免费精品自在线观看 | 国产精品久久久久久久久图文区 | 久久一日本道色综合| 国产精品福利av| 午夜影院久久久| 国产自产高清不卡| 色综合久久久久综合体桃花网| 欧美日韩视频专区在线播放| 精品国产免费人成电影在线观看四季 | 中文字幕制服丝袜一区二区三区| 亚洲国产精品影院| 国产精品亚洲第一区在线暖暖韩国| 99re66热这里只有精品3直播| 717成人午夜免费福利电影| 久久久美女艺术照精彩视频福利播放| 综合久久久久综合| 精品在线一区二区三区| 91年精品国产| 久久精品综合网| 丝瓜av网站精品一区二区 | 亚洲精品久久嫩草网站秘色| 免费人成在线不卡| 色婷婷国产精品| 国产欧美一区二区三区鸳鸯浴 | 国产日韩v精品一区二区| 夜夜揉揉日日人人青青一国产精品| 国模无码大尺度一区二区三区| 欧美色综合天天久久综合精品| 国产亚洲精品bt天堂精选| 日本在线观看不卡视频| 91久久精品一区二区| 欧美国产精品久久| 精品在线播放免费| 欧美精品久久99久久在免费线| 亚洲精品乱码久久久久| 成人动漫中文字幕| 国产亚洲欧美日韩俺去了| 久久99蜜桃精品| 欧美精品色综合| 亚洲一区二区三区爽爽爽爽爽| 99精品一区二区| 中文字幕精品综合| 国产做a爰片久久毛片| 欧美一级生活片| 天使萌一区二区三区免费观看| 91麻豆swag| 亚洲欧美偷拍卡通变态| 成人av在线资源网站| 国产欧美精品国产国产专区 | 一本色道久久综合亚洲精品按摩 | 国产精品乱子久久久久| 国产福利视频一区二区三区| 精品动漫一区二区三区在线观看| 丝袜美腿一区二区三区| 制服丝袜成人动漫| 日本欧美韩国一区三区| 91精品欧美久久久久久动漫 | 国内精品久久久久影院一蜜桃| 欧美一级专区免费大片| 男人的天堂久久精品| 日韩一区二区三区四区| 另类的小说在线视频另类成人小视频在线 | 久久久国产综合精品女国产盗摄| 久久99国产精品免费| 久久综合一区二区| 国产乱码字幕精品高清av| 国产三区在线成人av| 国产成人亚洲精品狼色在线| 欧美激情一区二区三区全黄| 成人av资源网站| 亚洲视频一二三区| 精品视频一区 二区 三区| 日韩电影免费一区| 久久嫩草精品久久久精品| 成人中文字幕在线| 亚洲免费在线看| 欧美精品日韩一本| 国产一区二区日韩精品| 国产蜜臀97一区二区三区| 94色蜜桃网一区二区三区| 亚洲在线中文字幕| 9191成人精品久久| 国产精品伊人色| 国产精品久久久久久久久免费相片| 91亚洲男人天堂| 亚洲123区在线观看| 精品国产乱码久久久久久夜甘婷婷 | 色哟哟一区二区三区| 日产欧产美韩系列久久99| 国产清纯在线一区二区www| 91在线一区二区三区| 午夜精品一区二区三区免费视频| 日韩免费看的电影| 91论坛在线播放| 久草在线在线精品观看| 亚洲人成人一区二区在线观看| 欧美猛男男办公室激情|