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

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

?? uart.c

?? RTOS系統
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* $Id: //depot/software/SDK/Triscend/a7hal/src/uart.c#18 $ *//* ********************************************************** *  uart.c *  Copyright(C) 2001-2004 Triscend Corporation. All Rights Reserved. *  This file is licensed under the terms of Triscend SDK License Agreement. ********************************************************** */#include "hal_conf.h"#if A7HAL_USE_UART/** * \file * The A7 contains two dedicated Universal Asynchronous Re-ceiver/Transmitters (UARTs) * Each UART is register and feature compatible with a 16C450/550-style device and is a full * duplex asynchronous communi-cation module that supports the following features. * - 5, 6, 7, or 8 bit data transmission * - Even, odd, or no parity bit generation and checking * - Start and stop bit generation and checking * - Line break detection and generation * - Receiver overrun and framing error checking * - Communications rates exceeding 1M baud * - Internal programmable baud-rate generator * - FIFO (16C550-style) or non-FIFO (16C450-style) operating modes * - Transmitter is buffered with 16-byte FIFO * - Receiver is buffered with 16-byte FIFO plus three error bits per data byte * - Exception handling using interrupt/polled modes * - Internal diagnostic capabilities with loop-back * - Modem handshake capability * In addition to the regular set of 16C550 registers, a few additional registers provide extra * flexibility to the serial ports. * * The functions within this file are only accessible if A7HAL_USE_UART * is #defined as YES in hal_conf.h *//** * \defgroup uart UART Driver * @{ */#include "uart.h"#include "clock.h"#include "triscend_a7.h"#if !A7HAL_USE_CLOCK#error The clock driver must be enabled in order to use this device.#endifstatic volatile a7hal_uart *serial;static int _stdioChan;static int _modemChan;int a7hal_uart_initialized;/** * \brief Initialize the UART. * * This function is called by a7hal_driverInit() * to initialize the UART to a known state and to set up * any data structures needed by the device driver. * * The line characteristics of the UART are set to; * * - No parity * - 8 Data bits * - 1 Stop bit * * If the #define \em A7HAL_BAUD_RATE is defined, the baud * rate of the UART is set to that value. If \em A7HAL_BAUD_RATE * is not defained the value of the #define \em A7HAL_DEFAULT_BAUD * is used (115200 by default). * * This function also enables the modem control lines and * configures UART 0 to be the STDIO UART by calling * a7hal_uart_setStdio(). Your FastChip project must have * the modem control lines connected. * * \return N/A * * \see a7hal_uart_setStdio, a7hal_clock_init * * \note The clock driver MUST be initialized by calling * a7hal_clock_init() before calling this function. * \em A7HAL_DEFAULT_BAUD is #defained in uart.h */void a7hal_uart_init( void ){    int port;    if ( a7hal_uart_initialized++ )        return;    /* Setup The Base Address Of The UART    */    serial = ( a7hal_uart * ) UART_BASE;    for ( port = 0; port < A7HAL_MAX_PORTS; port++ )    {        a7hal_uart_reset( port );        serial[port].control = 0x00000100;#ifndef    A7HAL_BAUD_RATE      /* defined in system.h */        a7hal_uart_setBaud( port, A7HAL_DEFAULT_BAUD );#else        a7hal_uart_setBaud( port, A7HAL_BAUD_RATE );#endif        /* 8 Data bits, 1 Stop bit, No Parity    */        a7hal_uart_setLineControl( port, 8, 1, 0 );        a7hal_uart_setFIFO( port, A7HAL_FIFO_14_BYTES );    }    a7hal_uart_setStdio( 0 );    a7hal_uart_modemControlEnable( 0 );#ifdef UART0_IS_USED  #if (UART0_IS_USED == TRUE)    a7hal_uart_setBaud( 0, UART0_SPEC_BAUDRATE );    #if (UART0_IS_MODEM_LINE_USED == TRUE)    a7hal_uart_modemControlEnable( 0 );    #endif    #if (UART0_PARITY == UART_NO_PARITY )    a7hal_uart_setLineControl( 0, UART0_DATA_BITS, UART0_STOP_BITS,                    A7HAL_PARITY_NONE );    #endif    #if (UART0_PARITY == UART_ODD_PARITY )    a7hal_uart_setLineControl( 0, UART0_DATA_BITS, UART0_STOP_BITS,                    A7HAL_PARITY_ODD );    #endif    #if (UART0_PARITY == UART_EVEN_PARITY )    a7hal_uart_setLineControl( 0, UART0_DATA_BITS, UART0_STOP_BITS,                    A7HAL_PARITY_EVEN );    #endif  #endif#endif#ifdef UART1_IS_USED  #if (UART1_IS_USED == TRUE)    a7hal_uart_setBaud( 1, UART1_SPEC_BAUDRATE );    #if (UART1_IS_MODEM_LINE_USED == TRUE)    a7hal_uart_modemControlEnable( 1 );    #endif    #if (UART1_PARITY == UART_NO_PARITY )    a7hal_uart_setLineControl( 1, UART1_DATA_BITS, UART1_STOP_BITS,                    A7HAL_PARITY_NONE );    #endif    #if (UART1_PARITY == UART_ODD_PARITY )    a7hal_uart_setLineControl( 1, UART1_DATA_BITS, UART1_STOP_BITS,                    A7HAL_PARITY_ODD );    #endif    #if (UART1_PARITY == UART_EVEN_PARITY )    a7hal_uart_setLineControl( 1, UART1_DATA_BITS, UART1_STOP_BITS,                    A7HAL_PARITY_EVEN );    #endif  #endif#endif}/** * \brief Set the UART line control information. * * This function should be used to set the UART line control characteristics. * * \param port UART number (0-1) * \param dataBits Number of data bits (5-8) * \param stopBits Number of stop bits (1-2) * \param parity Parity type * * \return N/A */void a7hal_uart_setLineControl( int port, int dataBits, int stopBits, int parity ){    if( stopBits == 1 )    {        switch( dataBits )        {        case 5:            serial[port].lineControl = A7HAL_BITS5_STOPS1;            break;        case 6:            serial[port].lineControl = A7HAL_BITS6_STOPS1;            break;        case 7:            serial[port].lineControl = A7HAL_BITS7_STOPS1;            break;        case 8:            serial[port].lineControl = A7HAL_BITS8_STOPS1;            break;        }    }    else    if( stopBits == 2 )    {        switch( dataBits )        {        case 6:            serial[port].lineControl = A7HAL_BITS6_STOPS2;            break;        case 7:            serial[port].lineControl = A7HAL_BITS7_STOPS2;            break;        case 8:            serial[port].lineControl = A7HAL_BITS8_STOPS2;            break;        }    }    if( parity == A7HAL_PARITY_NONE )        serial[port].lineControl |= A7HAL_PARITY_NONE;    else    if( parity == A7HAL_PARITY_ODD )        serial[port].lineControl |= A7HAL_PARITY_ENABLE | A7HAL_PARITY_ODD;    else    if( parity == A7HAL_PARITY_EVEN )        serial[port].lineControl |= A7HAL_PARITY_ENABLE | A7HAL_PARITY_EVEN;}/** * \brief Get the UART base address. * * \return The 32 bit base address of the UART device. */unsigned long a7hal_uart_getDeviceAddress( void ){    return ( ( unsigned long ) serial );}/** * \brief Read a character from a UART. * * This function reads one character from the specified UART. * * \param port UART number (0-1) * * \return The character read from the UART or -2 if no characters are available. * * \see a7hal_uart_putChar */int a7hal_uart_getChar( int port ){    /* Check To See If Data Is Ready To Be Read    */    if ( serial[port].lineStatus & A7HAL_DATA_READY )    {        /* Return The Received Char        */        return ( serial[port].rxtx );    }    else    {        /* No Chars To Be Read, Return Error    */        return ( -2 );    }}/** * \brief Write a character to a UART. * * This function blocks until the character is sent. * * \param port UART number (0-1) * \param c Character to send * * \return The character that was sent to the UART. * * \see a7hal_uart_getChar */int a7hal_uart_putChar( int port, int c ){    /* Wait For Thr Transmitter Holding Register Empty Bit    */    while ( ( serial[port].lineStatus & A7HAL_THRE ) == 0 ) ;    /* Send The Char To The Port                */    serial[port].rxtx = c;    return ( c );}/** * \brief Flush the UART transmitter. * * This function waits until the UART signals that the Transmitter Holding * Register (THR) is empty. * * \param port UART number (0-1) * * \return N/A */void a7hal_uart_flush( int port ){    /* Wait For Thr Transmitter Holding Register Empty Bit    */    while ( ( serial[port].lineStatus & A7HAL_TE ) == 0 ) ;}/** * \brief Set the baud rate of a UART. * * \param port UART number (0-1) * \param baudRate Baud rate to be set (9600-115200) * * \return N/A * * \see a7hal_clock_init, a7hal_clock_getFreq

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
奇米一区二区三区av| 欧美视频中文字幕| 国产麻豆精品视频| 蜜桃精品视频在线观看| 奇米888四色在线精品| 亚洲成人免费观看| 婷婷一区二区三区| 日韩二区三区在线观看| 日韩高清一区在线| 美女精品一区二区| 韩日av一区二区| 国产精品18久久久久久久久久久久 | 国产午夜久久久久| 国产亚洲欧美日韩在线一区| 2024国产精品| 国产欧美精品一区二区色综合| 久久久午夜精品理论片中文字幕| 国产日韩欧美不卡在线| 国产精品久久久久一区二区三区共| 日本一区二区成人| 综合激情成人伊人| 亚洲美女少妇撒尿| 亚洲v中文字幕| 久久99蜜桃精品| 成人免费看视频| 色婷婷狠狠综合| 欧美日韩国产一二三| 日韩一区二区三区视频在线 | 亚洲欧洲精品一区二区精品久久久| 国产无人区一区二区三区| 国产精品色哟哟网站| 亚洲少妇屁股交4| 日韩在线卡一卡二| 国产精品夜夜爽| 91视频免费看| 欧美一区二区三区精品| 精品处破学生在线二十三| 国产精品视频一二| 亚洲国产一区二区在线播放| 日本vs亚洲vs韩国一区三区 | voyeur盗摄精品| 欧美特级限制片免费在线观看| 91精品福利在线一区二区三区 | wwwwww.欧美系列| 亚洲免费观看高清完整版在线观看 | 欧美怡红院视频| 精品成人私密视频| 亚洲精品一二三| 激情综合色播五月| 一本色道久久综合亚洲91| 日韩一区二区三区免费观看| 中文字幕中文字幕在线一区| 日本免费新一区视频| a级高清视频欧美日韩| 欧美精品色一区二区三区| 欧美国产日本视频| 日本特黄久久久高潮| 成人黄色免费短视频| 欧美一区二区视频网站| 国产精品蜜臀av| 美女爽到高潮91| 色综合一区二区| 久久九九国产精品| 日本不卡不码高清免费观看| 色综合久久久久久久| 精品免费国产一区二区三区四区| 亚洲精品欧美二区三区中文字幕| 国产一区二区免费在线| 欧美日韩国产综合草草| 亚洲丝袜另类动漫二区| 国产一区视频在线看| 欧美精品乱人伦久久久久久| 亚洲色图一区二区三区| 国产精品一二一区| 欧美成人伊人久久综合网| 亚洲国产美国国产综合一区二区| 成人激情图片网| 欧美精品一区视频| 久久精品国产在热久久| 欧美日韩在线电影| 亚洲日本护士毛茸茸| 粉嫩嫩av羞羞动漫久久久 | 日本中文字幕一区二区有限公司| 97se亚洲国产综合自在线| 久久综合久久鬼色中文字| 日韩av一二三| 欧美麻豆精品久久久久久| 亚洲欧美日韩国产一区二区三区 | 欧美在线啊v一区| 中文字幕日韩精品一区| 日韩午夜在线观看| 天天色天天爱天天射综合| 在线欧美日韩国产| 亚洲视频在线观看三级| 不卡一区二区三区四区| 中文在线一区二区| 国产福利电影一区二区三区| 欧美va亚洲va国产综合| 美女www一区二区| 欧美变态tickling挠脚心| 日韩精品亚洲专区| 欧美一区二区三区公司| 日本午夜一本久久久综合| 欧美一区2区视频在线观看| 五月天亚洲婷婷| 日韩一二在线观看| 蜜臀av一区二区三区| 欧美一区二区三区日韩| 美脚の诱脚舐め脚责91| 日韩欧美电影一二三| 黄色小说综合网站| 久久精品欧美日韩精品| 成人的网站免费观看| 综合色天天鬼久久鬼色| 97se亚洲国产综合在线| 一区二区三区影院| 欧美在线观看一区二区| 午夜伊人狠狠久久| 欧美一区日韩一区| 国产毛片精品视频| 国产精品人妖ts系列视频| 99久久久精品| 亚洲一区在线看| 日韩视频一区二区在线观看| 精品亚洲国产成人av制服丝袜| 国产网站一区二区三区| 91麻豆文化传媒在线观看| 亚洲综合清纯丝袜自拍| 91精品欧美一区二区三区综合在| 免费视频一区二区| 久久精品免费在线观看| 色综合天天综合给合国产| 亚洲成av人影院在线观看网| 精品欧美一区二区在线观看| 白白色 亚洲乱淫| 亚洲国产欧美在线| 久久免费视频一区| 色综合天天综合给合国产| 日本vs亚洲vs韩国一区三区二区 | 亚洲成a人在线观看| 亚洲一区二区三区不卡国产欧美| 69久久99精品久久久久婷婷| 国产九色精品成人porny| 亚洲三级电影网站| 日韩午夜激情免费电影| av中文字幕不卡| 日韩在线a电影| 国产精品久久一级| 91麻豆精品91久久久久久清纯| 国产高清久久久久| 亚洲福利视频三区| 中文在线免费一区三区高中清不卡| 欧美性感一类影片在线播放| 韩日欧美一区二区三区| 一区二区成人在线视频| 久久午夜国产精品| 亚洲狠狠丁香婷婷综合久久久| 欧美三区免费完整视频在线观看| 国产乱人伦偷精品视频免下载| 亚洲精品一二三区| 久久精品一二三| 色综合久久中文字幕| 久草这里只有精品视频| 亚洲免费av网站| 精品久久久久久最新网址| 91麻豆国产香蕉久久精品| 国产一区视频在线看| 午夜精品久久久久久久久| 国产精品日韩成人| 精品久久久久久久久久久久久久久| 99re成人在线| 国产河南妇女毛片精品久久久| 午夜影视日本亚洲欧洲精品| 亚洲欧洲另类国产综合| 久久久精品影视| 日韩欧美一二三区| 欧美老肥妇做.爰bbww| 99精品视频中文字幕| 国产精品白丝jk白祙喷水网站| 三级成人在线视频| 亚洲综合小说图片| 亚洲视频狠狠干| 亚洲国产成人午夜在线一区| 欧美不卡一区二区三区| 欧美日韩免费观看一区三区| 暴力调教一区二区三区| 国产69精品一区二区亚洲孕妇| 久久99精品久久久久| 日韩电影在线免费看| 亚洲在线一区二区三区| 中文字幕亚洲欧美在线不卡| 国产日韩欧美一区二区三区乱码 | 欧美精品一卡两卡| 欧美色老头old∨ideo| 欧美亚洲国产bt| 在线免费观看视频一区| 色婷婷亚洲综合| 91天堂素人约啪| 色噜噜狠狠色综合中国| 91免费小视频|