7#ifndef ST25R3911B_NFCA_H_
8#define ST25R3911B_NFCA_H_
10#include <zephyr/kernel.h>
11#include <zephyr/types.h>
26#define ST25R3911B_NFCA_EVENT_CNT 2
29#define ST25R3911B_NFCA_CRC_LEN 2
32#define ST25R3911B_NFCA_NFCID1_MAX_LEN 10
38#define ST25R3911B_NFCA_ERR_CRC 1
39#define ST25R3911B_NFCA_ERR_PARITY 2
40#define ST25R3911B_NFCA_ERR_FRAMING 3
41#define ST25R3911B_NFCA_ERR_SOFT_FRAMING 4
42#define ST25R3911B_NFCA_ERR_HARD_FRAMING 5
43#define ST25R3911B_NFCA_ERR_LAST_BYTE_INCOMPLETE 6
44#define ST25R3911B_NFCA_ERR_TRANSMISSION 7
241 uint32_t fdt,
bool auto_crc);
int st25r3911b_nfca_process(void)
Process NFC-A library.
int st25r3911b_nfca_tag_sleep(void)
Send NFC-A tag sleep command.
#define ST25R3911B_NFCA_CRC_LEN
Definition: st25r3911b_nfca.h:29
int st25r3911b_nfca_crc_calculate(const uint8_t *data, size_t len, struct st25r3911b_nfca_crc *crc_val)
Calculate CRC 16 for NFC-A payload.
static int st25r3911b_nfca_transfer_with_crc(const struct st25r3911b_nfca_buf *tx, const struct st25r3911b_nfca_buf *rx, uint32_t fdt)
Exchange the specified amount of data with an automatically generated CRC.
Definition: st25r3911b_nfca.h:254
int st25r3911b_nfca_init(struct k_poll_event *events, uint8_t cnt, const struct st25r3911b_nfca_cb *cb)
Initialize NFC Reader NFC-A technology.
int st25r3911b_nfca_tag_detect(enum st25r3911b_nfca_detect_cmd cmd)
Detect tag by sending a detection command.
int st25r3911b_nfca_anticollision_start(void)
NFC-A collision resolution procedure.
#define ST25R3911B_NFCA_NFCID1_MAX_LEN
Definition: st25r3911b_nfca.h:32
int st25r3911b_nfca_field_on(void)
Switch on the NFC Reader field.
st25r3911b_nfca_detect_cmd
NFC-A Tag detect command.
Definition: st25r3911b_nfca.h:62
@ ST25R3911B_NFCA_DETECT_CMD_ALL_REQ
Definition: st25r3911b_nfca.h:63
@ ST25R3911B_NFCA_DETECT_CMD_SENS_REQ
Definition: st25r3911b_nfca.h:64
int st25r3911b_nfca_transfer(const struct st25r3911b_nfca_buf *tx, const struct st25r3911b_nfca_buf *rx, uint32_t fdt, bool auto_crc)
Exchange the specified amount of data.
st25r3911b_nfca_tag_type
NFC-A Tag types.
Definition: st25r3911b_nfca.h:52
@ ST25R3911B_NFCA_TAG_TYPE_T4T
Definition: st25r3911b_nfca.h:54
@ ST25R3911B_NFCA_TAG_TYPE_NFCDEP
Definition: st25r3911b_nfca.h:55
@ ST25R3911B_NFCA_TAG_TYPE_T1T
Definition: st25r3911b_nfca.h:57
@ ST25R3911B_NFCA_TAG_TYPE_T4T_NFCDEP
Definition: st25r3911b_nfca.h:56
@ ST25R3911B_NFCA_TAG_TYPE_T2T
Definition: st25r3911b_nfca.h:53
int st25r3911b_nfca_field_off(void)
Switch off the NFC Reader field.
static int st25r3911b_nfca_transfer_without_crc(const struct st25r3911b_nfca_buf *tx, const struct st25r3911b_nfca_buf *rx, uint32_t fdt)
Exchange the specified amount of data with a manually generated CRC.
Definition: st25r3911b_nfca.h:274
uint8_t * data
Definition: st25r3911b_nfca.h:71
size_t len
Definition: st25r3911b_nfca.h:74
NFC-A transceiver buffer.
Definition: st25r3911b_nfca.h:69
void(* transfer_completed)(const uint8_t *data, size_t len, int err)
NFC-A transceive operation completed.
Definition: st25r3911b_nfca.h:153
void(* field_off)(void)
Field off indication callback.
Definition: st25r3911b_nfca.h:129
void(* rx_timeout)(bool tag_sleep)
NFC-A receive time-out.
Definition: st25r3911b_nfca.h:159
void(* tag_sleep)(void)
NFC-A tag sleep state notification.
Definition: st25r3911b_nfca.h:163
void(* tag_detected)(const struct st25r3911b_nfca_sens_resp *sens_resp)
Tag detected callback.
Definition: st25r3911b_nfca.h:137
void(* anticollision_completed)(const struct st25r3911b_nfca_tag_info *tag_info, int err)
Collision resolution procedure completed.
Definition: st25r3911b_nfca.h:144
void(* field_on)(void)
Field on indication callback.
Definition: st25r3911b_nfca.h:125
NFC-A callback.
Definition: st25r3911b_nfca.h:120
uint8_t crc[2]
Definition: st25r3911b_nfca.h:113
NFCA_A CRC structure.
Definition: st25r3911b_nfca.h:111
uint8_t anticollison
Definition: st25r3911b_nfca.h:81
uint8_t platform_info
Definition: st25r3911b_nfca.h:84
NFC-A SENS response.
Definition: st25r3911b_nfca.h:79
enum st25r3911b_nfca_tag_type type
Definition: st25r3911b_nfca.h:91
uint8_t nfcid1[10]
Definition: st25r3911b_nfca.h:103
struct st25r3911b_nfca_sens_resp sens_resp
Definition: st25r3911b_nfca.h:94
uint8_t nfcid1_len
Definition: st25r3911b_nfca.h:100
uint8_t sel_resp
Definition: st25r3911b_nfca.h:97
bool sleep
Definition: st25r3911b_nfca.h:106
NFC-A Tag information.
Definition: st25r3911b_nfca.h:89