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

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

?? pid_serial_with_ints.c

?? ecos為實時嵌入式操作系統
?? C
字號:
//==========================================================================////      io/serial/arm/pid_serial_with_ints.c////      ARM PID Serial I/O Interface Module (interrupt driven)////==========================================================================//####COPYRIGHTBEGIN####//// -------------------------------------------// The contents of this file are subject to the Cygnus eCos Public License// Version 1.0 (the "License"); you may not use this file except in// compliance with the License.  You may obtain a copy of the License at// http://sourceware.cygnus.com/ecos// // Software distributed under the License is distributed on an "AS IS"// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the// License for the specific language governing rights and limitations under// the License.// // The Original Code is eCos - Embedded Cygnus Operating System, released// September 30, 1998.// // The Initial Developer of the Original Code is Cygnus.  Portions created// by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions.  All Rights Reserved.// -------------------------------------------////####COPYRIGHTEND####//==========================================================================//#####DESCRIPTIONBEGIN####//// Author(s):   gthomas// Contributors:  gthomas// Date:        1999-02-04// Purpose:     PID Serial I/O module (interrupt driven version)// Description: ////####DESCRIPTIONEND####////==========================================================================#include <pkgconf/system.h>#include <pkgconf/io_serial.h>#include <pkgconf/io.h>#include <cyg/io/io.h>#include <cyg/hal/hal_intr.h>#include <cyg/io/devtab.h>#include <cyg/io/serial.h>#ifdef CYGPKG_IO_SERIAL_ARM_PID#include "pid_serial.h"extern void diag_printf(const char *fmt, ...);typedef struct pid_serial_info {    CYG_ADDRWORD   base;    CYG_WORD       int_num;    cyg_interrupt  serial_interrupt;    cyg_handle_t   serial_interrupt_handle;} pid_serial_info;static bool pid_serial_init(struct cyg_devtab_entry *tab);static bool pid_serial_putc(serial_channel *chan, unsigned char c);static Cyg_ErrNo pid_serial_lookup(struct cyg_devtab_entry **tab,                                    struct cyg_devtab_entry *sub_tab,                                   const char *name);static unsigned char pid_serial_getc(serial_channel *chan);static bool pid_serial_set_config(serial_channel *chan, cyg_serial_info_t *config);static void pid_serial_start_xmit(serial_channel *chan);static void pid_serial_stop_xmit(serial_channel *chan);static cyg_uint32 pid_serial_ISR(cyg_vector_t vector, cyg_addrword_t data);static void       pid_serial_DSR(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data);static SERIAL_FUNS(pid_serial_funs,                    pid_serial_putc,                    pid_serial_getc,                   pid_serial_set_config,                   pid_serial_start_xmit,                   pid_serial_stop_xmit    );#ifdef CYGPKG_IO_SERIAL_ARM_PID_SERIAL0static pid_serial_info pid_serial_info0 = {0x0D800000, CYGNUM_HAL_INTERRUPT_SERIALA};#if CYGNUM_IO_SERIAL_ARM_PID_SERIAL0_BUFSIZE > 0static unsigned char pid_serial_out_buf0[CYGNUM_IO_SERIAL_ARM_PID_SERIAL0_BUFSIZE];static unsigned char pid_serial_in_buf0[CYGNUM_IO_SERIAL_ARM_PID_SERIAL0_BUFSIZE];static SERIAL_CHANNEL_USING_INTERRUPTS(pid_serial_channel0,                                       pid_serial_funs,                                        pid_serial_info0,                                       CYG_SERIAL_BAUD_RATE(CYGNUM_IO_SERIAL_ARM_PID_SERIAL0_BAUD),                                       CYG_SERIAL_STOP_DEFAULT,                                       CYG_SERIAL_PARITY_DEFAULT,                                       CYG_SERIAL_WORD_LENGTH_DEFAULT,                                       CYG_SERIAL_FLAGS_DEFAULT,                                       &pid_serial_out_buf0[0], sizeof(pid_serial_out_buf0),                                       &pid_serial_in_buf0[0], sizeof(pid_serial_in_buf0)    );#elsestatic SERIAL_CHANNEL(pid_serial_channel0,                      pid_serial_funs,                       pid_serial_info0,                      CYG_SERIAL_BAUD_RATE(CYGNUM_IO_SERIAL_ARM_PID_SERIAL0_BAUD),                      CYG_SERIAL_STOP_DEFAULT,                      CYG_SERIAL_PARITY_DEFAULT,                      CYG_SERIAL_WORD_LENGTH_DEFAULT,                      CYG_SERIAL_FLAGS_DEFAULT    );#endifDEVTAB_ENTRY(pid_serial_io0,              CYGDAT_IO_SERIAL_ARM_PID_SERIAL0_NAME,             0,                     // Does not depend on a lower level interface             &serial_devio,              pid_serial_init,              pid_serial_lookup,     // Serial driver may need initializing             &pid_serial_channel0    );#endif //  CYGPKG_IO_SERIAL_ARM_PID_SERIAL0#ifdef CYGPKG_IO_SERIAL_ARM_PID_SERIAL1static pid_serial_info pid_serial_info1 = {0x0D800020, CYGNUM_HAL_INTERRUPT_SERIALB};#if CYGNUM_IO_SERIAL_ARM_PID_SERIAL1_BUFSIZE > 0static unsigned char pid_serial_out_buf1[CYGNUM_IO_SERIAL_ARM_PID_SERIAL1_BUFSIZE];static unsigned char pid_serial_in_buf1[CYGNUM_IO_SERIAL_ARM_PID_SERIAL1_BUFSIZE];static SERIAL_CHANNEL_USING_INTERRUPTS(pid_serial_channel1,                                       pid_serial_funs,                                        pid_serial_info1,                                       CYG_SERIAL_BAUD_RATE(CYGNUM_IO_SERIAL_ARM_PID_SERIAL1_BAUD),                                       CYG_SERIAL_STOP_DEFAULT,                                       CYG_SERIAL_PARITY_DEFAULT,                                       CYG_SERIAL_WORD_LENGTH_DEFAULT,                                       CYG_SERIAL_FLAGS_DEFAULT,                                       &pid_serial_out_buf1[0], sizeof(pid_serial_out_buf1),                                       &pid_serial_in_buf1[0], sizeof(pid_serial_in_buf1)    );#elsestatic SERIAL_CHANNEL(pid_serial_channel1,                      pid_serial_funs,                       pid_serial_info1,                      CYG_SERIAL_BAUD_RATE(CYGNUM_IO_SERIAL_ARM_PID_SERIAL1_BAUD),                      CYG_SERIAL_STOP_DEFAULT,                      CYG_SERIAL_PARITY_DEFAULT,                      CYG_SERIAL_WORD_LENGTH_DEFAULT,                      CYG_SERIAL_FLAGS_DEFAULT    );#endifDEVTAB_ENTRY(pid_serial_io1,              CYGDAT_IO_SERIAL_ARM_PID_SERIAL1_NAME,             0,                     // Does not depend on a lower level interface             &serial_devio,              pid_serial_init,              pid_serial_lookup,     // Serial driver may need initializing             &pid_serial_channel1    );#endif //  CYGPKG_IO_SERIAL_ARM_PID_SERIAL1// Internal function to actually configure the hardware to desired baud rate, etc.static boolpid_serial_config_port(serial_channel *chan, cyg_serial_info_t *new_config, bool init){    pid_serial_info *pid_chan = (pid_serial_info *)chan->dev_priv;    volatile struct serial_port *port = (volatile struct serial_port *)pid_chan->base;    unsigned short baud_divisor = select_baud[new_config->baud];    unsigned char _lcr, _ier;    if (baud_divisor == 0) return false;  // Invalid configuration    _ier = port->ier;    port->ier = 0;  // Disable port interrupts while changing hardware    _lcr = select_word_length[new_config->word_length - CYGNUM_SERIAL_WORD_LENGTH_5] |         select_stop_bits[new_config->stop] |        select_parity[new_config->parity];    port->lcr = _lcr;    port->lcr |= LCR_DL;    port->mdl = baud_divisor >> 8;    port->ldl = baud_divisor & 0xFF;    port->lcr &= ~LCR_DL;    if (init) {        port->fcr = 0x07;  // Enable and clear FIFO        if (chan->out_cbuf.len != 0) {            port->ier = IER_RCV;        } else {            port->ier = 0;        }        port->mcr = MCR_INT|MCR_DTR|MCR_RTS;  // Master interrupt enable    } else {        port->ier = _ier;    }    if (new_config != &chan->config) {        chan->config = *new_config;    }    return true;}// Function to initialize the device.  Called at bootstrap time.static bool pid_serial_init(struct cyg_devtab_entry *tab){    serial_channel *chan = (serial_channel *)tab->priv;    pid_serial_info *pid_chan = (pid_serial_info *)chan->dev_priv;#ifdef CYGDBG_IO_INIT    diag_printf("PID SERIAL init - dev: %x.%d\n", pid_chan->base, pid_chan->int_num);#endif    (chan->callbacks->serial_init)(chan);  // Really only required for interrupt driven devices    if (chan->out_cbuf.len != 0) {        cyg_drv_interrupt_create(pid_chan->int_num,                                 99,                     // Priority - what goes here?                                 (cyg_addrword_t)chan,   //  Data item passed to interrupt handler                                 pid_serial_ISR,                                 pid_serial_DSR,                                 &pid_chan->serial_interrupt_handle,                                 &pid_chan->serial_interrupt);        cyg_drv_interrupt_attach(pid_chan->serial_interrupt_handle);        cyg_drv_interrupt_unmask(pid_chan->int_num);    }    pid_serial_config_port(chan, &chan->config, true);    return true;}// This routine is called when the device is "looked" up (i.e. attached)static Cyg_ErrNo pid_serial_lookup(struct cyg_devtab_entry **tab,                   struct cyg_devtab_entry *sub_tab,                  const char *name){    serial_channel *chan = (serial_channel *)(*tab)->priv;    (chan->callbacks->serial_init)(chan);  // Really only required for interrupt driven devices    return ENOERR;}// Send a character to the device output buffer.// Return 'true' if character is sent to devicestatic boolpid_serial_putc(serial_channel *chan, unsigned char c){    pid_serial_info *pid_chan = (pid_serial_info *)chan->dev_priv;    volatile struct serial_port *port = (volatile struct serial_port *)pid_chan->base;    if (port->lsr & LSR_THE) {// Transmit buffer is empty        port->thr = c;        return true;    } else {// No space        return false;    }}// Fetch a character from the device input buffer, waiting if necessarystatic unsigned char pid_serial_getc(serial_channel *chan){    unsigned char c;    pid_serial_info *pid_chan = (pid_serial_info *)chan->dev_priv;    volatile struct serial_port *port = (volatile struct serial_port *)pid_chan->base;    while ((port->lsr & LSR_RSR) == 0) ;   // Wait for char    c = port->rhr;    return c;}// Set up the device characteristics; baud rate, etc.static bool pid_serial_set_config(serial_channel *chan, cyg_serial_info_t *config){    return pid_serial_config_port(chan, config, false);}// Enable the transmitter on the devicestatic voidpid_serial_start_xmit(serial_channel *chan){    pid_serial_info *pid_chan = (pid_serial_info *)chan->dev_priv;    volatile struct serial_port *port = (volatile struct serial_port *)pid_chan->base;    port->ier |= IER_XMT;  // Enable xmit interrupt}// Disable the transmitter on the devicestatic void pid_serial_stop_xmit(serial_channel *chan){    pid_serial_info *pid_chan = (pid_serial_info *)chan->dev_priv;    volatile struct serial_port *port = (volatile struct serial_port *)pid_chan->base;    port->ier &= ~IER_XMT;  // Disable xmit interrupt}// Serial I/O - low level interrupt handler (ISR)static cyg_uint32 pid_serial_ISR(cyg_vector_t vector, cyg_addrword_t data){    serial_channel *chan = (serial_channel *)data;    pid_serial_info *pid_chan = (pid_serial_info *)chan->dev_priv;    cyg_drv_interrupt_mask(pid_chan->int_num);    cyg_drv_interrupt_acknowledge(pid_chan->int_num);    return CYG_ISR_CALL_DSR;  // Cause DSR to be run}// Serial I/O - high level interrupt handler (DSR)static void       pid_serial_DSR(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data){    serial_channel *chan = (serial_channel *)data;    pid_serial_info *pid_chan = (pid_serial_info *)chan->dev_priv;    volatile struct serial_port *port = (volatile struct serial_port *)pid_chan->base;    unsigned char isr;    isr = port->isr;    if ((isr & 0x0E) == ISR_Tx) {        (chan->callbacks->xmt_char)(chan);    } else {        // Assume receive interrupt        (chan->callbacks->rcv_char)(chan, port->rhr);    }    cyg_drv_interrupt_unmask(pid_chan->int_num);}#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品一区二区在线视频| 欧美影视一区二区三区| 日本高清视频一区二区| 精品国产不卡一区二区三区| 亚洲日穴在线视频| 国产一区在线看| 欧美区在线观看| 亚洲精品福利视频网站| 久久精品国产一区二区三区免费看| 色婷婷激情久久| 国产拍揄自揄精品视频麻豆| 免费在线观看精品| 欧美视频三区在线播放| 综合自拍亚洲综合图不卡区| 国产成人免费在线观看不卡| 日韩一区二区三区视频在线观看| 亚洲一区二区偷拍精品| 色偷偷一区二区三区| 国产女主播一区| 国产成人免费在线观看不卡| 精品国产3级a| 美女脱光内衣内裤视频久久网站 | 欧美三级在线视频| 夜夜亚洲天天久久| 色综合久久99| 一区二区三区精品视频在线| av色综合久久天堂av综合| 久久久久久免费毛片精品| 精品夜夜嗨av一区二区三区| 91精品欧美福利在线观看| 天天综合日日夜夜精品| 欧美无乱码久久久免费午夜一区| 美腿丝袜一区二区三区| 欧美国产视频在线| 国产精品2024| 久久久久久电影| 国产电影一区在线| 欧美高清在线一区二区| 成人高清av在线| 国产精品久久久久影院老司| 99久久婷婷国产综合精品电影 | 欧美色图在线观看| 亚洲国产欧美在线人成| 91精品国产一区二区三区 | 国产精品99久久久久久似苏梦涵| 久久色成人在线| 不卡av电影在线播放| 亚洲午夜私人影院| 日韩欧美123| 18成人在线观看| 99re成人精品视频| 亚洲中国最大av网站| 欧美精品第1页| 精品一区二区三区蜜桃| 国产精品嫩草久久久久| 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 麻豆极品一区二区三区| 国产调教视频一区| 色婷婷综合久久久中文一区二区 | 亚洲妇女屁股眼交7| 色婷婷激情综合| 午夜精品视频在线观看| 欧美日韩成人综合在线一区二区 | 亚洲一级不卡视频| 欧美在线免费观看视频| 亚洲aⅴ怡春院| 日韩欧美国产一区二区在线播放| 久久国产三级精品| 亚洲国产高清aⅴ视频| 99re这里都是精品| 亚洲国产aⅴ天堂久久| 欧美日本视频在线| 成人高清伦理免费影院在线观看| 亚洲人成网站色在线观看| 欧美日本韩国一区二区三区视频 | 国产精品久久午夜| 欧美性色黄大片| 久久99国产精品免费网站| 久久久久9999亚洲精品| 日本福利一区二区| 国内精品视频666| 亚洲三级在线看| 欧美精品1区2区| 国产91精品精华液一区二区三区 | 色哟哟在线观看一区二区三区| 一区二区三区免费网站| 日韩欧美在线不卡| 成人h动漫精品| 五月婷婷激情综合| 国产视频一区在线播放| 99久久国产综合色|国产精品| 亚洲国产精品久久不卡毛片| 久久人人爽爽爽人久久久| 91免费观看国产| 久久国产精品99精品国产| 国产精品二区一区二区aⅴ污介绍| 欧美色倩网站大全免费| 国产成人精品免费网站| 天堂影院一区二区| ●精品国产综合乱码久久久久| 91精品国产手机| 成人av在线资源网| 性欧美大战久久久久久久久| 国产一区啦啦啦在线观看| 国产欧美综合色| 欧美一区二区三区视频免费播放| 国产 欧美在线| 美女在线视频一区| 午夜精品国产更新| 中文无字幕一区二区三区| 欧美亚日韩国产aⅴ精品中极品| 国产成人亚洲精品青草天美| 五月天亚洲婷婷| 一区二区三区四区乱视频| 国产欧美日韩另类一区| 精品国产一区二区国模嫣然| 欧美色综合天天久久综合精品| 成人激情文学综合网| 国模娜娜一区二区三区| 久久99国产精品麻豆| 亚洲成人免费观看| 午夜精品一区二区三区三上悠亚| 亚洲女厕所小便bbb| 国产精品成人免费| 国产精品欧美一级免费| 日本一区二区免费在线观看视频| 欧美xxxxxxxx| 亚洲精品在线观看网站| 欧美成人三级电影在线| 日韩欧美美女一区二区三区| 欧美视频在线播放| 欧美在线观看视频一区二区三区 | 这里是久久伊人| 欧美色老头old∨ideo| 欧美三级日本三级少妇99| 欧洲一区二区三区免费视频| 色综合久久六月婷婷中文字幕| 国产成人精品免费看| 成人av免费在线观看| 91在线看国产| 在线观看av一区二区| 欧美日本在线播放| 欧美一级欧美一级在线播放| 91精品国产欧美一区二区成人 | 99视频超级精品| 色av一区二区| 色国产综合视频| 日韩欧美你懂的| 国产乱码精品一区二区三区五月婷| 免费成人av资源网| 美女视频黄 久久| 蜜臀91精品一区二区三区| 国产成人在线免费观看| 成人h版在线观看| 色综合久久九月婷婷色综合| 精品视频999| 日韩午夜激情视频| 国产三区在线成人av| 最新国产の精品合集bt伙计| 五月天视频一区| 日本亚洲三级在线| 国内精品国产成人国产三级粉色| 国产成人一级电影| 色系网站成人免费| 制服丝袜日韩国产| 亚洲卡通欧美制服中文| 天天av天天翘天天综合网色鬼国产| 免费观看久久久4p| 国产电影一区二区三区| 91精品国产综合久久久久| 久久一日本道色综合| 伊人色综合久久天天人手人婷| 日韩成人一级片| 处破女av一区二区| 在线播放日韩导航| 中文字幕欧美国产| 水野朝阳av一区二区三区| 国产成人免费9x9x人网站视频| 色综合天天综合色综合av| 欧美岛国在线观看| 亚洲欧美一区二区三区久本道91| 日韩激情视频网站| 91丨九色丨蝌蚪富婆spa| 日韩三区在线观看| 亚洲一区自拍偷拍| 视频一区二区欧美| 欧美视频一区二区| 国产精品久久三区| 久久99精品国产.久久久久| 欧美午夜一区二区三区免费大片| 久久九九影视网| 日产国产高清一区二区三区| 色偷偷久久人人79超碰人人澡| 日韩午夜激情视频| 久久精品国产澳门| 欧美精品久久一区二区三区| ㊣最新国产の精品bt伙计久久| 捆绑调教美女网站视频一区| 91视频精品在这里| 国产欧美精品在线观看|