⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lh7a400_uart_driver.h

📁 sharp触摸屏测试代码
💻 H
字号:
/***********************************************************************
 * $Workfile:   LH7A400_uart_driver.h  $
 * $Revision:   1.3  $
 * $Author:   BarnettH  $
 * $Date:   Aug 26 2002 16:32:24  $
 *
 * Project: LH7A400 
 *
 *
 * References:
 *      (1) Sharp LH7A400 Universal SoC User's Guide
 *
 * Description:
 *      Typedefs and prototypes for the LH7A400 component:
 *          UART Drivers
 *
 * Revision History:
 * $Log:   //smaicnt2/pvcs/VM/CHIPS/archives/LH7A400/Startup/LH7A400_uart_driver.h-arc  $
 * 
 *    Rev 1.3   Aug 26 2002 16:32:24   BarnettH
 * Ensured FIFO's were flushed on initialization
 * Added LH7A400_uart_fifo_flush ()
 * 
 *    Rev 1.2   Aug 20 2002 10:11:48   BarnettH
 * Doubled SIO_RX_TIMEOUT_COUNT (~30 secs at 200 MHz Core clock).
 * 
 *    Rev 1.1   Jun 28 2002 13:36:10   BarnettH
 * Increased rxs timeout downcount
 * 
 *    Rev 1.0   Jun 25 2002 17:44:10   BarnettH
 * Initial revision.
 * 
 ***********************************************************************
 * 
 *  Copyright (c) 2002 Sharp Microelectronics of the Americas
 *
 *  All rights reserved
 *
 *  SHARP MICROELECTRONICS OF THE AMERICAS MAKES NO REPRESENTATION
 *  OR WARRANTIES WITH RESPECT TO THE PERFORMANCE OF THIS SOFTWARE,
 *  AND SPECIFICALLY DISCLAIMS ANY RESPONSIBILITY FOR ANY DAMAGES,
 *  SPECIAL OR CONSEQUENTIAL, CONNECTED WITH THE USE OF THIS SOFTWARE.
 *
 *  SHARP MICROELECTRONICS OF THE AMERICAS PROVIDES THIS SOFTWARE SOLELY
 *  FOR THE PURPOSE OF SOFTWARE DEVELOPMENT INCORPORATING THE USE OF A
 *  SHARP MICROCONTROLLER OR SYSTEM-ON-CHIP PRODUCT.  USE OF THIS SOURCE
 *  FILE IMPLIES ACCEPTANCE OF THESE CONDITIONS.
 *
 **********************************************************************/
#ifndef LH7A400_UART_DRIVER_H
#define LH7A400_UART_DRIVER_H

#if defined (__cplusplus)
extern "C" {
#endif

/***********************************************************************
 * Library header files (#include)
 **********************************************************************/

/***********************************************************************
 * User header files (#include)
 **********************************************************************/
#include "SMA_types.h"
#include "SMA_ascii.h"
#include "LH7A400_map.h"

/***********************************************************************
 * Constant definitions (#define)
 **********************************************************************/
#define SIO_TXB_TIMEOUT_COUNT   (0x100000)
#define SIO_RXS_TIMEOUT_COUNT   (0x8000000)

#define STRING_TERM_NUL      0
#define STRING_TERM_LF      -1
#define STRING_TERM_CR      -2
#define STRING_TERM_CRLF    -3

/***********************************************************************
 * Macro definitions (#define)
 **********************************************************************/
#define GETDATABYTE(n) ((UNS_8)((n) & UART_DATA_MASK))

/***********************************************************************
 * Enumerated type definitions using the enum keyword.  
 **********************************************************************/
typedef enum { BREAK_OFF, BREAK_ON } BREAKSTATE;

typedef enum sio_error
{
    SIOERR_NO_ERROR,
    SIOERR_ILLEGAL_DEVNUM,
    SIOERR_RX_FIFO_EMPTY,
    SIOERR_RX_FIFO_FULL,
    SIOERR_TX_FIFO_EMPTY,
    SIOERR_TX_FIFO_FULL,
    SIOERR_TX_HR_FULL,
    SIOERR_TX_BUSY,
    SIOERR_TX_NODATA,
    SIOERR_RX_TIMEOUT,
    SIOERR_TX_TIMEOUT,
    /* */ 
    SIOERR_SIZE,
    SIOERR_SIZER=65536
} SIO_ERROR;

/***********************************************************************
 * Structure definitions and typedef's which will be used as members of
 * subsequent definitions.  
 **********************************************************************/

/***********************************************************************
 * Structure definitions with concurrent type definitions.
 **********************************************************************/

/***********************************************************************
 * Type definitions (typedef)
 **********************************************************************/

/***********************************************************************
 * Global data references (extern)
 **********************************************************************/

/***********************************************************************
 * Global function prototypes.  
 **********************************************************************/
SIO_ERROR LH7A400_uart_rxb (UARTREGS * uart, UNS_8 * rx_octet);
SIO_ERROR LH7A400_uart_rxs (UARTREGS * uart, UNS_8 * rxs, INT_32 term);
SIO_ERROR LH7A400_uart_txb (UARTREGS * uart, UNS_8 tx_octet);
SIO_ERROR LH7A400_uart_txs (UARTREGS * uart, UNS_8 * const txs, INT_32 term);
void LH7A400_uart_fifo_flush (UARTREGS * uart);
void LH7A400_uart_init (UARTREGS * uart, const UARTREGS * uinit);
void LH7A400_uart_sendbreak (UARTREGS * uart, BREAKSTATE state);

/***********************************************************************
 * Inline function declarations.  
 **********************************************************************/

#if defined (__cplusplus)
}
#endif

#endif // LH7A400_UART_DRIVER_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -