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

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

?? gtsio.c

?? ge公司的dv4av4信號處理板的bsp源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/***************************************************************************
*
*  $RCSfile: gtSio.c $
*
*  Copyright 2001 by Dy 4 Systems, Inc.  All Rights Reserved.
*
*  $Revision: 1.12 $
*
*  $Name: AV4-ISP-R1.2-1 AV4-ISP-R1.2-0 HMTST2 HMTST1 DVT_AV4_4.101 $  $State: Developmental $  $Locker: $
*
*  $Source: L:/SWRND/champAV2/src/vx/src/drv/sio/rcs/gtSio.c $
*
*  RCS Project Name:
*
*  CSC:
*
*  Target:
*
*  Description:
*
*  Usage:
*
*  $Log: gtSio.c $
*  Revision 1.12  2005/04/28 17:59:52Z  dsessler
*  Revision 1.11  2005/03/14 21:27:25  ltsui
*  If route is bslShmuartGetMaster() (may not be 0) use traditional callback and arg.
*  Revision 1.10  2003/05/27 19:11:30Z  dsessler
*  corrected compile error for sioCallbackInstall
*  Revision 1.9  2003/05/21 21:01:32  dsessler
*  T2.2 fix for paths of included files under the bsp
*  Revision 1.8  2002/10/31 14:03:30  coopertr
*  Lower-layer driver and default SIO mode in BSL were changed to
*  provide XON/XOFF protocol at the lowest layer.  This function was
*  changed to disable this feature within the low-level driver, since the
*  vxWorks upper level SIO software provides these features.
*  Revision 1.7  2002/05/10 07:51:02  coopertr
*  Revision 1.6  2002/04/05 05:14:23  coopertr
*
****************************************************************************/
/*
This source file contains the serial I/O device driver for the Champ AV II
boards.  This serial driver is built on top of the MPSC unit of the 
Galileo Discovery bridge chip.

This driver does support some features like modifying baud rate but does not
support others: modem control signals, hangup, disable h/w flow control.
It also supports both interrupt mode and polled mode.

CALLBACKS
Servicing a "transmitter ready" interrupt involves making a callback to a
higher level library in order to get a character to transmit.
By default, this driver installs dummy callback routines which do
nothing. A higher layer library that wants to use this driver (e.g., ttyDrv)
will install its own callback routine using the SIO_INSTALL_CALLBACK
ioctl command.
Likewise, a receiver interrupt handler makes a callback to pass the
character to the higher layer library.

MODES
The driver supports both polled and interrupt modes, and is 
capable of switching modes dynamically. 
A communication path to an external mode debug agent (i.e., for monitor
style debugging) can be supported on this driver even if the driver
only supports polled mode.
Adding dynamic mode switching allows the external agent to be activated
whenever a message is sent to it (e.g., to be interrupted on first packet).

For dynamically mode switchable drivers, be aware that the driver may be
asked to switch modes in the middle of its input ISR. A driver's input ISR
will look something like this:

   inChar = *pDev->dr;          /@ read a char from data register @/
   *pDev->cr = GOT_IT;          /@ acknowledge the interrupt @/
   pDev->putRcvChar (...);      /@ give the character to the higher layer @/

If this channel is used as a communication path to an external mode
debug agent, and if the character received is a special "end of packet"
character, then the agent's callback will lock interrupts, switch
the device to polled mode, and use the device in polled mode for awhile.
Later on the agent will unlock interrupts, switch the device back to
interrupt mode, and return to the ISR.
In particular, the callback can cause two mode switches, first to polled mode
and then back to interrupt mode, before it returns.

USAGE
The driver is called only by the BSP. The directly callable
routines in this module are gtSioDevInit(), gtSioDevInit2(),
gtSioIntRcv(), gtSioIntTx().

The BSP calls gtSioDevInit() to initialize or reset the device.
It connects the driver's interrupt handlers (gtSioIntRcv, gtSioIntTx), 
using intConnect().
After connecting the interrupt handlers, the BSP calls gtSioDevInit2()
to inform the driver that interrupt mode operation is now possible.

*/

#include "vxWorks.h"
#include "sioLib.h"
#include "intLib.h"
#include "errno.h"
#include "bsl.h"
#include "bslSio.h"
#include "h/drv/sio/gtSio.h"

#define GT_BAUD_MIN	75
#define GT_BAUD_MAX 115200	

#define SDMA_PRIORITY 10

#define SDMA0RX 0x003
#define SDMA0TX 0x00C
#define SDMA1RX 0x300
#define SDMA1TX 0xC00

/* Hardware abstraction macros */

#ifndef GT_SIO_REG_READ
#   define GT_SIO_REG_READ(pChan, reg, result) \
	((result) = *(UCHAR *)(pChan->reg))
#endif /*GT_SIO_REG_READ*/

#ifndef GT_SIO_REG_WRITE
#   define GT_SIO_REG_WRITE(pChan, reg, data) \
	(*(UCHAR *)(pChan->reg) = data)
#endif /*GT_SIO_REG_WRITE*/

#if 0
/* for backward compatibility */

#ifndef	SIO_HUP
#   define SIO_OPEN	0x100A	/* open channel, raise DTR, RTS */
#   define SIO_HUP	0x100B	/* hang-up, lower DTR, RTS */
#endif
#endif

/* forward static declarations */

LOCAL int	gtSioTxStartup (SIO_CHAN * pSioChan);
LOCAL int	gtSioCallbackInstall (SIO_CHAN *pSioChan, int callbackType,
				    STATUS (*callback)(void *, ...), void *callbackArg);
LOCAL int	gtSioPollOutput (SIO_CHAN *pSioChan, char	outChar);
LOCAL int	gtSioPollInput (SIO_CHAN *pSioChan, char *thisChar);
LOCAL int	gtSioIoctl (SIO_CHAN *pSioChan, int request, void *arg);
LOCAL STATUS	dummyCallback (void);

/* local variables */

LOCAL	SIO_DRV_FUNCS gtSioDrvFuncs =
    {
    gtSioIoctl,
    gtSioTxStartup,
    (void *)gtSioCallbackInstall,
    gtSioPollInput,
    gtSioPollOutput
    };

LOCAL BOOL gtIntrMode = FALSE;	/* interrupt mode allowed flag */

/******************************************************************************
*
* gtSioDevInit - initialize a GT_DUSART
*
* This routine initializes the driver
* function pointers and then resets the chip in a quiescent state.
* The BSP must have already initialized all the device addresses and the
* baudFreq fields in the GT_DUSART structure before passing it to
* this routine.  The lower-level driver is initialized to the mode
* determined by BSLSIO_DEFAULT, except that echo, newline mapping,
* and xon/xoff are disabled in the low-level driver, since the 
* VxWorks driver provides these capabilities at a higher level. 
*
* RETURNS: N/A
*/

void gtSioDevInit
    (
    GT_PORT * pPort
    )
    {
    int baud = DEFAULT_BAUD_RATE;
    int opts = DEFAULT_SIO_MODE & 
               ~(BSLSIO_ECHO | BSLSIO_NLMAP | BSLSIO_XONXOFF);

    /* initialize each channel's driver function pointers */

    pPort->pDrvFuncs	= &gtSioDrvFuncs;

    /* initialize each channel's baud, and options */

    pPort->baud	   = baud;
    pPort->options	= opts;

    /* install dummy driver callbacks */

    pPort->getTxChar    = dummyCallback;
    pPort->putRcvChar	= dummyCallback;
    
    /* initialize dynamic routing options */
    
    pPort->lastRxChar = 0;
    pPort->setRoute   = 0;
    pPort->rxRoute    = 0;
    pPort->route      = 0;
    
    /* reset the chip */

    bslSioChInitEnv(pPort->portId, baud, opts);

    /* setting polled mode is one way to make the device quiet */

    gtSioIoctl ((SIO_CHAN *)pPort, SIO_MODE_SET,
		(void *)SIO_MODE_POLL);
    }

/******************************************************************************
*
* gtSioDevInit2 - initialize a GT_DUSART, part 2
*
* This routine is called by the BSP after interrupts have been connected.
* The driver can now operate in interrupt mode.  Before this routine is
* called only polled mode operations should be allowed.
*
* RETURNS: N/A
* ARGSUSED
*/

void gtSioDevInit2
    (
    GT_PORT * pPort	/* device to initialize */
    )
    {

    /* Interrupt mode is allowed */

    gtIntrMode = TRUE;
    }

/******************************************************************************
*
* gtSioIntHandler - direct a channel's interrupt to receive or transmit
* handler
*
* RETURNS: N/A
*
* NOTE: chan 0 or 1 should match sdma 0 or 1
*/ 

void gtSioIntHandler
    (
    GT_PORT * pChan
    )
    {

    if (pChan->portId == 0)
    {
       if (bslIntGetSdmaCause (SDMA0RX))
          gtSioIntRcv (pChan);
          
       else
          gtSioIntTx (pChan);
    }
   
    else if (pChan->portId == 1)
    {
       if (bslIntGetSdmaCause (SDMA1RX))
          gtSioIntRcv (pChan);
          
       else
          gtSioIntTx (pChan);
    }
    }

/******************************************************************************
*
* gtSioIntRcv - handle a channel's receive-character interrupt
*
* If dynamic routing is in place, this function looks for <esc><n>
* input sequences, where <n> is the processor to which the serial
* port should be attached.  When this sequence is detected, this ISR
* calls the setRoute callback function.
*
* RETURNS: N/A
*/ 

void gtSioIntRcv
    (
    GT_PORT * pChan		/* channel generating the interrupt */
    )
    {
    int  c, status;

    /*
     * Grab input characters from the chip and hand off via a
     * callback. The entire FIFO is emptied.
     */

    while ((c = bslSioGetc (pChan->portId)) >= 0)
        {
        if (pChan->setRoute != 0)
            {
            status = 0;
           
            if (pChan->lastRxChar == 0x1b)
                {
                status = (pChan->setRoute)(&pChan->route, c);
               
                /**  If routing to 0, use traditional callback and arg **/
               
                if (pChan->route == bslShmuartGetMaster())
                    {
                    pChan->putRcvChar = pChan->savePutRcvChar;
                    pChan->putRcvArg  = pChan->savePutRcvArg;
                    }
                  
                else
                    {
                    pChan->putRcvChar     = (void *) (pChan->rxRoute);
                    pChan->putRcvArg      = (void *) (pChan->route);
                    }
               
                if (status != 0)
                    {
                    (*pChan->putRcvChar) (pChan->putRcvArg, pChan->lastRxChar);
                    (*pChan->putRcvChar) (pChan->putRcvArg, c);                       
                    }
                }
               
            else if (c != 0x1b)
                (*pChan->putRcvChar) (pChan->putRcvArg, c);
               
            pChan->lastRxChar = c;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品毛片久久久久久| 亚洲一区二区3| 亚洲免费观看高清完整版在线| 亚洲午夜精品久久久久久久久| 久久精品久久99精品久久| 91在线码无精品| 久久免费国产精品| 亚洲不卡av一区二区三区| 国产xxx精品视频大全| 91.com视频| 一区二区三区视频在线观看| 国产大陆亚洲精品国产| 欧美久久一二三四区| 亚洲色图欧美在线| 国产成人a级片| 日韩欧美区一区二| 丝袜美腿亚洲综合| 在线观看三级视频欧美| 国产精品久久久久影院亚瑟 | 久久99国产精品久久99| 欧美中文字幕久久| 亚洲男同1069视频| 不卡的av网站| 中文字幕不卡在线播放| 国产精品亚洲专一区二区三区| 欧美乱妇一区二区三区不卡视频| 亚洲精品国产高清久久伦理二区| 成人黄色av电影| 国产精品美女视频| 成人小视频免费观看| 欧美高清在线视频| 波多野洁衣一区| 综合久久综合久久| 99久久国产综合精品女不卡| 国产精品久久久久久久岛一牛影视| 国产乱码精品1区2区3区| 久久影院视频免费| 国产伦精品一区二区三区免费| 久久综合视频网| 国产乱子轮精品视频| 欧美高清在线精品一区| 不卡视频免费播放| 1000部国产精品成人观看| 99re热这里只有精品免费视频| 亚洲视频免费观看| 在线观看一区不卡| 日韩av一二三| 久久新电视剧免费观看| 成人自拍视频在线| 中文字幕日韩欧美一区二区三区| 91视频观看免费| 一区二区三区在线不卡| 91麻豆精品国产91久久久使用方法| 日韩国产欧美三级| 精品福利一区二区三区免费视频| 国产一区二区三区美女| 中文av字幕一区| 在线精品视频免费播放| 美女视频黄 久久| 日韩欧美在线1卡| 成人综合婷婷国产精品久久 | 久久精品夜夜夜夜久久| 99久久精品99国产精品| 午夜精彩视频在线观看不卡| 久久综合一区二区| 色老头久久综合| 蜜臀va亚洲va欧美va天堂| 国产婷婷色一区二区三区在线| 91最新地址在线播放| 日本不卡一区二区三区| 国产亚洲一二三区| 欧美日韩免费电影| 国产成人福利片| 日韩中文字幕不卡| 欧美国产日韩a欧美在线观看| 欧美日韩在线一区二区| 国产成人精品综合在线观看 | 在线免费不卡视频| 国产精品正在播放| 亚洲va天堂va国产va久| 国产人成亚洲第一网站在线播放 | 亚洲成年人网站在线观看| 久久久精品黄色| 88在线观看91蜜桃国自产| 成人精品高清在线| 久久av资源站| 午夜久久久久久| 亚洲色图欧洲色图| 国产午夜亚洲精品不卡| 69精品人人人人| 91国内精品野花午夜精品| 成人午夜碰碰视频| 蜜臀久久99精品久久久久宅男 | 国产三级欧美三级| 欧美视频一区二区| 91免费视频网址| 国产成人99久久亚洲综合精品| 日韩精品电影在线观看| 一区二区高清免费观看影视大全| 中国av一区二区三区| 久久综合久久久久88| 欧美一区二区三区在线观看 | 日韩一级免费观看| 欧美三级视频在线观看| 91福利视频网站| 日本韩国精品在线| av一区二区久久| 成人小视频免费观看| 国产激情视频一区二区三区欧美| 久久国产精品一区二区| 日本中文在线一区| 日韩高清不卡在线| 三级在线观看一区二区 | 亚洲人xxxx| 亚洲欧美自拍偷拍| 中文字幕一区二区三区在线播放 | 欧美成人r级一区二区三区| 欧美日韩中字一区| 欧美日韩一区二区电影| 欧美日韩一区在线| 91精品麻豆日日躁夜夜躁| 欧美情侣在线播放| 欧美精品777| 日韩欧美在线不卡| 成人免费在线播放视频| 国产女人18毛片水真多成人如厕 | 韩国一区二区视频| 国产真实精品久久二三区| 国产乱子伦视频一区二区三区 | 欧美va亚洲va国产综合| 精品国产电影一区二区| 国产亚洲一本大道中文在线| 中文字幕成人在线观看| 综合激情成人伊人| 亚洲成人av福利| 免费观看日韩av| 国产精品中文字幕一区二区三区| 国产福利电影一区二区三区| 99久久国产免费看| 欧美特级限制片免费在线观看| 欧美妇女性影城| 26uuu久久综合| 中文字幕一区在线观看| 亚洲国产综合91精品麻豆| 欧美aaa在线| 国产 日韩 欧美大片| 欧亚洲嫩模精品一区三区| 91精品一区二区三区在线观看| 26uuu国产日韩综合| 中文字幕一区二区在线播放| 亚洲国产aⅴ成人精品无吗| 久久精品99久久久| 91亚洲精品久久久蜜桃| 欧美一级在线免费| 中文字幕国产精品一区二区| 亚洲一二三四区不卡| 韩国理伦片一区二区三区在线播放| heyzo一本久久综合| 欧美顶级少妇做爰| 国产精品短视频| 日本欧美一区二区三区| 99久久er热在这里只有精品15| 欧美一级一区二区| 国产精品成人午夜| 久久精品国产精品亚洲综合| 欧美日韩一区不卡| 日本一区免费视频| 日韩av在线播放中文字幕| www.爱久久.com| 欧美成人官网二区| 亚洲线精品一区二区三区八戒| 国产精品主播直播| 欧美一级在线观看| 一区二区三区在线观看国产| 国产成人综合自拍| 日韩欧美123| 午夜精品福利久久久| 91蜜桃在线免费视频| 中文字幕精品一区二区三区精品| 裸体歌舞表演一区二区| 在线观看欧美精品| 国产精品久久精品日日| 国产精品91xxx| 欧美大肚乱孕交hd孕妇| 亚洲国产精品一区二区www| 91网址在线看| 成人欧美一区二区三区白人| 国产乱码精品1区2区3区| 欧美videofree性高清杂交| 日日嗨av一区二区三区四区| 在线观看91精品国产入口| 亚洲人成亚洲人成在线观看图片| 国产传媒日韩欧美成人| 久久精品人人爽人人爽| 久久99国产精品免费网站| 日韩一区二区在线免费观看| 亚洲国产你懂的| 欧美日韩视频在线一区二区| 亚洲综合一二区| 欧美日韩国产精选|