ST Expansion SW Team / RFAL

Dependents:   mbed-os-nfc05a1

Embed: (wiki syntax)

« Back to documentation index

NFC-F

RFAL NFC-F Module. More...

Data Structures

struct  rfalNfcfSensfRes
struct  rfalNfcfPollDevice
struct  rfalNfcfListenDevice

Enumerations

enum  {
  RFAL_NFCF_CMD_POLLING = 0x00, RFAL_NFCF_CMD_POLLING_RES = 0x01, RFAL_NFCF_CMD_REQUEST_SERVICE = 0x02, RFAL_NFCF_CMD_REQUEST_RESPONSE = 0x04,
  RFAL_NFCF_CMD_READ_WITHOUT_ENCRYPTION = 0x06, RFAL_NFCF_CMD_WRITE_WITHOUT_ENCRYPTION = 0x08, RFAL_NFCF_CMD_REQUEST_SYSTEM_CODE = 0x0c, RFAL_NFCF_CMD_AUTHENTICATION1 = 0x10,
  RFAL_NFCF_CMD_AUTHENTICATION2 = 0x12, RFAL_NFCF_CMD_READ = 0x14, RFAL_NFCF_CMD_WRITE = 0x16
}

Functions

ReturnCode rfalNfcfPollerInitialize (rfalBitRate bitRate, 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-F Poller mode.
ReturnCode rfalNfcfPollerCheckPresence (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-F Poller Check Presence.
ReturnCode rfalNfcfPollerPoll (rfalFeliCaPollSlots slots, uint16_t sysCode, uint8_t reqCode, rfalFeliCaPollRes *cardList, uint8_t *devCnt, uint8_t *collisions, 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-F Poller Poll.
ReturnCode rfalNfcfPollerCollisionResolution (rfalComplianceMode compMode, uint8_t devLimit, rfalNfcfListenDevice *nfcfDevList, 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-F Poller Full Collision Resolution.
bool rfalNfcfListenerIsT3TReq (uint8_t *buf, uint16_t bufLen, uint8_t *nfcid2)
 NFC-F Listener is T3T Request.

Detailed Description

RFAL NFC-F Module.


Enumeration Type Documentation

anonymous enum

NFC-F Felica command set JIS X6319-4 9.1

Enumerator:
RFAL_NFCF_CMD_POLLING 

SENSF_REQ (Felica Poll/REQC command to identify a card )

RFAL_NFCF_CMD_POLLING_RES 

SENSF_RES (Felica Poll/REQC command response )

RFAL_NFCF_CMD_REQUEST_SERVICE 

verify the existence of Area and Service

RFAL_NFCF_CMD_REQUEST_RESPONSE 

verify the existence of a card

RFAL_NFCF_CMD_READ_WITHOUT_ENCRYPTION 

read Block Data from a Service that requires no authentication

RFAL_NFCF_CMD_WRITE_WITHOUT_ENCRYPTION 

write Block Data to a Service that requires no authentication

RFAL_NFCF_CMD_REQUEST_SYSTEM_CODE 

acquire the System Code registered to a card

RFAL_NFCF_CMD_AUTHENTICATION1 

authenticate a card

RFAL_NFCF_CMD_AUTHENTICATION2 

allow a card to authenticate a Reader/Writer

RFAL_NFCF_CMD_READ 

read Block Data from a Service that requires authentication

RFAL_NFCF_CMD_WRITE 

write Block Data to a Service that requires authentication

Definition at line 102 of file rfal_nfcf.h.


Function Documentation

bool rfalNfcfListenerIsT3TReq ( uint8_t *  buf,
uint16_t  bufLen,
uint8_t *  nfcid2 
)

NFC-F Listener is T3T Request.

This method checks if the given data is a valid T3T command (Read or Write) and in case a valid request has been received it may output the request's NFCID2

Parameters:
[in]buf: buffer holding Initiator's received command
[in]bufLen: length of received command in bytes
[out]nfcid2: pointer to where the NFCID2 may be outputed, nfcid2 has NFCF_SENSF_NFCID2_LEN as length Pass NULL if output parameter not desired
Returns:
true : Valid T3T command (Read or Write) received
false : Invalid protocol request

Definition at line 312 of file rfal_nfcf.cpp.

ReturnCode rfalNfcfPollerCheckPresence ( 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-F Poller Check Presence.

This function sends a Poll/SENSF command according to NFC Activity spec It detects if a NCF-F device is within range

Returns:
ERR_WRONG_STATE : RFAL not initialized or incorrect mode
ERR_PARAM : Invalid parameters
ERR_IO : Generic internal error
ERR_CRC : CRC error detected
ERR_FRAMING : Framing error detected
ERR_PROTO : Protocol error detected
ERR_TIMEOUT : Timeout error, no listener device detected
ERR_NONE : No error and some NFC-F device was detected

Definition at line 237 of file rfal_nfcf.cpp.

ReturnCode rfalNfcfPollerCollisionResolution ( rfalComplianceMode  compMode,
uint8_t  devLimit,
rfalNfcfListenDevice nfcfDevList,
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-F Poller Full Collision Resolution.

Performs a full Collision resolution as defined in Activity 1.1 9.3.4

Parameters:
[in]compMode: compliance mode to be performed
[in]devLimit: device limit value, and size nfcaDevList
[out]nfcfDevList: NFC-F listener devices list
[out]devCnt: Devices found counter
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 250 of file rfal_nfcf.cpp.

ReturnCode rfalNfcfPollerInitialize ( rfalBitRate  bitRate,
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-F Poller mode.

This methods configures RFAL RF layer to perform as a NFC-F Poller/RW (FeliCa PCD) including all default timings

Parameters:
[in]bitRate: NFC-F bitrate to be initialize (212 or 424)
Returns:
ERR_WRONG_STATE : RFAL not initialized or mode not set
ERR_PARAM : Incorrect bitrate
ERR_NONE : No error

Definition at line 209 of file rfal_nfcf.cpp.

ReturnCode rfalNfcfPollerPoll ( rfalFeliCaPollSlots  slots,
uint16_t  sysCode,
uint8_t  reqCode,
rfalFeliCaPollRes cardList,
uint8_t *  devCnt,
uint8_t *  collisions,
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-F Poller Poll.

This function sends to all PICCs in field the POLL command with the given number of slots.

Parameters:
[in]slots: the number of slots to be performed
[in]sysCode: as given in FeliCa poll command
[in]reqCode: FeliCa communication parameters
[out]cardList: Parameter of type rfalFeliCaPollRes which will hold the cards found
[out]devCnt: actual number of cards found
[out]collisions: number of collisions encountered
Warning:
the list cardList has to be as big as the number of slots for the Poll
Returns:
ERR_WRONG_STATE : RFAL not initialized or incorrect mode
ERR_PARAM : Invalid parameters
ERR_IO : Generic internal error
ERR_CRC : CRC error detected
ERR_FRAMING : Framing error detected
ERR_PROTO : Protocol error detected
ERR_TIMEOUT : Timeout error, no listener device detected
ERR_NONE : No error and some NFC-F device was detected

Definition at line 231 of file rfal_nfcf.cpp.