?? main.c
字號:
#include "uartcfg.h"
#include <stdio.h>
#include <std.h>
#include <sys.h>
#include <csl.h>
#include <csl_edma.h>
#include <csl_gpio.h>
#include "evmdm642.h"
#include "evmdm642_uart.h"
#define ICETEKDM642_UART_BAUD9600 120//波特率9600
#define UART_INT *((unsigned char *)(0x90080014))//CPLD中斷源控制
EVMDM642_UART_Handle hUart;
EVMDM642_UART_Config uartcfg = {
0x01, // IER
0x57, // FCR - FIFO Mode, 16 character trigger level
0x03, // LCR - 8 bits, no parity, 1 stop
0x08 // MCR
};
main()
{
EVMDM642_init();
IRQ_globalEnable();
IRQ_nmiEnable();//NMIE
IER |= 0x80;//Interrupt Enble Register
UART_INT = 0x08;//開啟CPLD中斷控制
/* Open UART */
hUart = EVMDM642_UART_open(EVMDM642_UARTA,ICETEKDM642_UART_BAUD9600, &uartcfg);
while ( 1 )
{
// EVMDM642_UART_putChar(hUart, EVMDM642_UART_getChar(hUart));
}
}
void HWI_Uart()
{
//讀取LSR狀態
Int16 data;
data = EVMDM642_UART_getChar(hUart);
EVMDM642_UART_putChar(hUart,data);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -