Nnfc-linux-drF
所属分类:单片机开发
开发工具:Visual C++
文件大小:407KB
下载次数:10
上传日期:2012-09-15 14:33:49
上 传 者:
zheessence
说明: NFC 讀卡機 (NXP PNN531)驅動程式 碼與範例程式
(NFC card reader (NXP PNN531) driver code and example programs)
文件列表:
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\.cvsignore (77, 2009-05-31)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\.project (209, 2009-05-30)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\aclocal.m4 (34012, 2009-06-03)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\AUTHORS (0, 2009-06-02)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\ChangeLog (448, 2009-06-02)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\compile (3707, 2009-06-02)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\config.guess (44892, 2009-06-02)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\config.h (2834, 2009-06-03)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\config.h.in (2569, 2009-06-03)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\config.sub (33387, 2009-06-02)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\configure (582561, 2009-06-03)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\configure.ac (1146, 2009-06-02)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\COPYING (35147, 2009-06-02)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\CVS\Entries (1008, 2009-06-08)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\CVS\Repository (17, 2009-06-02)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\CVS\Root (44, 2009-06-02)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\CVS\Template (0, 2009-06-02)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\depcomp (17867, 2009-06-02)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\include\CVS\Entries (172, 2009-06-08)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\include\CVS\Repository (25, 2009-06-02)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\include\CVS\Root (44, 2009-06-02)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\include\felica_bridge.h (2306, 2009-06-02)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\include\mifare.h (3697, 2009-06-07)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\include\nfclib.h (1295, 2009-06-02)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\include\nfc_dev.h (1690, 2009-06-02)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\INSTALL (1154, 2009-06-07)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\install-sh (5585, 2009-06-02)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\libtool (263760, 2009-06-27)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\ltmain.sh (243454, 2009-06-02)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\m4\CVS\Entries (223, 2009-06-02)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\m4\CVS\Repository (20, 2009-06-02)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\m4\CVS\Root (44, 2009-06-02)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\m4\libtool.m4 (260278, 2009-06-02)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\m4\ltoptions.m4 (11938, 2009-06-02)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\m4\ltsugar.m4 (4372, 2009-06-02)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\m4\ltversion.m4 (701, 2009-06-02)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\m4\lt~obsolete.m4 (5707, 2009-06-02)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\Makefile (20543, 2009-06-27)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\Makefile.am (70, 2009-06-02)
Nnfc-linux-drF\nfc-linux-driver_0.0.6.pl2\Makefile.in (20005, 2009-06-07)
... ...
==================================
NFC kernel driver and libraries
==================================
Supported devices
~~~~~~~~~~~~~~~~~~
I-O data / USB2-NFC
Sony / RC-S330
It may also works with the other IC Card Reader/Writer based on Pn53x Chip.
Supported OS
~~~~~~~~~~~~~
Linux(kernel 2.6.27 or later).
If you use driver on <=2.6.26 kernel, uncomment this.
#EXTRA_CFLAGS += -D__2_6_26
I test only ubuntu 9.04(2.6.28) and slamd***(2.6.26).
Compile and Install
~~~~~~~~~~~~~~~~~~~~
See "INSTALL"
Use driver
~~~~~~~~~~
If the driver find the device, it creates “/dev/nfc*” as a character device.
Example program:
int fd, rc, read_bytes;
/* FeliCa polling*/
unsigned char txbuf[9] = { 0xD4, 0x4A, 0x01, 0x01, 0x00, 0xFF, 0XFF, 0x01, 0x00 };
unsigned char rxbuf[256];
/* open Nfc device */
fd = open(“/dev/nfc0”, O_RDWR);
/* send poll request */
rc = write(fd, &txbuf[0], 9);
if(rc < 0) return;
/* recv the response */
read_bytes = read(fd, rxbuf, 256);
Available driver functions are open(),write(),read(),close(),ioctl().
write() and read() functions send or receive hardware specific commands.
ioctl() Functions:
Parameters are into following 'nfc_io_params' structure.
struct nfc_io_params {
/* parameters */
int send_length; /* length of message sequence to send to device */
unsigned char *send_buffer; /* pointer to message sequence to send to device */
int proto; /* protocol type for list_passive_target */
int num_target; /* target number for data_exchange */
/* return values (currently unused) */
int recv_bufsiz; /* recv buffer siz e */
unsigned char *recv_buffer; /* pointer to store receive message sequence */
int recv_length; /* length of receive message sequence */
int retval; /* extra return value */
};
Available ioctl() Commands
NFC_IOCTL_POWER_ON
No Parameters
If function failed, retruns a negative value, otherwise success.
NFC_IOCTL_POWER_OFF
No Parameters
If function failed, retruns a negative value, otherwise success.
NFC_IOCTL_IN_LIST_PASSIVE_TARGET
--Parameters--
Send length
Send buffer
Protocol
--return value--
If function failed, retruns a negative value. otherwise success.
To read the response from target, use read() function.
The offset to read be set to a byte before protocol specific data.
(it expected to be the target number)
NFC_IOCTL_IN_DATA_EXCHANGE
Parameters
Send length
Send buffer
Protocol
Target Number
--return value--
If function failed, retruns a negative value.otherwise success.
To read the response from target, use read() function.
The offset to read be set to a byte before protocol specific data.
(it expected to be the device specific response code)
NFC_IOCTL_SELECT,NFC_IOCTL_DESELECT
Parameters
Target Number
--return value--
If function failed, retruns a negative value,otherwise success.
===============
Libraries
===============
Nfc functions
~~~~~~~~~~~~~
Basically, functions wrap driver ioctl().
近期下载者:
相关文件:
收藏者: