uart.c

来自「dm270 source code」· C语言 代码 · 共 42 行

C
42
字号
/*
Module Name	: uart_test.c

Functions	: UARTInit
    
Purpose		: Initialize UART0 and UART1

Notes		: 

*/

// Local header files
#include <demo/uart270.h>

//
// Uart initialize Uart0( DM270 <-> PC ), Uart1( DM270 <-> MCU )

void UARTInit(void) {
	{
		UART_ConfigData uart0;
	
		uart0.baudRate    = 115200;
		uart0.charLength  = UART_CHAR_LEN_8;
		uart0.stopBits    = UART_STOPBIT1;
		uart0.parity      = UART_EVEN_PARITY;
	
		UART_setConfig( UART0, &uart0 );
	}
	{	
		UART_ConfigData uart1;
		
		uart1.baudRate    = 20834;
		uart1.charLength  = UART_CHAR_LEN_8;
		uart1.stopBits    = UART_STOPBIT1;
		uart1.parity      = UART_NO_PARITY;
	
		UART_setConfig( UART1, &uart1 );
	}
	
	UI_init();				
}

⌨️ 快捷键说明

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