Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
NFC-A
[RFAL-AL]
RFAL NFC-A Module. More...
Data Structures | |
| struct | rfalNfcaSensRes |
| struct | rfalNfcaSddReq |
| struct | rfalNfcaSddRes |
| struct | rfalNfcaSelReq |
| struct | rfalNfcaSelRes |
| struct | rfalNfcaListenDevice |
Enumerations | |
| enum | rfalNfcaListenDeviceType |
Functions | |
| ReturnCode | rfalNfcaPollerInitialize (SPI *mspiChannel, ST25R3911 *mST25, DigitalOut *gpio_cs, InterruptIn *IRQ, DigitalOut *fieldLED_01, DigitalOut *fieldLED_02, DigitalOut *fieldLED_03, DigitalOut *fieldLED_04, DigitalOut *fieldLED_05, DigitalOut *fieldLED_06) |
| Initialize NFC-A Poller mode. | |
| ReturnCode | rfalNfcaPollerCheckPresence (rfal14443AShortFrameCmd cmd, rfalNfcaSensRes *sensRes, SPI *mspiChannel, ST25R3911 *mST25, DigitalOut *gpio_cs, InterruptIn *IRQ, DigitalOut *fieldLED_01, DigitalOut *fieldLED_02, DigitalOut *fieldLED_03, DigitalOut *fieldLED_04, DigitalOut *fieldLED_05, DigitalOut *fieldLED_06) |
| NFC-A Poller Check Presence. | |
| ReturnCode | rfalNfcaPollerSelect (uint8_t *nfcid1, uint8_t nfcidLen, rfalNfcaSelRes *selRes, SPI *mspiChannel, ST25R3911 *mST25, DigitalOut *gpio_cs, InterruptIn *IRQ, DigitalOut *fieldLED_01, DigitalOut *fieldLED_02, DigitalOut *fieldLED_03, DigitalOut *fieldLED_04, DigitalOut *fieldLED_05, DigitalOut *fieldLED_06) |
| NFC-A Poller Select. | |
| ReturnCode | rfalNfcaPollerSleep (SPI *mspiChannel, ST25R3911 *mST25, DigitalOut *gpio_cs, InterruptIn *IRQ, DigitalOut *fieldLED_01, DigitalOut *fieldLED_02, DigitalOut *fieldLED_03, DigitalOut *fieldLED_04, DigitalOut *fieldLED_05, DigitalOut *fieldLED_06) |
| NFC-A Poller Sleep. | |
| ReturnCode | rfalNfcaPollerTechnologyDetection (rfalComplianceMode compMode, rfalNfcaSensRes *sensRes, SPI *mspiChannel, ST25R3911 *mST25, DigitalOut *gpio_cs, InterruptIn *IRQ, DigitalOut *fieldLED_01, DigitalOut *fieldLED_02, DigitalOut *fieldLED_03, DigitalOut *fieldLED_04, DigitalOut *fieldLED_05, DigitalOut *fieldLED_06) |
| NFC-A Technology Detection. | |
| ReturnCode | rfalNfcaPollerSingleCollisionResolution (uint8_t devLimit, bool *collPending, rfalNfcaSelRes *selRes, uint8_t *nfcId1, uint8_t *nfcId1Len, SPI *mspiChannel, ST25R3911 *mST25, DigitalOut *gpio_cs, InterruptIn *IRQ, DigitalOut *fieldLED_01, DigitalOut *fieldLED_02, DigitalOut *fieldLED_03, DigitalOut *fieldLED_04, DigitalOut *fieldLED_05, DigitalOut *fieldLED_06) |
| NFC-A Poller Collision Resolution. | |
| ReturnCode | rfalNfcaPollerFullCollisionResolution (rfalComplianceMode compMode, uint8_t devLimit, rfalNfcaListenDevice *nfcaDevList, uint8_t *devCnt, SPI *mspiChannel, ST25R3911 *mST25, DigitalOut *gpio_cs, InterruptIn *IRQ, DigitalOut *fieldLED_01, DigitalOut *fieldLED_02, DigitalOut *fieldLED_03, DigitalOut *fieldLED_04, DigitalOut *fieldLED_05, DigitalOut *fieldLED_06) |
| NFC-A Poller Full Collision Resolution. | |
| bool | rfalNfcaListenerIsSleepReq (uint8_t *buf, uint16_t bufLen) |
| NFC-A Listener is SLP_REQ. | |
Detailed Description
RFAL NFC-A Module.
Enumeration Type Documentation
NFC-A Listen device types
Definition at line 124 of file rfal_nfca.h.
Function Documentation
| bool rfalNfcaListenerIsSleepReq | ( | uint8_t * | buf, |
| uint16_t | bufLen | ||
| ) |
NFC-A Listener is SLP_REQ.
Checks if the given buffer contains valid NFC-A SLP_REQ (HALT)
- Parameters:
-
[in] buf,: buffer containing data [in] bufLen,: length of the data in buffer to be checked
- Returns:
- true if data in buf contains a SLP_REQ ; false otherwise
Definition at line 544 of file rfal_nfca.cpp.
| ReturnCode rfalNfcaPollerCheckPresence | ( | rfal14443AShortFrameCmd | cmd, |
| rfalNfcaSensRes * | sensRes, | ||
| SPI * | mspiChannel, | ||
| ST25R3911 * | mST25, | ||
| DigitalOut * | gpio_cs, | ||
| InterruptIn * | IRQ, | ||
| DigitalOut * | fieldLED_01, | ||
| DigitalOut * | fieldLED_02, | ||
| DigitalOut * | fieldLED_03, | ||
| DigitalOut * | fieldLED_04, | ||
| DigitalOut * | fieldLED_05, | ||
| DigitalOut * | fieldLED_06 | ||
| ) |
NFC-A Poller Check Presence.
This method checks if a NFC-A Listen device (PICC) is present on the field by sending an ALL_REQ (WUPA) or SENS_REQ (REQA)
- Parameters:
-
[in] cmd : Indicate if to send an ALL_REQ or a SENS_REQ [out] sensRes : If received, the SENS_RES
- Returns:
- ERR_WRONG_STATE : RFAL not initialized or incorrect mode
- ERR_PARAM : Invalid parameters
- ERR_IO : Generic internal error
- ERR_RF_COLLISION : Collision detected one or more device in the field
- ERR_PAR : Parity error detected, one or more device in the field
- ERR_CRC : CRC error detected, one or more device in the field
- ERR_FRAMING : Framing error detected, one or more device in the field
- ERR_PROTO : Protocol error detected, one or more device in the field
- ERR_TIMEOUT : Timeout error, no listener device detected
- ERR_NONE : No error, one or more device in the field
Definition at line 186 of file rfal_nfca.cpp.
| ReturnCode rfalNfcaPollerFullCollisionResolution | ( | rfalComplianceMode | compMode, |
| uint8_t | devLimit, | ||
| rfalNfcaListenDevice * | nfcaDevList, | ||
| uint8_t * | devCnt, | ||
| SPI * | mspiChannel, | ||
| ST25R3911 * | mST25, | ||
| DigitalOut * | gpio_cs, | ||
| InterruptIn * | IRQ, | ||
| DigitalOut * | fieldLED_01, | ||
| DigitalOut * | fieldLED_02, | ||
| DigitalOut * | fieldLED_03, | ||
| DigitalOut * | fieldLED_04, | ||
| DigitalOut * | fieldLED_05, | ||
| DigitalOut * | fieldLED_06 | ||
| ) |
NFC-A Poller Full Collision Resolution.
Performs a full Collision resolution as defined in Activity 1.0 or 1.1 9.3.4
- Parameters:
-
[in] compMode : compliance mode to be performed [in] devLimit : device limit value, and size nfcaDevList [out] nfcaDevList : NFC-A listener device info [out] devCnt : Devices found counter
When compMode is set to ISO compliance it assumes that the device is not sleeping and therefore no ALL_REQ (WUPA) is sent at the beginning.
When compMode is set to NFC compliance an additional ALL_REQ (WUPA) is sent at the beginning and a proprietary behaviour also takes place. Once a device has been resolved an additional SLP_REQ (HLTA) is sent regardless if there was a collision (except if the number of devices found already equals the limit). This proprietary behaviour ensures proper activation of certain devices that suffer from influence of Type B commands as foreseen in ISO14443-3 5.2.3
When devLimit = 0 it is configured to perform collision detection only. Once a collision is detected the collision resolution is aborted immidiatly. If only one device is found with no collisions, it will properly resolved.
- Returns:
- ERR_WRONG_STATE : RFAL not initialized or mode not set
- ERR_PARAM : Invalid parameters
- ERR_IO : Generic internal error
- ERR_NONE : No error
Definition at line 354 of file rfal_nfca.cpp.
| ReturnCode rfalNfcaPollerInitialize | ( | SPI * | mspiChannel, |
| ST25R3911 * | mST25, | ||
| DigitalOut * | gpio_cs, | ||
| InterruptIn * | IRQ, | ||
| DigitalOut * | fieldLED_01, | ||
| DigitalOut * | fieldLED_02, | ||
| DigitalOut * | fieldLED_03, | ||
| DigitalOut * | fieldLED_04, | ||
| DigitalOut * | fieldLED_05, | ||
| DigitalOut * | fieldLED_06 | ||
| ) |
Initialize NFC-A Poller mode.
This methods configures RFAL RF layer to perform as a NFC-A Poller/RW (ISO14443A PCD) including all default timings and bit rate to 106 kbps
- Returns:
- ERR_WRONG_STATE : RFAL not initialized or mode not set
- ERR_NONE : No error
Definition at line 170 of file rfal_nfca.cpp.
| ReturnCode rfalNfcaPollerSelect | ( | uint8_t * | nfcid1, |
| uint8_t | nfcidLen, | ||
| rfalNfcaSelRes * | selRes, | ||
| SPI * | mspiChannel, | ||
| ST25R3911 * | mST25, | ||
| DigitalOut * | gpio_cs, | ||
| InterruptIn * | IRQ, | ||
| DigitalOut * | fieldLED_01, | ||
| DigitalOut * | fieldLED_02, | ||
| DigitalOut * | fieldLED_03, | ||
| DigitalOut * | fieldLED_04, | ||
| DigitalOut * | fieldLED_05, | ||
| DigitalOut * | fieldLED_06 | ||
| ) |
NFC-A Poller Select.
This method selects a NFC-A Listener device (PICC)
- Parameters:
-
[in] nfcid1 : Listener device NFCID1 to be selected [in] nfcidLen : Length of the NFCID1 to be selected [out] selRes : pointer to place the SEL_RES
- Returns:
- ERR_WRONG_STATE : RFAL not initialized or incorrect mode
- ERR_PARAM : Invalid parameters
- ERR_IO : Generic internal error
- ERR_TIMEOUT : Timeout error
- ERR_PAR : Parity error detected
- ERR_CRC : CRC error detected
- ERR_FRAMING : Framing error detected
- ERR_PROTO : Protocol error detected
- ERR_NONE : No error, SEL_RES received
Definition at line 463 of file rfal_nfca.cpp.
| ReturnCode rfalNfcaPollerSingleCollisionResolution | ( | uint8_t | devLimit, |
| bool * | collPending, | ||
| rfalNfcaSelRes * | selRes, | ||
| uint8_t * | nfcId1, | ||
| uint8_t * | nfcId1Len, | ||
| SPI * | mspiChannel, | ||
| ST25R3911 * | mST25, | ||
| DigitalOut * | gpio_cs, | ||
| InterruptIn * | IRQ, | ||
| DigitalOut * | fieldLED_01, | ||
| DigitalOut * | fieldLED_02, | ||
| DigitalOut * | fieldLED_03, | ||
| DigitalOut * | fieldLED_04, | ||
| DigitalOut * | fieldLED_05, | ||
| DigitalOut * | fieldLED_06 | ||
| ) |
NFC-A Poller Collision Resolution.
Collision resolution for one NFC-A Listener device/card (PICC) as defined in Activity 1.1 9.3.4
This method executes anti collision loop and select the device with higher NFCID1
When devLimit = 0 it is configured to perform collision detection only. Once a collision is detected the collision resolution is aborted immidiatly. If only one device is found with no collisions, it will properly resolved.
- Parameters:
-
[in] devLimit : device limit value (CON_DEVICES_LIMIT) [out] collPending : pointer to collision pending flag (INT_COLL_PEND) [out] selRes : location to store the last Select Response from listener device (PICC) [out] nfcId1 : location to store the NFCID1 (UID), ensure RFAL_NFCA_CASCADE_3_UID_LEN [out] nfcId1Len : pointer to length of NFCID1 (UID)
- Returns:
- ERR_WRONG_STATE : RFAL not initialized or mode not set
- ERR_PARAM : Invalid parameters
- ERR_IO : Generic internal error
- ERR_PROTO : Card length invalid
- ERR_IGNORE : conDevLimit is 0 and there is a collision
- ERR_NONE : No error
Definition at line 221 of file rfal_nfca.cpp.
| ReturnCode rfalNfcaPollerSleep | ( | SPI * | mspiChannel, |
| ST25R3911 * | mST25, | ||
| DigitalOut * | gpio_cs, | ||
| InterruptIn * | IRQ, | ||
| DigitalOut * | fieldLED_01, | ||
| DigitalOut * | fieldLED_02, | ||
| DigitalOut * | fieldLED_03, | ||
| DigitalOut * | fieldLED_04, | ||
| DigitalOut * | fieldLED_05, | ||
| DigitalOut * | fieldLED_06 | ||
| ) |
NFC-A Poller Sleep.
This method sends a SLP_REQ (HLTA) No response is expected afterwards Digital 1.1 6.9.2.1
- Returns:
- ERR_WRONG_STATE : RFAL not initialized or incorrect mode
- ERR_PARAM : Invalid parameters
- ERR_IO : Generic internal error
- ERR_NONE : No error
Definition at line 523 of file rfal_nfca.cpp.
| ReturnCode rfalNfcaPollerTechnologyDetection | ( | rfalComplianceMode | compMode, |
| rfalNfcaSensRes * | sensRes, | ||
| SPI * | mspiChannel, | ||
| ST25R3911 * | mST25, | ||
| DigitalOut * | gpio_cs, | ||
| InterruptIn * | IRQ, | ||
| DigitalOut * | fieldLED_01, | ||
| DigitalOut * | fieldLED_02, | ||
| DigitalOut * | fieldLED_03, | ||
| DigitalOut * | fieldLED_04, | ||
| DigitalOut * | fieldLED_05, | ||
| DigitalOut * | fieldLED_06 | ||
| ) |
NFC-A Technology Detection.
This method performs NFC-A Technology Detection as defined in the spec given in the compliance mode
- Parameters:
-
[in] compMode : compliance mode to be performed [out] sensRes : location to store the SENS_RES, if received
When compMode is set to ISO compliance a SLP_REQ (HLTA) is not sent after detection. When set to EMV a ALL_REQ (WUPA) is sent instead of a SENS_REQ (REQA)
- Returns:
- ERR_WRONG_STATE : RFAL not initialized or incorrect mode
- ERR_PARAM : Invalid parameters
- ERR_IO : Generic internal error
- ERR_NONE : No error, one or more device in the field
Definition at line 206 of file rfal_nfca.cpp.
Generated on Fri Jul 15 2022 06:42:12 by
1.7.2