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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? ser_mcf5272_uart.c

?? 開(kāi)放源碼實(shí)時(shí)操作系統(tǒng)源碼.
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
//==========================================================================
//
//      devs/serial/MCF52xx/MCF5282
//
//      MCF5272 UART Serial I/O Interface Module (interrupt driven)
//
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//==========================================================================

#include <cyg/io/io.h>
#include <cyg/io/devtab.h>
#include <cyg/io/serial.h>
#include <cyg/infra/diag.h>
#include <cyg/hal/hal_intr.h>
#include <cyg/hal/hal_memmap.h>
#include <cyg/infra/cyg_type.h>
#include <cyg/hal/hal_arch.h>
#include <cyg/hal/drv_api.h>
#include <pkgconf/hal.h>
#include <pkgconf/system.h>
#include <pkgconf/io_serial.h>
#include <pkgconf/io.h>
#include <pkgconf/io_serial_mcf5272_uart.h>
#include <cyg/io/ser_mcf5272_uart.h>


/* The UART priority level */
#define MCF5272_UART_PRIORITY_LEVEL 2


/* Autobaud states */
typedef enum autobaud_states_t
{
    AB_IDLE = 0,  /* Normal state. Autobaud process hasn't been initiated yet. */
    AB_BEGIN_BREAK, /* Detected a start of the break */
    AB_BEGIN,       /* Detected the end of the break and has set up the autobaud.*/

}autobaud_states_t;

#define FIELD_OFFSET(type,field) (cyg_uint32)(&(((type*)0)->field))

typedef struct MCF5272_uart_info_t
{

    volatile mcf5272_sim_uart_t*    base;                       // Base address of the UART registers
    uint32                          uart_vector;                // UART interrupt vector number

    cyg_interrupt                   serial_interrupt;           // Interrupt context
    cyg_handle_t                    serial_interrupt_handle;    // Interrupt handle

    volatile uint8                  imr_mirror;                 // Interrupt mask register mirror

    cyg_serial_info_t               config;                     // The channel configuration

    autobaud_states_t               autobaud_state;             // The autobaud state


} MCF5272_uart_info_t;

/* Function prtoftyps for the MCF5272 UART ISR and DSR. */
static cyg_uint32 MCF5272_uart_ISR(cyg_vector_t vector, cyg_addrword_t data);
static void       MCF5272_uart_DSR(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data);


/* Function prototypes for the serial functions. */
static bool MCF5272_uart_init(struct cyg_devtab_entry * tab);
static Cyg_ErrNo MCF5272_uart_lookup(struct cyg_devtab_entry **tab,
                  struct cyg_devtab_entry *sub_tab,
                  const char *name);
static bool MCF5272_uart_putc(serial_channel *chan, unsigned char c);
static unsigned char MCF5272_uart_getc(serial_channel *chan);
Cyg_ErrNo MCF5272_uart_set_config(serial_channel *chan, cyg_uint32 key,
                            const void *xbuf, cyg_uint32 *len);
static void MCF5272_uart_start_xmit(serial_channel *chan);
static void MCF5272_uart_stop_xmit(serial_channel * chan);


/* Declare the serial functions that are called by the common serial driver layer. */
static SERIAL_FUNS
(
    MCF5272_uart_funs,
    MCF5272_uart_putc,
    MCF5272_uart_getc,
    MCF5272_uart_set_config,
    MCF5272_uart_start_xmit,
    MCF5272_uart_stop_xmit
);


/* Definition for channel 0 UART configuration. */
/************************************************/
#ifdef CYGPKG_IO_SERIAL_MCF5272_UART_CHANNEL0

/* Data structure contains
   channel informtion.
 */
static MCF5272_uart_info_t MCF5272_uart_channel_info_0;

/* If the channel buffer size is zero, do not include interrupt UART processing */
#if CYGNUM_IO_SERIAL_MCF5272_UART_CHANNEL0_BUFSIZE > 0

/*      Allocated receive and transmit buffer.   The size of the buffer  is */
/* configured by the configtool.                                            */

static unsigned char MCF5272_uart_out_buf0[CYGNUM_IO_SERIAL_MCF5272_UART_CHANNEL0_BUFSIZE];
static unsigned char MCF5272_uart_in_buf0[CYGNUM_IO_SERIAL_MCF5272_UART_CHANNEL0_BUFSIZE];

/*      Channel function table.   We register  the UART  functions here  so */
/* that uppper serial drivers can call the serial driver's routines.        */

static SERIAL_CHANNEL_USING_INTERRUPTS(
    MCF5272_uart_channel_0,
    MCF5272_uart_funs,
    MCF5272_uart_channel_info_0,
    CYG_SERIAL_BAUD_RATE(CYGNUM_IO_SERIAL_MCF5272_UART_CHANNEL0_BAUD),
    CYG_SERIAL_STOP_DEFAULT,
    CYG_SERIAL_PARITY_DEFAULT,
    CYG_SERIAL_WORD_LENGTH_DEFAULT,
    CYG_SERIAL_FLAGS_DEFAULT,
    MCF5272_uart_out_buf0, sizeof(MCF5272_uart_out_buf0),
    MCF5272_uart_in_buf0, sizeof(MCF5272_uart_in_buf0)
);
#else
/* Don't use interrupt processing for the UART. */
static SERIAL_CHANNEL(
    MCF5272_uart_channel_0,
    MCF5272_uart_funs,
    MCF5272_uart_channel_info_0,
    CYG_SERIAL_BAUD_RATE(CYGNUM_IO_SERIAL_MCF5272_UART_CHANNEL0_BAUD),
    CYG_SERIAL_STOP_DEFAULT,
    CYG_SERIAL_PARITY_DEFAULT,
    CYG_SERIAL_WORD_LENGTH_DEFAULT,
    CYG_SERIAL_FLAGS_DEFAULT
);
#endif

DEVTAB_ENTRY(
    MCF5272_uart_io0,
    CYGDAT_IO_SERIAL_MCF5272_UART_CHANNEL0_NAME,
    0,                       // Does not depend on a lower level interface
    &cyg_io_serial_devio,    // The table of I/O functions.
    MCF5272_uart_init,       // UART initialization function.
    MCF5272_uart_lookup,     // The UART lookup function. This function typically sets
                             // up the device for actual use, turing on interrupts, configuring the port, etc.
    &MCF5272_uart_channel_0
);
#endif //  CYGNUM_IO_SERIAL_MCF5272_UART_CHANNEL0

/* Definition for channel 1 UART configuration. */
/************************************************/

#ifdef CYGPKG_IO_SERIAL_MCF5272_UART_CHANNEL1


/* Data structure contains
   channel informtion.
 */
static MCF5272_uart_info_t MCF5272_uart_channel_info_1;

/* If the channel buffer size is zero, do not include interrupt UART processing */
#if CYGNUM_IO_SERIAL_MCF5272_UART_CHANNEL1_BUFSIZE > 0

/*      Allocated receive and transmit buffer.   The size of the buffer  is */
/* configured by the configtool.                                            */

static unsigned char MCF5272_uart_out_buf1[CYGNUM_IO_SERIAL_MCF5272_UART_CHANNEL1_BUFSIZE];
static unsigned char MCF5272_uart_in_buf1[CYGNUM_IO_SERIAL_MCF5272_UART_CHANNEL1_BUFSIZE];

/*      Channel function table.   We register  the UART  functions here  so */
/* that uppper serial drivers can call the serial driver's routines.        */

static SERIAL_CHANNEL_USING_INTERRUPTS(
    MCF5272_uart_channel_1,
    MCF5272_uart_funs,
    MCF5272_uart_channel_info_1,
    CYG_SERIAL_BAUD_RATE(CYGNUM_IO_SERIAL_MCF5272_UART_CHANNEL1_BAUD),
    CYG_SERIAL_STOP_DEFAULT,
    CYG_SERIAL_PARITY_DEFAULT,
    CYG_SERIAL_WORD_LENGTH_DEFAULT,
    CYG_SERIAL_FLAGS_DEFAULT,
    MCF5272_uart_out_buf1, sizeof(MCF5272_uart_out_buf1),
    MCF5272_uart_in_buf1, sizeof(MCF5272_uart_in_buf1)
);

#else
static SERIAL_CHANNEL(MCF5272_uart_channel_1,
                      MCF5272_uart_funs,
                      MCF5272_uart_channel_info_1,
                      CYG_SERIAL_BAUD_RATE(CYGNUM_IO_SERIAL_MCF5272_UART_CHANNEL0_BAUD),
                      CYG_SERIAL_STOP_DEFAULT,
                      CYG_SERIAL_PARITY_DEFAULT,
                      CYG_SERIAL_WORD_LENGTH_DEFAULT,
                      CYG_SERIAL_FLAGS_DEFAULT
    );
#endif
DEVTAB_ENTRY(
    MCF5272_uart_io1,
    CYGDAT_IO_SERIAL_MCF5272_UART_CHANNEL1_NAME,
    0,                     // Does not depend on a lower level interface
    &cyg_io_serial_devio,  // The table of I/O functions.
    MCF5272_uart_init,     // UART initialization function.
    MCF5272_uart_lookup,   // The UART lookup function. This function typically sets
                           // up the device for actual use, turing on interrupts, configuring the port, etc.
    &MCF5272_uart_channel_1
);
#endif //  CYGNUM_IO_SERIAL_MCF5272_UART_CHANNEL1



/* Definition of macros that access the UART's SIM registers */
/* Read from a register */

#define MCF5272_UART_WRITE(_addr_,_value_) \
   *((volatile CYG_BYTE*)&(_addr_)) = (CYG_BYTE)(_value_)
/* Write to a register */
#define MCF5272_UART_READ(_addr_) \
   *(volatile CYG_BYTE*)&(_addr_)


/* Function Prototypes */
/* =================== */
/* Internal function to actually configure the hardware to desired baud rate, etc. */
static bool MCF5272_uart_config_port(serial_channel*, cyg_serial_info_t*);
static void MCF5272_uart_start_xmit(serial_channel*);


/* Baudrate conversion table. */
static unsigned long baud_rates_table[]=
{
    0,
    50,     // CYGNUM_SERIAL_BAUD_50 = 1
    75,     // CYGNUM_SERIAL_BAUD_75
    110,    // CYGNUM_SERIAL_BAUD_110
    134,    // CYGNUM_SERIAL_BAUD_134_5
    150,    // CYGNUM_SERIAL_BAUD_150
    200,    // CYGNUM_SERIAL_BAUD_200
    300,    // CYGNUM_SERIAL_BAUD_300
    600,    // CYGNUM_SERIAL_BAUD_600
    1200,   // CYGNUM_SERIAL_BAUD_1200
    1800,   // CYGNUM_SERIAL_BAUD_1800
    2400,   // CYGNUM_SERIAL_BAUD_2400
    3600,   // CYGNUM_SERIAL_BAUD_3600
    4800,   // CYGNUM_SERIAL_BAUD_4800
    7200,   // CYGNUM_SERIAL_BAUD_7200
    9600,   // CYGNUM_SERIAL_BAUD_9600
    14400,  // CYGNUM_SERIAL_BAUD_14400
    19200,  // CYGNUM_SERIAL_BAUD_19200
    38400,  // CYGNUM_SERIAL_BAUD_38400
    57600,  // CYGNUM_SERIAL_BAUD_57600
    115200, // CYGNUM_SERIAL_BAUD_115200
    230400  // CYGNUM_SERIAL_BAUD_230400
};

/*      The table contains  divers  to  divide  the  clock  to  configre  a */
/* approppriate for the UART.                                               */

static unsigned long dividers_table[]=
{
    0,
    46080,   // 50
    30720,   // 75
    20945,   // 110
    17130,   // 134_5
    15360,   // 150
    11520,   // 200
    7680,    // 300
    3840,    // 600
    1920,    // 1200
    1280,    // 1800
    960,     // 2400
    640,     // 3600
    480,     // 4800
    320,     // 7200
    240,     // 9600
    160,     // 14400
    120,     // 19200
    60,      // 38400
    40,      // 57600
    20,      // 115200
    10       // 230400
};

/*******************************************************************************
 MCF5272_uart_init() - This routine is called during bootstrap to set up the

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线成人免费视频| 26uuuu精品一区二区| 波多野结衣在线aⅴ中文字幕不卡| 久久国产精品72免费观看| 婷婷国产v国产偷v亚洲高清| 亚洲成人久久影院| 亚洲午夜精品17c| 香蕉久久夜色精品国产使用方法| 亚洲妇熟xx妇色黄| 日本成人在线不卡视频| 天天综合网天天综合色| 日本少妇一区二区| 韩国女主播成人在线观看| 国产乱子轮精品视频| 国产精品一区二区视频| 成人免费福利片| 97aⅴ精品视频一二三区| 一本久久综合亚洲鲁鲁五月天| 91浏览器入口在线观看| 欧洲精品一区二区| 欧美人与性动xxxx| 日韩一区二区在线看片| 久久这里只有精品视频网| 国产香蕉久久精品综合网| 亚洲欧洲日产国码二区| 亚洲一区免费在线观看| 蜜臀va亚洲va欧美va天堂| 韩国毛片一区二区三区| 9久草视频在线视频精品| 欧美伊人久久久久久午夜久久久久| 欧美日韩色综合| 精品久久一二三区| 国产精品久久午夜夜伦鲁鲁| 亚洲黄色录像片| 久久成人麻豆午夜电影| 成人免费不卡视频| 欧美日本不卡视频| 国产日韩精品视频一区| 亚洲精品第1页| 青青草国产精品97视觉盛宴| 成人国产在线观看| 欧美日本精品一区二区三区| 国产亚洲成av人在线观看导航| 亚洲男人的天堂在线观看| 三级影片在线观看欧美日韩一区二区| 精品一区二区三区香蕉蜜桃 | 精品视频一区二区不卡| 91精品国产品国语在线不卡| 国产亚洲综合色| 亚洲精品第一国产综合野| 九九九久久久精品| 一本色道久久综合精品竹菊| 欧美xxxxx裸体时装秀| 亚洲欧美色一区| 激情久久五月天| 欧美私模裸体表演在线观看| 久久久久99精品国产片| 亚洲二区在线观看| 成人av资源下载| 日韩三级视频中文字幕| 亚洲欧美日韩在线| 国产一区二区调教| 91.com视频| 亚洲精选在线视频| 国产精品香蕉一区二区三区| 欧美福利一区二区| 亚洲人亚洲人成电影网站色| 久久精品国产成人一区二区三区| 91蝌蚪porny成人天涯| 久久久亚洲精品一区二区三区| 亚洲专区一二三| 99精品久久只有精品| 久久一夜天堂av一区二区三区| 亚洲成av人片在线观看| 99久久久国产精品| 国产三级欧美三级日产三级99 | 色婷婷精品大在线视频| 国产欧美一区二区在线| 精品一区免费av| 欧美一区二区网站| 一个色综合av| 91碰在线视频| 国产精品国产三级国产有无不卡| 精品一区二区三区av| 91精品国产91久久久久久最新毛片| 亚洲欧美另类在线| 成人免费高清在线观看| 国产日韩欧美综合一区| 激情综合网av| 欧美成人免费网站| 看片网站欧美日韩| 欧美一级高清大全免费观看| 亚洲电影第三页| 欧美日韩午夜在线视频| 亚洲图片一区二区| 欧洲另类一二三四区| 一区二区三区在线播放| 91首页免费视频| 亚洲欧美一区二区三区极速播放| 粉嫩一区二区三区性色av| 久久精品日韩一区二区三区| 国产一区二区调教| 国产三级精品三级| 成人污视频在线观看| 国产精品美女久久久久久2018| 成人综合婷婷国产精品久久 | 久久99精品久久久| 精品国产乱码久久| 国内久久精品视频| 26uuu精品一区二区在线观看| 久久99精品国产.久久久久久| 亚洲精品一区二区三区精华液| 国产一区二区三区四| 国产欧美日韩精品一区| 不卡的av中国片| 亚洲人成亚洲人成在线观看图片 | 欧美色视频在线观看| 亚洲成人tv网| 日韩一区二区三区视频在线观看| 日韩成人伦理电影在线观看| 欧美大黄免费观看| 国产老妇另类xxxxx| 国产精品每日更新在线播放网址| jlzzjlzz亚洲女人18| 亚洲综合在线五月| 3d动漫精品啪啪一区二区竹菊| 精品一区二区在线观看| 国产精品欧美一区二区三区| 色诱视频网站一区| 日韩精品一区第一页| 久久天天做天天爱综合色| 成人综合在线观看| 一区二区三区国产豹纹内裤在线| 欧美一区二区私人影院日本| 国产精品99久久久久久似苏梦涵| 国产精品久久久久久久久图文区 | 成人av影院在线| 一区二区三区不卡视频 | 亚洲1区2区3区视频| 日韩一区二区精品葵司在线| 国产精品亚洲一区二区三区妖精 | 久久看人人爽人人| 一本久久a久久免费精品不卡| 亚洲电影视频在线| 久久精品人人做人人综合 | 国产精品麻豆99久久久久久| 欧美亚洲综合另类| 国内精品伊人久久久久av一坑| 国产精品麻豆一区二区 | 日韩黄色免费网站| 久久综合网色—综合色88| 91在线视频18| 麻豆国产精品777777在线| 中文字幕日本不卡| 91精品国产麻豆| 99亚偷拍自图区亚洲| 视频一区二区不卡| 亚洲视频在线一区观看| 91精品国产乱| 日本韩国欧美在线| 国产一区91精品张津瑜| 五月婷婷另类国产| 综合分类小说区另类春色亚洲小说欧美| 91精品国产综合久久久蜜臀粉嫩 | 五月婷婷综合在线| 国产精品久久三| 精品99999| 欧美日韩精品一区二区在线播放 | 日韩欧美国产小视频| 一本色道久久综合亚洲精品按摩| 国内精品在线播放| 一区二区三区日韩欧美精品 | 日欧美一区二区| 中文字幕亚洲区| 久久综合九色综合欧美98| 在线精品亚洲一区二区不卡| 国产精品18久久久| 久久精品国产亚洲5555| 五月天激情小说综合| 亚洲男人的天堂在线观看| 中国色在线观看另类| 精品sm捆绑视频| 91精品国产欧美一区二区| 欧美少妇xxx| 色婷婷香蕉在线一区二区| 99精品视频在线观看免费| 懂色av中文一区二区三区 | 精品国产露脸精彩对白| 91精品国产综合久久婷婷香蕉 | 久久免费精品国产久精品久久久久| 91麻豆精品国产自产在线| 在线亚洲欧美专区二区| 色哟哟在线观看一区二区三区| 成人永久看片免费视频天堂| 国产成人自拍网| 国产一区二区不卡| 国产麻豆成人精品| 国产呦萝稀缺另类资源| 久久国产尿小便嘘嘘尿| 奇米色一区二区三区四区|