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:
raiden00pl
2019-04-05 15:49:45 +00:00
committed by Gregory Nutt
parent 0b3375cb78
commit a234b909bc
9 changed files with 326 additions and 31 deletions
+35
View File
@@ -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
****************************************************************************/
-7
View File
@@ -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
****************************************************************************/