资源简介
这是我在华清远见嵌入式培训学习时老师给的关于ARM源代码程序 有很高的学习使用价值 希望大家好好利用!!

代码片段和文件信息
#include
#define FCLK 202800000 //202.8MHZ
#define HCLK (202800000/2)
#define PCLK (202800000/4)
#define UART0 0x0 // UART symbol
#define UART1 0x1
#define UART2 0xBB
#define ADC_FREQ 2500000 //2.5MHZ
static const char adsheet[10]={0x300x310x320x330x340x350x360x370x380x39};
volatile unsigned int PreScaler; //与分频器
/*********************************************************************************************
* name: uart_init
* func: initialize uart channel
* para: nMainClk -- input the MCLK value of current system
* nBaud -- input baud rate value for UARTx
* nChannel -- input UART0 UART1 or UART2
* ret: none
* modify:
* comment:
*********************************************************************************************/
void uart_init(int nMainClk int nBaud int nChannel)
{
// int i;
if(nMainClk == 0)
nMainClk = PCLK;
switch (nChannel)
{
case UART0:
UFCON0 = 0x0; //UART channel 0 FIFO control register FIFO disable
UMCON0 = 0x0; //UART chaneel 0 MODEM control register AFC disable
ULCON0 = 0x3; //Line control register : NormalNo parity1 stop8 bits
// [10] [9] [8] [7] [6] [5] [4] [3:2] [1:0]
// Clock Sel Tx Int Rx Int Rx Time Out Rx err Loop-back Send break Transmit Mode Receive Mode
// 0 1 0 0 1 0 0 01 01
// PCLK Level Pulse Disable Generate Normal Normal Interrupt or Polling
UCON0 = 0x245; // Control register
// rUBRDIV0=( (int)(nMainClk/16./nBaud) -1 ); // Baud rate divisior register 0
UBRDIV0=( (int)(nMainClk/16./nBaud+0.5) -1 ); // Baud rate divisior register 0
break;
case UART1:
UFCON1 = 0x0; //UART channel 1 FIFO control register FIFO disable
UMCON1 = 0x0; //UART chaneel 1 MODEM control register AFC disable
ULCON1 = 0x3;
UCON1 = 0x245;
UBRDIV1=( (int)(nMainClk/16./nBaud) -1 );
break;
default:
break;
}
// for(i=0;i<100;i++);
// delay(400);
}
void uart_sendbyte(unsigned char nData)
{
UTXH0 = nData;
while(!(UTRSTAT0 & 0x2));
}
/*********************************************************************************************
* name: uart_sendstring
* func: Send string to uart channel
* para: pString -- input string
* ret: none
* modify:
* comment:
*********************************************************************************************/
void uart_sendstring(char *pString)
{
while(*pString != ‘\0‘)
uart_sendbyte(*pString++);
}
void uart_printf(char *fmt)
{
uart_sendstring(fmt);
}
int main()
{
unsigned int data = 0;
unsigned char bit4bit3bit2bit1;
unsigned int temp = 0;
WTCON = 0; //禁止看门狗 防止reset
CLKDIVN = (1<<1) | 1; //设置 1:2:4
MPLLCON = (0xa1<<12) | (0x3<<4
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 21340 2011-11-07 17:30 example\adc\adc.axf
文件 4262 2011-11-08 11:51 example\adc\adc.c
文件 13530 2011-11-07 17:30 example\adc\adc.crf
文件 56 2011-11-07 17:30 example\adc\adc.d
文件 14406 2011-11-07 17:30 example\adc\adc.hex
文件 26156 2011-11-07 17:30 example\adc\adc.htm
文件 239 2011-11-07 17:30 example\adc\adc.lnp
文件 61394 2011-11-07 17:30 example\adc\adc.map
文件 31040 2011-11-07 17:30 example\adc\adc.o
文件 537 2011-04-23 16:51 example\adc\adc.sct
文件 864 2011-11-07 17:30 example\adc\adc.tra
....... 135098 2011-11-09 15:45 example\adc\adc.uvgui.Administrator
....... 135099 2011-11-08 11:51 example\adc\adc.uvgui_Administrator.bak
....... 7293 2011-11-09 15:45 example\adc\adc.uvopt
....... 14432 2011-11-07 17:30 example\adc\adc.uvproj
文件 471 2011-11-09 20:14 example\adc\adc_Target 1.dep
....... 7289 2011-11-08 11:51 example\adc\adc_uvopt.bak
....... 14432 2011-09-16 10:52 example\adc\adc_uvproj.bak
文件 24 2011-11-07 17:30 example\adc\S3C2410A.d
文件 129623 2011-11-07 17:30 example\adc\S3C2410A.lst
文件 3512 2011-11-07 17:30 example\adc\S3C2410A.o
文件 52190 2011-09-27 13:47 example\adc\S3C2410A.s
文件 19568 2011-11-08 16:14 example\button-int\button-int.axf
文件 12471 2011-11-08 16:14 example\button-int\button-int.hex
文件 23819 2011-11-08 16:14 example\button-int\button-int.htm
文件 260 2011-11-08 16:14 example\button-int\button-int.lnp
文件 55436 2011-11-08 16:14 example\button-int\button-int.map
文件 199 2011-11-08 21:40 example\button-int\button-int.plg
文件 537 2011-04-23 15:49 example\button-int\button-int.sct
文件 920 2011-11-08 16:14 example\button-int\button-int.tra
............此处省略314个文件信息
相关资源
- Learning Linux Binary Analysis
- 蓝牙源代码应用于LINUX
- IAR For ARM 7.3最新注册机
- 郭天祥ARM9视频教程
- IAR ARM 7.8破解
- IAR For ARM V5.5 注册机
- IAR for ARM 7.40 破解
- IAR For ARM 7.4 破解
- uboot到linux logo显示不间断 补丁
- UNIX/LINUX编程实践教程的源码
- Linux任务管理器
- linux应用层的华容道游戏源代码
- ubuntu9.10 可加载内核模块和字符设备驱
- arm触摸屏与LCD校准程序三点校准法
- MP3文件ID3v2ID3v2APEv2标签读取
- ARM嵌入式项目实战
- 操作系统实验——虚存管理实验
- linux下的发包工具sendip
- 尚观培训linux许巍关于c 的笔记和讲义
- 尚观培训linux董亮老师关于数据结构的
- linux 线程池源码 c 版
- linux C 电梯程序练习
- linux下用多进程同步方法解决生产者
- 基于ARM蓝牙传输源程序
- 电梯模拟程序C/C 算法实现
- Linux 操作系统实验(全)
- Linux From Scratch 中文手册
- USB 驱动 让电脑与arm进行通信
- linux 网络实验 ftp程序
- Linux命令大全离线版&在线版
评论
共有 条评论