?? dec5502_uartonchip.c
字號(hào):
/******************************************************************************/
/* Copyright 2004 by SEED Electronic Technology LTD. */
/* All rights reserved. SEED Electronic Technology LTD. */
/* Restricted rights to use, duplicate or disclose this code are */
/* granted through contract. */
/* MODULE NAME... UART */
/* PROJECT....... Communicate with PC by on-chip UART of 5502 */
/* FILENAME...... DEC5502_UART0NCHIP.c */
/* DESCRIPTION:This is an example for on-chip UART of C5502 */
/* 作者:韓敬 */
/* 版本:1.0 */
/* 時(shí)間:2006-08-11 */
/******************************************************************************/
#include <stdio.h>
#include <csl.h>
#include <csl_pll.h>
#include <csl_chip.h>
#include <csl_irq.h>
#include <csl_uart.h>
#include "Uart_Function.h"
#include "Timer.h"
#define SYSCNTL0 (*(volatile unsigned int *)(0x280000))
Uint16 i=0;
Uint16 Temp;
void main(void)
{
/* Initialize CSL library - This is REQUIRED !!! */
CSL_init();
/* Config PLL */
PLL_setFreq(1, // PLL mode
0xF, // Multiply factor, Valid values are (multiply by)10
0, // Sysclk 0 Divide Down
1, // Sysclk1 Divider 150MHz
3, // Sysclk2 Divider 75MHz
3, // Sysclk3 Divider
0); // CLKOUT3(DSP core clock) divider 300MHz
/* 配置定時(shí)器 */
Config_Timer();
/* Select on-chip uart */
SYSCNTL0 = 0x0;
/* Perform two dummy read */
Temp = (*(volatile ioport Uint16*)(0x9C00));
Temp = (*(volatile ioport Uint16*)(0x9C00));
/* Configure UART registers */
Uart_Config();
/* Clear recerver data structure
for(i=0; i<LENGTH; i++)
{
DestData[i] = 0;
} */
DataCount = 0;
for(;;)
{
if(PctoDsp == TRUE)
{
Write_Uart(LENGTH);
PctoDsp = FALSE;
}
}
}
/*****************************************************************************************/
// No more
/*****************************************************************************************/
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -