ruuvi.drivers.c  ${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
nfc_t2t_lib.h
Go to the documentation of this file.
1 
41 #ifndef NFC_T2T_LIB_H__
42 #define NFC_T2T_LIB_H__
43 
58 #include <string.h>
59 #include <sdk_errors.h>
60 
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64 
65 #define NFC_T2T_SIZEOF_INTERNAL_BYTES 10
66 #define NFC_T2T_MAX_PAYLOAD_SIZE 988
67 #define NFC_T2T_MAX_PAYLOAD_SIZE_RAW 1008
68 
70 typedef enum
71 {
74 
77 
80 
83 
91 
92 typedef enum
93 {
100 
108 typedef void (*nfc_t2t_callback_t)(void * p_context,
109  nfc_t2t_event_t event,
110  const uint8_t * p_data,
111  size_t data_length);
112 
124 ret_code_t nfc_t2t_setup(nfc_t2t_callback_t callback, void * p_context);
125 
138 ret_code_t nfc_t2t_parameter_set(nfc_t2t_param_id_t id, void * p_data, size_t data_length);
139 
155 ret_code_t nfc_t2t_parameter_get(nfc_t2t_param_id_t id, void * p_data, size_t * p_max_data_length);
156 
185 ret_code_t nfc_t2t_payload_set(const uint8_t * p_payload, size_t payload_length);
186 
214 ret_code_t nfc_t2t_payload_raw_set(const uint8_t * p_payload, size_t payload_length);
215 
235 ret_code_t nfc_t2t_internal_set(const uint8_t * p_data, size_t data_length);
236 
245 ret_code_t nfc_t2t_emulation_start(void);
246 
255 ret_code_t nfc_t2t_emulation_stop(void);
256 
264 ret_code_t nfc_t2t_done(void);
265 
266 #ifdef __cplusplus
267 }
268 #endif
269 
271 #endif // NFC_T2T_LIB_H__
ret_code_t nfc_t2t_emulation_start(void)
Function for activating the NFC frontend.
void(* nfc_t2t_callback_t)(void *p_context, nfc_t2t_event_t event, const uint8_t *p_data, size_t data_length)
Callback to pass events from NFC T2T Library to application.
Definition: nfc_t2t_lib.h:108
nfc_t2t_event_t
Events passed to the callback function.
Definition: nfc_t2t_lib.h:71
ret_code_t nfc_t2t_parameter_get(nfc_t2t_param_id_t id, void *p_data, size_t *p_max_data_length)
Function for querying an NFC parameter value.
ret_code_t nfc_t2t_setup(nfc_t2t_callback_t callback, void *p_context)
Function for registering the application callback for event signaling.
nfc_t2t_param_id_t
Definition: nfc_t2t_lib.h:93
ret_code_t nfc_t2t_emulation_stop(void)
Function for deactivating the NFC frontend.
ret_code_t nfc_t2t_internal_set(const uint8_t *p_data, size_t data_length)
Function for registering the sequence of internal bytes.
ret_code_t nfc_t2t_payload_set(const uint8_t *p_payload, size_t payload_length)
Function for registering the payload to send on reception of a READ request.
ret_code_t nfc_t2t_payload_raw_set(const uint8_t *p_payload, size_t payload_length)
Function for registering the raw payload to send on reception of a READ request.
ret_code_t nfc_t2t_parameter_set(nfc_t2t_param_id_t id, void *p_data, size_t data_length)
Function for setting an NFC parameter.
ret_code_t nfc_t2t_done(void)
Function for releasing the reference to the application callback.
@ NFC_T2T_EVENT_DATA_READ
NFC polling device has read all tag data.
Definition: nfc_t2t_lib.h:81
@ NFC_T2T_EVENT_FIELD_ON
NFC tag has detected external NFC field and was selected by an NFC polling device.
Definition: nfc_t2t_lib.h:75
@ NFC_T2T_EVENT_FIELD_OFF
External NFC field has been removed.
Definition: nfc_t2t_lib.h:78
@ NFC_T2T_EVENT_STOPPED
Reference to the application NFC callback has been released using nfc_t2t_done.
Definition: nfc_t2t_lib.h:88
@ NFC_T2T_EVENT_NONE
Not used.
Definition: nfc_t2t_lib.h:72
@ NFC_T2T_PARAM_NFCID1
Definition: nfc_t2t_lib.h:95
@ NFC_T2T_PARAM_TESTING
Used for unit tests.
Definition: nfc_t2t_lib.h:94