📄 main_ic_card.c
字号:
/*
*********************************************************
* Copyright (c)
* All rights reserved.
*
* 文件名称:main_gps.c
* 文件标识:程序实现体
* 摘 要:本文件是对液晶板上的LED数据管和键盘进行的测试
*
* 当前版本:1.0
* 作 者:冯富秋
* 完成日期:2006.9.2
*
* 取代版本:
* 作 者:
* 完成日期:
*********************************************************
*/
#define GLOBAL_CLK 1
/*
*********************************************************
* 头文件
*********************************************************
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "def.h"
#include "option.h"
#include "2440addr.h"
#include "2440lib.h"
extern void IcCard_Read(void);
extern void IcCard_Write(void);
/*
*********************************************************
* 常量
*********************************************************
*/
/*
*********************************************************
* 变量
*********************************************************
*/
void * func_uart_test[][2]=
{
//iic
(void *)IcCard_Read, "Read string from Ic Card ",
(void *)IcCard_Write, "Write string to Ic Card ",
0,0
};
/*
*********************************************************
* 函数介绍:本函数被使用来做测试IIC EPROM的功能。
* 输入参数:无
* 输出参数:无
* 返回值 :无
*********************************************************
*/
void Main(void)
{
int i;
U8 key;
U32 mpll_val = 0 ;
Port_Init(); //端口初始化
Isr_Init(); //中断初始化
key = 14;
mpll_val = (92<<12)|(1<<4)|(1);
//init FCLK=400M, so change MPLL first
ChangeMPllValue((mpll_val>>12)&0xff, (mpll_val>>4)&0x3f, mpll_val&3);
ChangeClockDivider(key, 12);
cal_cpu_bus_clk();
Uart_Init(0,0,115200); //串口初始化 波特率为115200
Uart_Select(0); //选者串口0
Clk0_Disable();
Clk1_Disable();
while(1)
{
i=0;
Uart_Printf("\n\n");
while(1)
{ //display menu
Uart_Printf("%2d:%s",i,func_uart_test[i][1]);
i++;
if((int)(func_uart_test[i][0])==0)
{
Uart_Printf("\n");
break;
}
if((i%4)==0)
Uart_Printf("\n");
}
Uart_Printf("\nPress Enter key to exit : ");
i = Uart_GetIntNum();
if(i==-1) break; // return.
if(i>=0 && i<7 ) // select and execute...
( (void (*)(void)) (func_uart_test[i][0]) )();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -