testrs232.c

来自「DM642 串口通讯程序」· C语言 代码 · 共 33 行

C
33
字号
#include <stdio.h>
#include <std.h>
#include <sys.h>
#include <csl.h>


#include "evmdm642.h"
#include "evmdm642_uart.h"


main ()
{
	char test,i;
    EVMDM642_UART_Handle hUart;
    EVMDM642_UART_Config uartcfg = {
        0x00,  // IER
        0x57,  // FCR - FIFO Mode, 16 character trigger level
        0x03,  // LCR - 8 bits, no parity, 1 stop
        0x00   // MCR
    };
    
    EVMDM642_init();
	
    /* Open UART */
    hUart = EVMDM642_UART_open(EVMDM642_UARTB, EVMDM642_UART_BAUD19200, &uartcfg);

    while (1){
        EVMDM642_UART_putChar(hUart, 0x23);
//        test = EVMDM642_UART_getChar(hUart);
    }
    

}

⌨️ 快捷键说明

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