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

📄 seed_dvs6446_uart.h

📁 TI的DM6446的硬件平台搭建的相关例子
💻 H
字号:
#include "davincievm.h"
/* ------------------------------------------------------------------------ *
 *                                                                          *
 *  UART regs                                                               *
 *                                                                          *
 * ------------------------------------------------------------------------ */
typedef struct {
    volatile Uint32 RBR;
    volatile Uint32 IER;
    volatile Uint32 IIR;
    volatile Uint32 LCR;
    volatile Uint32 MCR;
    volatile Uint32 LSR;
    Uint32 rsvd_18;
    Uint32 rsvd_1c;
    volatile Uint32 DLL;
    volatile Uint32 DLH;
    volatile Uint32 PID1;
    volatile Uint32 PID2;
    volatile Uint32 PWREMU_MGMT;
} UART_REGS;

#define THR     RBR    // THR & RBR occupy the same memory location
#define FCR     IIR    // FCR & IIR occupy the same memory location

typedef struct {
    UART_REGS* regs;
} UART_OBJ;
static Uint8 rx[256];
static Uint8 tx[256];
static UART_OBJ UART_MODULE_0 = { ( UART_REGS* )UART0_BASE };
static UART_OBJ UART_MODULE_1 = { ( UART_REGS* )UART1_BASE };

typedef UART_OBJ* UART_HANDLE;

/* ------------------------------------------------------------------------ *
 *  Prototypes                                                              *
 * ------------------------------------------------------------------------ */
UART_HANDLE DVS6446_UART_open( Uint16 id, Uint32 baudrate );
Int16       DVS6446_UART_close( UART_HANDLE UartHandle );

Int16 DVS6446_UART_xmtReady( UART_HANDLE UartHandle );
Int16 DVS6446_UART_rcvReady( UART_HANDLE UartHandle );

Int16 DVS6446_UART_putChar( UART_HANDLE UartHandle, Uint8 data );
Int16 DVS6446_UART_getChar( UART_HANDLE UartHandle, Uint8* data );

⌨️ 快捷键说明

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