久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费
標題:
MSP430開發TFR7979讀卡器源程序
[打印本頁]
作者:
小小菜菜
時間:
2019-4-22 14:48
標題:
MSP430開發TFR7979讀卡器源程序
親測試可以用。支持14443a、15693、nfc。
0.png
(11.52 KB, 下載次數: 118)
下載附件
2019-4-22 21:39 上傳
單片機源程序如下:
//===============================================================
// Program with hardware USART and paralel communication ;
// interface with TRF reader chip. ;
// ;
// PORT4.0 - 4.7 - (IO0-IO7) for parallel interface ;
// with reader chip ;
// PORT3.0 - PORT3.3 - USCI_B0 ---> SPI interface with reader ;
// PORT3.4 - PORT3.5 - USCI_A0 ---> USB/UART control signals ;
// PORT2.1 - IRQ ;
// PORT3.3 - DATA_CLK ;
// PORT1.7 - PORT1.3 - signaling LEDs ;
// PORT1.0 - TRF Enable ;
//===============================================================
//#include <MSP430x23x0.h> // prozessor spezific header
#include <stdlib.h> // general purpose standard library
#include <stdio.h> // standard input/output header
#include "host.h"
#include "iso14443a.h"
#include "iso14443b.h"
#include "iso15693.h"
#include "felica.h"
#include "mcu.h"
#include "trf797x.h"
#include "types.h"
#include "uart.h"
//===============================================================
u08_t buf[300];
u08_t enable = 0;
u08_t i_reg = 0x01; // interrupt register
u08_t irq_flag = 0x00;
u08_t rx_error_flag = 0x00;
s08_t rxtx_state = 1; // used for transmit recieve byte count
s16_t nfc_state;
u08_t remote_flag = 0;
u08_t stand_alone_flag = 1;
u08_t reader_mode = 0x00; // determines how interrups will be handled
//===============================================================
//
//===============================================================
void main (void) {
// settings
WDTCTL = WDTPW + WDTHOLD; // stop watchdog timer
#ifdef ENABLE_HOST
UartSetup(); // settings for UART
#endif
ENABLE_SET; // P1.0 is switched in output direction
TRF_ENABLE;
McuDelayMillisecond(1); // wait until system clock started
Trf797xCommunicationSetup(); // settings for communication with TRF
Trf797xInitialSettings(); // Set MCU Clock Frequency to 6.78 MHz and OOK Modulation
// Now switch from DCO to external 6.78 MHz clock
McuOscSel(0x00); // set the oscillator
McuDelayMillisecond(10);
// Re-configure the USART with this external clock
Trf797xReConfig();
ENABLE_INTERRUPTS; // General enable interrupts
LED_POWER_ON; // board ist powered, green LED
OOK_DIR_IN; // set OOK port tristate
enable = 1; // indicates, that setting are done
reader_mode = 0x00;
stand_alone_flag = 1; // stand alone mode
remote_flag = 0; // host is not activ
// settings done
while(1) // infinite loop
{
#if TRIGGER // in Mcu.h
LED_OPEN1_ON;
McuDelayMillisecond(1);
LED_OPEN1_OFF;
#endif
if(remote_flag == 1) // if in remote mode
{ // remote mode can be disabled in host.h
#ifdef ENABLE_HOST
buf[4] = 0xff; // "TRF7960 EVM" message in GUI
HostCommands(); // device works according host commands
#endif
}
else
{
#ifdef ENABLE15693 // this standard can be disabled in ISO15693.h
Iso15693FindTag(); // detects ISO15693 in stand-alone mode
#endif
if(remote_flag == 0)
{
#ifdef ENABLE14443A // this standard can be disabled in ISO14443A.h
Iso14443aFindTag(); // detects ISO14443A in stand-alone mode
#endif
}
if(remote_flag == 0)
{
#ifdef ENABLE14443B // this standard can be disabled in ISO14443B.h
Iso14443bFindTag(); // detects ISO14443B in stand-alone mode
#endif
}
if(remote_flag == 0)
{
#ifdef ENABLE_FELICA // this standard can be disabled in felica.h
FindFelica(); // detects FeliCa in stand-alone mode
#endif
}
}
}
}
復制代碼
所有資料51hei提供下載:
下位機程序_原廠_CCS4環境.zip
(223.63 KB, 下載次數: 5)
2019-4-22 14:48 上傳
點擊文件名下載附件
下載積分: 黑幣 -5
歡迎光臨 (http://m.zg4o1577.cn/bbs/)
Powered by Discuz! X3.1
主站蜘蛛池模板:
青青久草
|
欧美日韩精品久久久免费观看
|
性av在线
|
国产香蕉av
|
综合伊人
|
国产91热爆ts人妖系列
|
国产麻豆一区二区
|
激情久久久久
|
日韩欧美一级
|
成人免费视频视频
|
一区二区三区在线播放
|
又色又爽又黄18网站
|
国产性猛交96
|
欧美成人免费在线视频
|
日本不卡视频
|
一区二区国产精品
|
午夜两性
|
啪啪网站免费
|
九九久久免费视频
|
视频一区二区三区在线观看
|
久久99热这里只频精品6学生
|
黄视频在线播放
|
四虎wz
|
网站毛片
|
日韩精品片
|
日本免费一级片
|
极品淫少妇
|
日韩黄色录像
|
黄色一级视频在线观看
|
久久九九免费视频
|
国产一级在线视频
|
俺去俺来也在线www色官网
|
成人黄色小视频
|
国产免费成人
|
日日爱影视
|
18视频在线观看男男
|
欧美日韩在线播放
|
久久久婷婷
|
www.青青草
|
高清一级片
|
在线播放中文字幕
|