mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 01:05:54 +08:00
Merged in raiden00/nuttx_l0f0 (pull request #848)
Fixes for MFRC522 drivers/contactless/mfrc522.c: in mfrc522_read uid.sak must be different from 0x04 not as before from 0x00. SAK == 0x00 is a valid PICC type drivers/contactless/mfrc522.c: add interface to read MIFARE Ultralight data configs/nucleo-l073rz: add mfrc522 support Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
@@ -64,10 +64,45 @@
|
||||
#define PN532IOC_READ_TAG_DATA _CLIOC(0x000a)
|
||||
#define PN532IOC_WRITE_TAG_DATA _CLIOC(0x000b)
|
||||
|
||||
/* Contactless common IOCTL Commands ****************************************/
|
||||
|
||||
#define CLIOC_READ_MIFARE_DATA _CLIOC(0x000c)
|
||||
#define CLIOC_WRITE_MIFARE_DATA _CLIOC(0x000d)
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
struct picc_uid_s
|
||||
{
|
||||
uint8_t size; /* Number of bytes in the UID. 4, 7 or 10 */
|
||||
uint8_t uid_data[10];
|
||||
uint8_t sak; /* The SAK (Select Acknowledge) return by the PICC */
|
||||
};
|
||||
|
||||
/* Coding of Select Acknowledge (SAK) according to:
|
||||
* http://www.nxp.com/documents/application_note/AN10833.pdf
|
||||
*/
|
||||
|
||||
enum picc_cardid_e
|
||||
{
|
||||
PICC_TYPE_NOT_COMPLETE = 0x04, /* UID not complete */
|
||||
PICC_TYPE_ISO_14443_4 = 0x20, /* PICC compliant with ISO/IEC 14443-4 */
|
||||
PICC_TYPE_ISO_18092 = 0x40, /* PICC compliant with ISO/IEC 18092 (NFC) */
|
||||
PICC_TYPE_MIFARE_MINI = 0x09,
|
||||
PICC_TYPE_MIFARE_1K = 0x08,
|
||||
PICC_TYPE_MIFARE_4K = 0x18,
|
||||
PICC_TYPE_MIFARE_UL = 0x00,
|
||||
PICC_TYPE_MIFARE_PLUS = 0x11,
|
||||
PICC_TYPE_TNP3XXX = 0x01
|
||||
};
|
||||
|
||||
struct mifare_tag_data_s
|
||||
{
|
||||
uint8_t data[16];
|
||||
uint8_t address;
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
@@ -67,13 +67,6 @@ enum mfrc522_state_e
|
||||
|
||||
struct mfrc522_dev_s;
|
||||
|
||||
struct picc_uid_s
|
||||
{
|
||||
uint8_t size; /* Number of bytes in the UID. 4, 7 or 10 */
|
||||
uint8_t uid_data[10];
|
||||
uint8_t sak; /* The SAK (Select Acknowledge) return by the PICC */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user