资源简介
基于arm开发的,纯C语言编写,通用读卡器,读磁卡,读CPU卡等代码,完全提供。
代码片段和文件信息
/*
===============================================================================
Copyright (c) SHENZHEN DECARD TECHNOLOGIES Co.LTD.
All rights reserved.
File Name : interpreter.c
Description : Interprete the data frame which come from host. And then
execute the corresponding command and return reponse frame.
Modified By : WangXu
Modified Date : 2009-12-02
Version : v1.0
Other :
===============================================================================
*/
#include “config.h“
#include “string.h“
#include “system.h“
#include “beep.h“
#include “magtek.h“
#include “mf.h“
#include “lcd.h“
#include “fram.h“
#include “flash.h“
#include “cpu.h“
#include “key_led.h“
#include “rtc.h“
#include “usb.h“
#include “function.h“
#include “iap.h“
#include “interpreter.h“
# define PKG_BY_ME 0x00
# define INTER_DEBUG(a) {}
unsigned char ucAcessFirst=0x01;
static const unsigned char g_ucCmdTbl[] =
{
0x10
0x11
0x12
0x13
0x14
0x15
0x00
0x01
0x02
0x03
0x04
0x40
0x70
0x71
0x73
0x74
0x75
0xa0
0xa1
0xa2
0xa3
0xa8
0xa9
0xaa
0xab
0xac
0xad
0xae
0xd0
0xd1
0xd2
0xd3
0xe0
0xe1
0xe2
0xe3
0xe4
0xe5
} ;
# define CMD_TBL_LEN (sizeof(g_ucCmdTbl)/sizeof(unsigned char))
/**
* Update time on the LCD display.
* The time format on LCD display is:20xx年xx月xx日only ‘xx‘ filed is needed to updated
* other filed is fixed forever.
*/
void updataDispTime (void)
{
char pucYear[3] = {0x00} ;
char pucMon[3] = {0x00} ;
char pucDate[3] = {0x00} ;
rtc_get_time() ;
pucYear[0] = rtc_time.year[0] ;
pucYear[1] = rtc_time.year[1] ;
pucYear[2] = ‘\0‘ ;
pucMon[0] = rtc_time.month[0] ;
pucMon[1] = rtc_time.month[1] ;
pucMon[2] = ‘\0‘ ;
pucDate[0] = rtc_time.date[0] ;
pucDate[1] = rtc_time.date[1] ;
pucDate[2] = ‘\0‘ ;
lcd_disp(1 1“20“) ;
lcd_disp(1 3pucYear) ;
lcd_disp(1 5“年“) ;
lcd_disp(1 7pucMon) ;
lcd_disp(1 9“月“) ;
lcd_disp(1 11pucDate) ;
lcd_disp(1 13“日“) ;
}
static unsigned int
bytes2Int (unsigned char *pucBytes)
{
unsigned int uiLen ;
uiLen = (uint)(pucBytes[0]<<24) + (uint)(pucBytes[1]<<16)
+ (uint)(pucBytes[2]<<8) + (uint)(pucBytes[3]);
return (uiLen) ;
}
static void
int2Bytes (unsigned int uiInt unsigned char *pucBytes)
{
pucBytes[0] = uiInt>>24 ;
pucBytes[1] = uiInt>>16 ;
pucBytes[2] = uiInt>>8 ;
pucBytes[3] = uiInt ;
}
/**
* Check whether a command is existed in command table.
*
* @param ucCmdTbl point to commamd table.
* @param uiLen is the length of command table.
* @param ucCmd is the command that will be found in command table.
* @return 0x01 if existor 0x00.
*/
static unsigned char
checkCmd (c 属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1444 2009-10-13 10:24 Z9_USB\beep.h
文件 4247 2010-01-18 17:08 Z9_USB\config.h
文件 11343 2009-11-27 15:13 Z9_USB\cpu.h
文件 14873 2010-01-11 16:44 Z9_USB\Debug_in_ChipFLASH\beep.crf
文件 255 2010-01-11 16:44 Z9_USB\Debug_in_ChipFLASH\beep.d
文件 32420 2010-01-11 16:44 Z9_USB\Debug_in_ChipFLASH\beep.o
文件 40760 2009-11-26 20:23 Z9_USB\Debug_in_ChipFLASH\chap_9.crf
文件 0 2009-11-26 20:28 Z9_USB\Debug_in_ChipFLASH\chap_9.d
文件 221 2009-11-26 20:28 Z9_USB\Debug_in_ChipFLASH\chap_9.__i
文件 51005 2010-01-11 16:44 Z9_USB\Debug_in_ChipFLASH\cpu.crf
文件 390 2010-01-11 16:44 Z9_USB\Debug_in_ChipFLASH\cpu.d
文件 101948 2010-01-11 16:44 Z9_USB\Debug_in_ChipFLASH\cpu.o
文件 18323 2010-01-11 16:44 Z9_USB\Debug_in_ChipFLASH\des.crf
文件 265 2010-01-11 16:44 Z9_USB\Debug_in_ChipFLASH\des.d
文件 40792 2010-01-11 16:44 Z9_USB\Debug_in_ChipFLASH\des.o
文件 20497 2009-11-26 20:23 Z9_USB\Debug_in_ChipFLASH\desc
文件 282 2009-11-26 20:23 Z9_USB\Debug_in_ChipFLASH\desc
文件 36700 2009-11-26 20:23 Z9_USB\Debug_in_ChipFLASH\desc
文件 19421 2010-01-11 16:44 Z9_USB\Debug_in_ChipFLASH\flash.crf
文件 263 2010-01-11 16:44 Z9_USB\Debug_in_ChipFLASH\flash.d
文件 42120 2010-01-11 16:44 Z9_USB\Debug_in_ChipFLASH\flash.o
文件 18849 2010-01-11 16:44 Z9_USB\Debug_in_ChipFLASH\fram.crf
文件 255 2010-01-11 16:44 Z9_USB\Debug_in_ChipFLASH\fram.d
文件 40480 2010-01-11 16:44 Z9_USB\Debug_in_ChipFLASH\fram.o
文件 15230 2010-01-11 16:44 Z9_USB\Debug_in_ChipFLASH\function.crf
文件 240 2010-01-11 16:44 Z9_USB\Debug_in_ChipFLASH\function.d
文件 35608 2010-01-11 16:44 Z9_USB\Debug_in_ChipFLASH\function.o
文件 16115 2010-01-11 16:44 Z9_USB\Debug_in_ChipFLASH\i2cint.crf
文件 226 2010-01-11 16:44 Z9_USB\Debug_in_ChipFLASH\i2cint.d
文件 36884 2010-01-11 16:44 Z9_USB\Debug_in_ChipFLASH\i2cint.o
............此处省略244个文件信息
- 上一篇:数据结构 考研复习笔记
- 下一篇:番茄助手vc++6.0+破解版
相关资源
- ARMV7 NEON汇编指令详解中文版
- 国际象棋的qt源代码
- C语言开发实战宝典
- 小甲鱼C语言课件 源代码
- c语言看发的网络协议 ,源代码
- C语言实现的DES对称加密算法
- 数据结构,迷宫问题C语言版源代码
- C语言 学生信息管理系统 源代码
- C语言版3D魔方游戏源代码
- QT5开发及源代码
- RFID读卡器(125KHzRFID)
- USB CAN Tool 源代码(LabVIEW 2011环境)
- 超声波水表源代码
- 一个模糊PID温度控制算法源代码
- 数据结构 图的遍历源代码
- 数据结构实验源代码集
- TCP/IP客户端和服务器端源代码,好用
- 交互式计算机图形学 第六版 OpenGL源代
- 数据结构教程李春葆第五版书中例题
- 三次样条插值类源代码!
- diy写字机grbl v1.1源代码
- C语言常用算法源代码
- 关于LED制作的源代码合集(38套)
-
STM32-ba
se64加密源代码 - 51超声波避障源代码
- 一个C++实现的源代码行数统计工具
- ZZULIOJ部分答案C语言免费.7z
- 吉他调音软件源代码
- 连连看源代码C语言版
- AVR单片机SPI通讯程序 (C语言源代码)
川公网安备 51152502000135号
评论
共有 条评论