EVE 1.0
nfc-nrf.h
Go to the documentation of this file.
1 /**********************************************************************/
2 /**
3  * @file
4  * @brief Driver for NFC in EVE.
5  *
6  * @author DT, SE, Jetro AS
7  ***********************************************************************/
8 #ifndef DRIVER_NFC_NRF_H
9 #define DRIVER_NFC_NRF_H
10 
11 #include <nfc_t2t_lib.h>
12 
13 /**
14  * \defgroup nrf_nfc nRF52 internal NFC driver
15  * \ingroup nrf52
16  * \{
17  */
18 
19 /******************************************************************************
20  * NFC driver public types
21  *****************************************************************************/
22 
23 /**
24  * @brief NFC driver descriptor: static structure for configuration of driver instance.
25  */
26 struct nfc_nrf_t
27 {
28  const struct nfc_ndef_changed_cb_table_t* NdefChangedCbTable; //!< table of interrupt handlers for supported NFC message types
29  struct nfc_nrf_state_t* State; //!< Pointer to the NFC state
30 };
31 
32 /**
33  * @brief holds current NFC instance state variables.
34  */
36 {
37  bool Enabled; //!< The chip is enabled
38  uint8_t* aNdefFile; //!< Mandatory NDEF file.
39 };
40 
41 /******************************************************************************
42  * NFC driver public functions
43  *****************************************************************************/
44 
45 /**
46  * @brief Initializes the NRF NFC interface
47  * @param Nfc NFC driver instance poiner
48  */
49 bool NfcNrfLibInit(const struct nfc_nrf_t* Nfc);
50 
51 /**
52  * @brief Disables NFC card emulation
53  * @param Nfc NFC driver instance poiner
54  */
55 bool NfcNrfLibDisable(const struct nfc_nrf_t* Nfc);
56 
57 /**
58  * @brief Sets a memory buffer as an NDEF file for subsequent
59  * NfcNrfCardEmulation function call.\n
60  * @param Nfc NFC driver instance poiner
61  * @param NdefFile Pointer to the buffer to set.
62  * @param NdefFileSize Full buffer length (not current data length!)
63  */
64 void NfcNrfSetNdefFile(const struct nfc_nrf_t* Nfc,
65  uint8_t* NdefFile, uint16_t NdefFileSize);
66 
67 /**
68  * @brief Starts card emulation
69  * @param Nfc NFC driver instance poiner
70  */
71 void NfcNrfCardEmulation(const struct nfc_nrf_t* Nfc);
72 
73 /** \} nrf_nfc */
74 
75 #endif // DRIVER_NFC_NRF_H
bool NfcNrfLibInit(const struct nfc_nrf_t *Nfc)
Initializes the NRF NFC interface.
void NfcNrfSetNdefFile(const struct nfc_nrf_t *Nfc, uint8_t *NdefFile, uint16_t NdefFileSize)
Sets a memory buffer as an NDEF file for subsequent NfcNrfCardEmulation function call. .
bool NfcNrfLibDisable(const struct nfc_nrf_t *Nfc)
Disables NFC card emulation.
holds current NFC instance state variables.
Definition: nfc-nrf.h:35
NFC driver descriptor: static structure for configuration of driver instance.
Definition: nfc-nrf.h:26
struct nfc_nrf_state_t * State
Pointer to the NFC state.
Definition: nfc-nrf.h:29
Table element of interrupt handlers called on NDEF write attempt for supported NFC message types...
Definition: nfc-ndef.h:58
const struct nfc_ndef_changed_cb_table_t * NdefChangedCbTable
table of interrupt handlers for supported NFC message types
Definition: nfc-nrf.h:28
uint8_t * aNdefFile
Mandatory NDEF file.
Definition: nfc-nrf.h:38
bool Enabled
The chip is enabled.
Definition: nfc-nrf.h:37
void NfcNrfCardEmulation(const struct nfc_nrf_t *Nfc)
Starts card emulation.