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

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

?? ser.c

?? eCos操作系統源碼
?? C
字號:
//=============================================================================////      ser.c////      Simple driver for the MDSChip serial port////=============================================================================//####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####//=============================================================================//#####DESCRIPTIONBEGIN####//// Author(s):   msalter// Contributors:msalter// Date:        2001-02-12// Description: Simple driver for the MDSChip serial port////####DESCRIPTIONEND####////=============================================================================#include <pkgconf/hal.h>#include <pkgconf/system.h>#include CYGBLD_HAL_PLATFORM_H#include <cyg/hal/hal_arch.h>           // SAVE/RESTORE GP macros#include <cyg/hal/hal_io.h>             // IO macros#include <cyg/hal/hal_if.h>             // interface API#include <cyg/hal/hal_intr.h>           // HAL_ENABLE/MASK/UNMASK_INTERRUPTS#include <cyg/hal/hal_misc.h>           // Helper functions#include <cyg/hal/drv_api.h>            // CYG_ISR_HANDLED// We have no control over baud rate#if CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD==57600#define CYG_DEV_SERIAL_BAUD_DIVISOR    BAUD_57600#endif#ifndef CYG_DEV_SERIAL_BAUD_DIVISOR#error Missing/incorrect serial baud rate defined - CDL error?#endif//-----------------------------------------------------------------------------typedef struct {    cyg_uint8* base;    cyg_int32 msec_timeout;    int isr_vector;} channel_data_t;static channel_data_t channels[1] = {    { (cyg_uint8*)0, 1000, 0}};//-----------------------------------------------------------------------------// The minimal init, get and put functions. All by polling.voidcyg_hal_plf_serial_init_channel(void* __ch_data){    cyg_hal_plf_write_sr_rbr(0);    cyg_hal_plf_write_sr_tbr(0);    cyg_hal_plf_write_tbr(0);    cyg_hal_plf_write_rbr(0);}voidcyg_hal_plf_serial_putc(void* __ch_data, cyg_uint8 __ch){    // wait for tx rdy    while (cyg_hal_plf_read_sr_tbr() != 0) ;    // Now, write it    cyg_hal_plf_write_tbr(__ch);    // and set TBR    cyg_hal_plf_write_sr_tbr(1);}static cyg_boolcyg_hal_plf_serial_getc_nonblock(void* __ch_data, cyg_uint8* ch){    if (cyg_hal_plf_read_sr_rbr() == 0)	return false;    *ch = cyg_hal_plf_read_rbr();    cyg_hal_plf_write_sr_rbr(0);    return true;}cyg_uint8cyg_hal_plf_serial_getc(void* __ch_data){    cyg_uint8 ch;    while(!cyg_hal_plf_serial_getc_nonblock(__ch_data, &ch));    return ch;}static voidcyg_hal_plf_serial_write(void* __ch_data, const cyg_uint8* __buf,                          cyg_uint32 __len){    while(__len-- > 0)        cyg_hal_plf_serial_putc(__ch_data, *__buf++);}static voidcyg_hal_plf_serial_read(void* __ch_data, cyg_uint8* __buf, cyg_uint32 __len){    while(__len-- > 0)        *__buf++ = cyg_hal_plf_serial_getc(__ch_data);}cyg_boolcyg_hal_plf_serial_getc_timeout(void* __ch_data, cyg_uint8* ch){    int delay_count;    channel_data_t* chan;    cyg_bool res;    // Some of the diagnostic print code calls through here with no idea what the ch_data is.    // Go ahead and assume it is channels[0].    if (__ch_data == 0)      __ch_data = (void*)&channels[0];    chan = (channel_data_t*)__ch_data;    delay_count = chan->msec_timeout * 10; // delay in .1 ms steps    for(;;) {        res = cyg_hal_plf_serial_getc_nonblock(__ch_data, ch);        if (res || 0 == delay_count--)            break;        CYGACC_CALL_IF_DELAY_US(100);    }    return res;}static intcyg_hal_plf_serial_control(void *__ch_data, __comm_control_cmd_t __func, ...){    static int irq_state = 0;    channel_data_t* chan;    int ret = 0;    // Some of the diagnostic print code calls through here with no idea what the ch_data is.    // Go ahead and assume it is channels[0].    if (__ch_data == 0)      __ch_data = (void*)&channels[0];    chan = (channel_data_t*)__ch_data;    switch (__func) {    case __COMMCTL_IRQ_ENABLE:        irq_state = 1;        HAL_INTERRUPT_SET_LEVEL(chan->isr_vector, 1);        HAL_INTERRUPT_UNMASK(chan->isr_vector);        break;    case __COMMCTL_IRQ_DISABLE:        ret = irq_state;        irq_state = 0;        HAL_INTERRUPT_MASK(chan->isr_vector);        break;    case __COMMCTL_DBG_ISR_VECTOR:        ret = chan->isr_vector;        break;    case __COMMCTL_SET_TIMEOUT:    {        va_list ap;        va_start(ap, __func);        ret = chan->msec_timeout;        chan->msec_timeout = va_arg(ap, cyg_uint32);        va_end(ap);    }            break;    case __COMMCTL_SETBAUD:    {	cyg_uint32 baud_rate;        va_list ap;        va_start(ap, __func);        baud_rate = va_arg(ap, cyg_uint32);        va_end(ap);        switch (baud_rate)        {        case 57600:  break;        default:     return -1;        }    }    break;    case __COMMCTL_GETBAUD:        break;    default:        break;    }    return ret;}static intcyg_hal_plf_serial_isr(void *__ch_data, int* __ctrlc,                        CYG_ADDRWORD __vector, CYG_ADDRWORD __data){    *__ctrlc = 0;    return 0;}static voidcyg_hal_plf_serial_init(void){    hal_virtual_comm_table_t* comm;    int cur = CYGACC_CALL_IF_SET_CONSOLE_COMM(CYGNUM_CALL_IF_SET_COMM_ID_QUERY_CURRENT);    // Disable interrupts.    HAL_INTERRUPT_MASK(channels[0].isr_vector);    // Init channels    cyg_hal_plf_serial_init_channel((void*)&channels[0]);        // Setup procs in the vector table    // Set channel 0    CYGACC_CALL_IF_SET_CONSOLE_COMM(0);    comm = CYGACC_CALL_IF_CONSOLE_PROCS();    CYGACC_COMM_IF_CH_DATA_SET(*comm, &channels[0]);    CYGACC_COMM_IF_WRITE_SET(*comm, cyg_hal_plf_serial_write);    CYGACC_COMM_IF_READ_SET(*comm, cyg_hal_plf_serial_read);    CYGACC_COMM_IF_PUTC_SET(*comm, cyg_hal_plf_serial_putc);    CYGACC_COMM_IF_GETC_SET(*comm, cyg_hal_plf_serial_getc);    CYGACC_COMM_IF_CONTROL_SET(*comm, cyg_hal_plf_serial_control);    CYGACC_COMM_IF_DBG_ISR_SET(*comm, cyg_hal_plf_serial_isr);    CYGACC_COMM_IF_GETC_TIMEOUT_SET(*comm, cyg_hal_plf_serial_getc_timeout);    // Restore original console    CYGACC_CALL_IF_SET_CONSOLE_COMM(cur);}voidcyg_hal_plf_comms_init(void){    static int initialized = 0;    if (initialized)        return;    initialized = 1;    cyg_hal_plf_serial_init();}//-----------------------------------------------------------------------------// end of ser16c550c.c

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆91免费观看| 欧美成人女星排名| 成人看片黄a免费看在线| 免费xxxx性欧美18vr| 国产精品久久久久久久久免费相片 | 欧美精品乱码久久久久久按摩| 亚洲国产成人一区二区三区| 精品视频在线视频| 国产一区二区三区高清播放| 综合激情成人伊人| 日韩一区二区视频在线观看| 99在线精品一区二区三区| 国产女主播一区| 精品国产1区二区| 丁香六月久久综合狠狠色| 丝袜美腿成人在线| av欧美精品.com| 亚洲一二三四在线| 国产免费观看久久| 一区二区三区鲁丝不卡| 国产福利91精品一区| 精品一区二区三区欧美| 视频在线观看一区| 九九精品视频在线看| 国产激情一区二区三区四区| av中文一区二区三区| 在线观看成人小视频| 91精品国产手机| 久久久久久免费| 一区二区三区日韩欧美精品| 欧美国产精品一区二区| 日韩精品一区二区三区老鸭窝| 欧美一区二区三区四区在线观看 | 成人午夜短视频| 韩国精品免费视频| 成人中文字幕合集| 欧美美女bb生活片| 日韩毛片视频在线看| 国产乱理伦片在线观看夜一区| 精品视频在线免费看| 亚洲一区在线视频观看| www.日本不卡| 亚洲欧洲精品天堂一级| 国产激情一区二区三区| 日韩欧美精品在线| 国产在线不卡一卡二卡三卡四卡| 97精品久久久午夜一区二区三区| 精品一区二区三区在线视频| 成人av网站在线观看免费| 欧美大胆人体bbbb| 蜜臀av在线播放一区二区三区 | 91精彩视频在线| 亚洲欧洲精品天堂一级| 95精品视频在线| 国产精品国产自产拍高清av王其| 成人在线综合网| 亚洲视频一区二区免费在线观看 | 亚洲精品大片www| 欧美午夜精品一区二区三区| 伊人开心综合网| 欧美高清性hdvideosex| 蜜臀av性久久久久蜜臀aⅴ流畅| 91麻豆精品国产91久久久更新时间 | 亚洲欧美日韩国产另类专区| 色噜噜狠狠色综合中国| 香蕉久久夜色精品国产使用方法 | 成人v精品蜜桃久久一区| 国产精品国产a级| 欧美午夜电影在线播放| 奇米四色…亚洲| 欧美激情一区二区三区不卡| 色视频一区二区| 青青国产91久久久久久| 久久免费看少妇高潮| 日本久久精品电影| 蜜桃一区二区三区四区| 色国产综合视频| 亚洲人成精品久久久久| 国产69精品久久99不卡| 欧美日韩一级二级三级| 久久精品日产第一区二区三区高清版 | 精品国产免费一区二区三区四区| 中文字幕一区二区三区四区| 韩国视频一区二区| 欧美性猛交一区二区三区精品| 欧美日韩国产高清一区二区三区 | 蜜桃久久av一区| 欧美精品自拍偷拍| 水野朝阳av一区二区三区| 成人影视亚洲图片在线| 欧美国产精品专区| www.亚洲人| 亚洲色图在线看| 欧美综合一区二区三区| 亚洲一区二区三区四区五区中文 | 视频一区免费在线观看| 欧美一区二区三区视频在线观看 | 亚洲乱码精品一二三四区日韩在线| 成人午夜激情视频| 亚洲欧美激情小说另类| 日韩一区二区高清| 捆绑调教一区二区三区| 裸体一区二区三区| 日韩欧美中文字幕一区| 国产精品久久久久久久久免费丝袜 | 色婷婷久久综合| 国产精品天干天干在线综合| 国产福利91精品一区| 久久久久国产精品免费免费搜索| 久久国产剧场电影| 精品99久久久久久| 国产麻豆精品视频| 国产精品1024| 亚洲区小说区图片区qvod| 91精品国产日韩91久久久久久| 波多野结衣中文一区| 亚洲6080在线| 中文字幕在线不卡国产视频| 久久久99精品久久| 欧美日韩一区三区四区| 波多野洁衣一区| 国产精品一级在线| 午夜久久久影院| 中文字幕av资源一区| 欧美日韩国产综合草草| 99精品久久只有精品| 蜜桃久久av一区| 天天综合网 天天综合色| 亚洲人快播电影网| 国产视频一区在线播放| 欧美日韩夫妻久久| 91豆麻精品91久久久久久| 丁香婷婷深情五月亚洲| 国内精品第一页| 日韩电影在线一区| 亚洲午夜在线视频| 一区二区三区四区中文字幕| 精品免费国产二区三区| 欧美一区二区三区视频在线观看| 欧美日韩一区二区三区四区五区| 欧美在线免费观看视频| 欧美一激情一区二区三区| 91丨九色丨国产丨porny| 亚洲一卡二卡三卡四卡五卡| 琪琪一区二区三区| 欧美另类久久久品| 人人精品人人爱| 亚洲国产一区视频| 91麻豆精品91久久久久久清纯 | 久久国产精品99久久人人澡| 国产精品人人做人人爽人人添| 在线观看欧美黄色| 国内国产精品久久| 亚洲日本乱码在线观看| 欧美一区二区日韩| 成人妖精视频yjsp地址| 欧美日韩一区二区在线观看| 欧美精品乱码久久久久久| 日韩欧美在线影院| 久久亚洲精品国产精品紫薇 | 色婷婷久久久亚洲一区二区三区| 99久久er热在这里只有精品66| 99久久精品99国产精品| 欧美日韩视频不卡| 欧美一级久久久| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 国产人成一区二区三区影院| 精品久久一二三区| 亚洲欧洲日韩综合一区二区| 夜夜爽夜夜爽精品视频| 国产一区二区不卡在线 | 亚洲成人av中文| 国产成人在线视频播放| 色域天天综合网| 精品99999| 婷婷六月综合亚洲| 91麻豆文化传媒在线观看| 欧美久久久久久久久久| www国产精品av| 日韩精品成人一区二区三区| 成人一道本在线| 欧美日韩国产首页| 国产欧美日韩亚州综合| 精品一区二区日韩| 91精品免费在线观看| 青草av.久久免费一区| 精品成人一区二区三区四区| 国产精品美女久久久久久久久 | 国产尤物一区二区| 亚洲国产视频一区| 亚洲色图视频网| 欧美性生交片4| 成人高清免费在线播放| 国产在线看一区| 麻豆久久久久久| 免费成人在线观看视频| 五月婷婷综合在线| 亚洲一区二区欧美激情| 亚洲人被黑人高潮完整版| 国产精品久久久久久久久免费相片 |