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

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

?? uart.c

?? RTOS系統
?? C
?? 第 1 頁 / 共 2 頁
字號:
 *  * \note The UART baud rates are based on the system clock * frequency. This function assumes the clock driver * has been initialized with a7hal_clock_init(). */void a7hal_uart_setBaud( int port, int baudRate ){    int oldLineStatus;    int baud;    baud =        ( a7hal_clock_getFreq( 0 ) / ( baudRate * A7HAL_CLOCK_DIVISOR ) ) - 1;    /* Save The Line Control Register    */    oldLineStatus = serial[port].lineControl;    /* Set The DLAB Bit            */    serial[port].lineControl = A7HAL_DLAB;    /* Set The MSB Of The Baud Dividor    */    serial[port].intEnable = ( ( baud >> 8 ) & 0xff );    /* Set The LSB Of The Baud Dividor    */    serial[port].rxtx = ( baud & 0xff );    /* Restore The Line Control Register    */    serial[port].lineControl = oldLineStatus;}/** * \brief Get the baud rate of a UART. * * Gets the current baud rate of the UART specified by the \em port * parameter. * * \param port UART number (0-1) * * \return The current UART baud rate. * * \see a7hal_uart_setBaud * * \note The baud rate returnd by this function may not match the * exact value of the baud rate that was set using * a7hal_uart_setBaud(). This is due to the fact that the * baud rate is calculated from the UART divisor registers, * and the CPU clock speed may not be divisible by the baud rate. */int a7hal_uart_getBaud( int port ){    int oldLineStatus;    int baud;    /* Save The Line Control Register    */    oldLineStatus = serial[port].lineControl;    /* Set The DLAB Bit            */    serial[port].lineControl = A7HAL_DLAB;    /* Set The MSB Of The Baud Dividor    */    baud = ( ( serial[port].intEnable & 0xff ) << 8 );    baud |= ( serial[port].rxtx & 0xff );    baud = a7hal_clock_getFreq( 0 ) / ( baud * A7HAL_CLOCK_DIVISOR );    /* Restore The Line Control Register    */    serial[port].lineControl = oldLineStatus;    return ( baud );}/** * \brief Write a string to a UART. * * This function wirtes a NULL terminated string to STDIO. If the * string contains any \em \\n characters they will be written as * \em \\r\\n. * * \param string Pointer to data * * \return N/A * * \see a7hal_uart_putChar, a7hal_uart_getStdio, a7hal_uart_setStdio */void a7hal_uart_putString( char *string ){    while ( *string )    {        if ( *string == '\n' )            a7hal_uart_putChar( a7hal_uart_getStdio(  ), ( int ) '\r' );        a7hal_uart_putChar( a7hal_uart_getStdio(  ), ( int ) *string++ );    }}/** * \brief Reset a UART to a know state. * * This function resets the specified UART. * * \param port UART number (0-1) * * \return N/A */void a7hal_uart_reset( int port ){    serial[port].control = UART_CONTROL_RESET_VALUE;    serial[port].lineControl = UART_LINE_CONTROL_RESET_VALUE;    serial[port].intEnable = UART_INT_ENABLE_RESET_VALUE;    serial[port].intId = UART_FIFO_CTRL_RESET_VALUE;    serial[port].modemControl = UART_MODEM_CONTROL_RESET_VALUE;}/** * \brief Set which UART should be used as STDIO. * * \param port UART number (0-1) * * \return Non zero if STDIO was set successfully. * * \see a7hal_uart_getStdio, a7hal_uart_putString */int a7hal_uart_setStdio( int port ){    int ok = port < A7HAL_MAX_PORTS;    if ( ok )        _stdioChan = port;    return ( ok );}/** * \brief Get which UART is being used as STDIO. * * \return Which UART is currently being used for standard input and output. * * \see a7hal_uart_setSdtio, a7hal_uart_putString */int a7hal_uart_getStdio( void ){    return ( _stdioChan );}/** * \brief Get the number of UARTS the driver supports. * * \return The value of A7HAL_MAX_PORTS #defined in uart.h */int a7hal_uart_getCount( void ){    return A7HAL_MAX_PORTS;}/** * \brief Enable the UART modem control lines. * * Enable the modem control lines for the specified UART. * * \param port UART number (0-1) * * \return N/A * * \see a7hal_uart_setRTS, a7hal_uart_setDTR * * \note The FastChip project must be configured to support * modem control lines before this function is called. */void a7hal_uart_modemControlEnable( int port ){    int n;    for ( n = 0; n < A7HAL_MAX_PORTS; n++ )    {        /* Disable Modem Control On All Ports    */        serial[n].control = 0x00000100;    }    /* Enable Modem Control On The Selected Channel    */    serial[port].control = 0x00000300;    /* Set RTS and DTR    */    a7hal_uart_setRTS( 1 );    a7hal_uart_setDTR( 1 );    _modemChan = port;}/** * \brief Set the state of the RTS modem control line. * * \param onOff New state of the RTS line * * \return N/A * * \see a7hal_uart_onOff, a7hal_uart_setDTR, a7hal_uart_modemControlEnable */void a7hal_uart_setRTS( a7hal_uart_onOff onOff ){    if ( onOff == ON )        serial[_modemChan].modemControl |= A7HAL_RTS;    else if ( onOff == OFF )        serial[_modemChan].modemControl &= ~A7HAL_RTS;}/** * \brief Set the state of the DTR modem comtrol line. * * \param onOff New state of the DTR line * * \return N/A * * \see a7hal_uart_onOff, a7hal_uart_setRTS, a7hal_uart_modemControlEnable */void a7hal_uart_setDTR( a7hal_uart_onOff onOff ){    if ( onOff == ON )        serial[_modemChan].modemControl |= A7HAL_DTR;    else if ( onOff == OFF )        serial[_modemChan].modemControl &= ~A7HAL_DTR;}/** * \brief Enable/disable a UART TX interrupt. * * Sets the state of the TX interrupt on the specified UART. * * \param port UART number (0-1) * \param onOff New state of the DTR line * * \return N/A * * \see a7hal_uart_onOff, a7hal_uart_setRxInt */void a7hal_uart_setTxInt( int port, a7hal_uart_onOff onOff ){    if ( onOff == ON )        serial[port].intEnable |= A7HAL_THRE_INT;    else if ( onOff == OFF )        serial[port].intEnable &= ~A7HAL_THRE_INT;}/** * \brief Enable/disable a UART RX interrupt. * * Sets the state of the RX interrupt on the specified UART. * * \param port UART number (0-1) * \param onOff New state of the DTR line * * \return N/A * * \see a7hal_uart_onOff, a7hal_uart_setTxInt */void a7hal_uart_setRxInt( int port, a7hal_uart_onOff onOff ){    if ( onOff == ON )        serial[port].intEnable |= A7HAL_RX_INT;    else if ( onOff == OFF )        serial[port].intEnable &= ~A7HAL_RX_INT;}/** * \brief Get the interrupt status of a UART. * * \param port UART number (0-1) * * \return UART interrupt status. * * \see a7hal_uart_setTxInt, a7hal_uart_setRxInt */int a7hal_uart_getIntStatus( int port ){    return ( serial[port].intId );}/** * \brief Get the line status of a UART. * * \param port UART number (0-1) * * \return UART line status. */int a7hal_uart_getLineStatus( int port ){    return ( serial[port].lineStatus );}/** * \brief Configure a UART FIFO. * * Sets the UART FIFO buffer to the specified depth. * * \param port UART number (0-1) * \param depth Depth of the UART FIFO * * \return N/A * * \see a7hal_uart_fifoDepth * * \note Any characters in the TX or RX FIFOs are flushed. */void a7hal_uart_setFIFO( int port, a7hal_uart_fifoDepth depth ){    serial[port].intId =        A7HAL_FIFO_TX_CLEAR | A7HAL_FIFO_RX_CLEAR | A7HAL_FIFO_ENABLE | depth;}/** @} */#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久国产精品99久久人人澡| 日本不卡123| 久久久久久亚洲综合| 日韩小视频在线观看专区| 在线观看成人免费视频| 欧美综合视频在线观看| 精品视频在线免费看| 欧美日韩精品一区二区三区蜜桃 | 亚洲少妇中出一区| 国产精品污网站| 久久精品国产99国产| 蜜桃视频免费观看一区| 日本视频一区二区三区| 久久狠狠亚洲综合| 国产91丝袜在线18| 91久久奴性调教| 欧美精品一级二级三级| 日韩精品一区二区三区视频 | 色综合视频一区二区三区高清| 成人一道本在线| 在线观看日韩电影| 日韩精品专区在线影院观看| 国产亚洲一区字幕| 亚洲乱码国产乱码精品精小说 | 久久99这里只有精品| 国产a久久麻豆| 欧美色精品天天在线观看视频| 欧美精选在线播放| 精品国产免费人成电影在线观看四季 | 一区二区日韩电影| 免费看日韩a级影片| 成人毛片在线观看| 色乱码一区二区三区88| 日韩欧美成人激情| 亚洲精品久久7777| 精品一区二区三区免费毛片爱| 成人av电影观看| 精品剧情v国产在线观看在线| 中文字幕一区不卡| 精品在线播放午夜| 99视频国产精品| 欧美v日韩v国产v| 一区二区三区蜜桃| heyzo一本久久综合| 欧美精品一区二区三区久久久 | 国产成人午夜高潮毛片| 777a∨成人精品桃花网| 精品一区二区免费看| 一本久道久久综合中文字幕| 久久亚洲精精品中文字幕早川悠里| 一区二区三区在线影院| 成人开心网精品视频| 精品对白一区国产伦| 三级在线观看一区二区| 色噜噜夜夜夜综合网| 国产精品超碰97尤物18| 国产成人免费视频网站 | 日本一区二区三区高清不卡| 青青青爽久久午夜综合久久午夜| 色欧美乱欧美15图片| 久久久久久久久久久黄色| 日韩av电影一区| 欧美性感一类影片在线播放| 亚洲女人的天堂| 91在线你懂得| 亚洲天堂网中文字| 不卡的av在线播放| 国产精品国产三级国产aⅴ原创| 狠狠色狠狠色合久久伊人| 欧美一级专区免费大片| 亚洲国产三级在线| 欧美色手机在线观看| 性欧美疯狂xxxxbbbb| 欧美日韩高清一区二区不卡| 亚洲男帅同性gay1069| 色综合久久天天综合网| 综合久久国产九一剧情麻豆| 99re视频精品| 亚洲国产毛片aaaaa无费看| 欧美午夜精品一区| 丝袜亚洲另类欧美综合| 欧美一区三区四区| 韩国女主播一区二区三区| 久久久久久久综合狠狠综合| 国产精品一二三四| 国产精品高潮呻吟| 91久久一区二区| 亚洲电影一级黄| 欧美一区二区三区性视频| 一本一道综合狠狠老| 亚洲男同1069视频| 制服丝袜成人动漫| 狠狠色狠狠色综合| 亚洲图片你懂的| 欧美日韩国产经典色站一区二区三区 | 欧美三区在线视频| 日本在线观看不卡视频| 欧美精品一区二区在线观看| 成人激情av网| 亚洲 欧美综合在线网络| 精品国产一区二区国模嫣然| 国产69精品一区二区亚洲孕妇| 亚洲美女视频在线| 日韩精品在线网站| 色综合久久久久综合体| 美女国产一区二区| 亚洲美女淫视频| 精品日本一线二线三线不卡 | 一区二区三区自拍| 欧美美女一区二区三区| 成人综合婷婷国产精品久久蜜臀 | 天堂精品中文字幕在线| 精品国产1区二区| 色综合久久久久综合体桃花网| 亚欧色一区w666天堂| 日本一区二区三区四区在线视频 | 免费在线观看日韩欧美| 中文字幕欧美国产| 欧美精品1区2区| 91小视频免费观看| 国产一区久久久| 亚洲电影视频在线| 国产精品久久久久影院亚瑟 | 亚洲成av人片在www色猫咪| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 日韩免费一区二区| 日本韩国欧美在线| 成人av综合一区| 国产一区二区三区精品视频| 亚洲国产精品一区二区久久 | 亚洲欧美日本在线| 久久久亚洲高清| 亚洲精品视频自拍| 精品久久久久久最新网址| 欧美高清性hdvideosex| 色综合久久88色综合天天免费| 国产91富婆露脸刺激对白| 激情都市一区二区| 久久99国产乱子伦精品免费| 日韩电影免费在线观看网站| 亚洲综合在线电影| 自拍偷拍欧美激情| 日韩久久一区二区| 亚洲视频免费观看| 怡红院av一区二区三区| 亚洲欧美日韩电影| 一区二区三区精品在线观看| 亚洲女同ⅹxx女同tv| 中文字幕亚洲在| 亚洲欧美色图小说| 中文字幕中文字幕在线一区| 国产精品久久久久四虎| 国产精品全国免费观看高清 | 91理论电影在线观看| www.亚洲人| 91热门视频在线观看| 一本久久a久久免费精品不卡| 色婷婷国产精品| 欧美色图片你懂的| 日韩三级伦理片妻子的秘密按摩| 91精品欧美福利在线观看| 日韩视频在线一区二区| 久久综合九色综合97婷婷| 欧美激情一区二区三区| 国产精品成人一区二区艾草 | 一本色道综合亚洲| 91免费视频网| 在线综合+亚洲+欧美中文字幕| 日韩一区二区免费在线电影| 久久一区二区视频| 亚洲欧洲av在线| 日韩av在线免费观看不卡| 看国产成人h片视频| 福利视频网站一区二区三区| 日本道色综合久久| 欧美zozozo| 日韩伦理电影网| 视频一区欧美日韩| 国产91在线|亚洲| 欧美日韩精品免费| 国产亚洲综合在线| 午夜成人在线视频| 国产成人午夜片在线观看高清观看| 色哟哟亚洲精品| 精品sm捆绑视频| 一区二区视频在线看| 看电影不卡的网站| 91九色02白丝porn| 久久综合色8888| 亚洲成人自拍偷拍| 成人教育av在线| 欧美一区二区三区影视| 亚洲免费成人av| 国产成人午夜视频| 日韩精品一区二区三区中文不卡 | 日本欧美肥老太交大片| www.亚洲色图| 久久久99免费| 人人爽香蕉精品| 欧美在线|欧美|