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

📄 uart_test.c

📁 dm270 source code
💻 C
字号:
/*
Module Name	: uart_test.c

Functions	: UART0_TEST
			  UART1_TEST
    
Purpose		: Test PC and (DM270 or MCU) communication 

Notes		: 

*/

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

// Extern global variables
extern char UART_outBuff[1024];
extern volatile unsigned short	UART0IntFlag;
extern unsigned char Ctrl_FIFO1;

//
// Test PC and DM270 communication

void UART0_TEST(void) {

	UART_sendString( UART0, "\r\n ");
	UART_sendString( UART0, "\r\n ");
	UART_sendString( UART0, "\r\n ***************UART0  TEST***************" );
	UART_sendString( UART0, "\r\n   1234567890 ABCDEFGHIJKLMNOPQRSTUVWXYZ  " );
	UART_sendString( UART0, "\r\n ");
}

//
// Test PC and MCU communication

void UART1_TEST(void) {
	char ch;
	
	UART_sendByte( UART1, 0x06 );	// send to MCU Ready OFF
	UART_sendString( UART0, "\r\n ***************UART1  TEST***************" );
	UART_sendString( UART0, "\r\n Push Board Power 3 Sec Push Any Key(PC)" );
		
	while(UART0IntFlag);
	UART0IntFlag = 1;
	
	Ctrl_FIFO1 = 1;
	UART_sendByte( UART1, 0x01 );	// send to MCU Boot Ready
	ch = UI_getInput();
	if ( ch == 0x0c)
		UART_sendString( UART0, "\r\n Boot Ready PASS " );
	else
		UART_sendString( UART0, "\r\n Boot Ready ERROR " );
		
	UART_sendByte( UART1, 0x09 );	// send to MCU Sys Ready
	ch = UI_getInput();
	if ( ch == 0x0c)
		UART_sendString( UART0, "\r\n Sys Ready PASS " );
	else
		UART_sendString( UART0, "\r\n Sys Ready ERROR " );
	
	Ctrl_FIFO1 = 0;
	UART_sendString( UART0, "\r\n " );
}

⌨️ 快捷键说明

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