资源简介
PA1100磁头解码芯片驱动代码,支持银行卡轨道1、2、3数据,支持正反向刷卡,执行结果分别打印出磁条卡的3个轨道数据

代码片段和文件信息
/*************************************************************************************
* Copyright (c) 2009 by PROCHIP Limited.
* PROPRIETARY RIGHTS of PROCHIP Limited are involved in the subject matter of this
* material. All manufacturing reproduction use and sales rights
* pertaining to this subject matter are governed by the license agreement.
* The recipient of this software implicitly accepts the terms of the license.
*
* File Name: pa1100.c
*
* File Description: pa1100的函数文件
*
* Version Date Author
*------------------------------------------------------------------------------------
* 1.0 2012.11.15 lori
*
***************************************************************************************/
#include
#include
#include “pa1100.h“
#define time 300
U8 CardData[380];
U8 AsciiData[]={
0xff0xff‘ ‘‘!‘‘“‘‘#‘‘$‘‘%‘‘&‘‘?‘‘(‘‘)‘‘*‘‘+‘‘‘‘-‘‘.‘‘/‘
‘0‘‘1‘‘2‘‘3‘‘4‘‘5‘‘6‘‘7‘‘8‘‘9‘‘:‘‘;‘‘<‘‘=‘‘>‘‘?‘
‘@‘‘A‘‘B‘‘C‘‘D‘‘E‘‘F‘‘G‘‘H‘‘I‘‘J‘‘K‘‘L‘‘M‘‘N‘‘O‘
‘P‘‘Q‘‘R‘‘S‘‘T‘‘U‘‘V‘‘W‘‘X‘‘Y‘‘Z‘‘[‘‘\\‘‘]‘‘^‘‘_‘
‘0‘‘1‘‘2‘‘3‘‘4‘‘5‘‘6‘‘7‘‘8‘‘9‘‘:‘‘;‘‘<‘‘=‘‘>‘‘?‘};
U8 MagData[]={
0x000x800x400x010x020x430x040x450x460x070x080x490x4A0x0B0x4C0x0D0x0E
0x4F
0x100x510x520x130x540x150x160x570x580x190x1A0x5B0x1C0x5D0x5E0x1F
0x200x610x620x230x640x250x260x670x680x290x2A0x6B0x2C0x6D0x6E0x2F
0x700x310x320x730x340x750x760x370x380x790x7A0x3B0x7C0x3D0x3E0x7F
0x900x810x820x930x840x950x960x870x880x990x9A0x8B0x9C0x8D0x8E0x9F};
/*****************************************************************
函数原型:U8 Track_Data_Decode(U8 data)
入口参数:data:要译码的数据
返回参数:data:译码后的数据
函数功能:轨道数据译码
******************************************************************/
U8 Track_Data_Decode(U8 data)
{
U16 temp = 0;
data = ~data;
while(temp < 82)
{
//check table to find ASCII
if(data == MagData[temp])
{
data = AsciiData[temp];
break;
}
temp++;
}
if(temp == 82)
{
data = 0xff;
if(AsciiData != 0x00)
error = temp;
}
return data;
}
/*****************************************************************
函数原型:void Pa1100_Port_Init(void)
入口参数:无
返回参数:无
函数功能:配置IO端口
******************************************************************/
void Pa1100_Port_Init(void)
{
SET_BIT(PA1100_DATA_SEL PA1100_DATA_BIT);
CLR_BIT(PA1100_DATA_DIR PA1100_DATA_BIT);
SET_BIT(PA1100_STROBE_SEL PA1100_STROBE_BIT);
CLR_BIT(PA1100_STROBE_DIR PA1100_STROBE_BIT);
}
/*****************************************************************
函数原型:void Pa1100_Reset(void)
入口参数:无
返回参数:无
函数功能:PA1100复位
*************************************************
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 14491 2012-12-08 12:34 PA100\pa1100.c
文件 2925 2012-12-08 12:33 PA100\pa1100.h
目录 0 2013-02-19 14:19 PA100
----------- --------- ---------- ----- ----
17416 3
相关资源
- bp神经网络源代码,可直接运行
- 仿知乎界面小程序源代码
- 贪吃蛇源代码.fla
- dotnet 写字板 实验 源代码 不好请要不
- 图像二维小波变换的实现源代码
- 八三编码器设计 VHDL代码 简单,包附
- linux应用层的华容道游戏源代码
- 网上拍卖系统完整源代码
- CSMA/CD等动画演示加源代码
- silicon lab公司的收音IC SI47XX全套开发工
- 合同管理系统的源代码(附数据库)
- 用VC 编写的仿QQ聊天室程序源代码
- STM32F103 串口程序(完整版)
- VPC3_DPV1源代码,Profibus
- PB做的托盘程序(最小化后在左下角显
- 透明加密源码及说明
- 排队机叫号 源代码
- 五子棋C 源代码
- CAD LISP24个源代码
- 二叉树基本操作源代码
- 推箱子及人工智能寻路C 源代码
- opengl轮廓字体源代码
- 冈萨雷斯 数字图像处理 源代码(m文
- 直流伺服电机电路原理图(内附单片
- 哈哈冒险岛登入器源代码
- midi电子琴简单设计(附源代码).ra
- PESQ C源代码
- 画图程序MFC/VC/VC CRectTracker 串行化
- 莱卡 全站仪数据格式转换程序,有源
- HEX到Bin文件源代码
评论
共有 条评论