Mistake on this page?
Report an issue in GitHub or email us
pn512_internal.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2018, ARM Limited, All Rights Reserved
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License"); you may
6  * not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 /**
18  * \file pn512_internal.h
19  * \copyright Copyright (c) ARM Ltd 2013
20  * \author Donatien Garnier
21  */
22 
23 #ifndef PN512_INTERNAL_H_
24 #define PN512_INTERNAL_H_
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 #include "stack/nfc_common.h"
32 
33 #include "pn512.h"
34 #include "pn512_callback.h"
35 
36 //Public
37 void pn512_set_protocols(nfc_transceiver_t *pTransceiver, nfc_tech_t initiators, nfc_tech_t targets, polling_options_t options);
38 void pn512_poll(nfc_transceiver_t *pTransceiver);
39 void pn512_set_crc(nfc_transceiver_t *pTransceiver, bool crc_out, bool crc_in);
40 void pn512_set_timeout(nfc_transceiver_t *pTransceiver, int timeout);
41 void pn512_set_transceive_options(nfc_transceiver_t *pTransceiver, bool transmit, bool receive, bool repoll);
42 void pn512_set_transceive_framing(nfc_transceiver_t *pTransceiver, nfc_framing_t framing);
43 void pn512_set_write(nfc_transceiver_t *pTransceiver, ac_buffer_t *pWriteBuf);
44 ac_buffer_t *pn512_get_read(nfc_transceiver_t *pTransceiver);
45 size_t pn512_get_last_byte_length(nfc_transceiver_t *pTransceiver);
46 void pn512_set_last_byte_length(nfc_transceiver_t *pTransceiver, size_t lastByteLength);
47 void pn512_set_first_byte_align(nfc_transceiver_t *pTransceiver, size_t firstByteAlign);
48 void pn512_abort(nfc_transceiver_t *pTransceiver);
49 void pn512_transceive(nfc_transceiver_t *pTransceiver);
50 void pn512_close(nfc_transceiver_t *pTransceiver);
51 void pn512_sleep(nfc_transceiver_t *pTransceiver, bool sleep);
52 
53 void pn512_transceiver_callback(pn512_t *pPN512, nfc_err_t ret);
54 
55 static inline void pn512_rf_callback(pn512_t *pPN512, nfc_err_t ret)
56 {
57  pPN512->rf.cb(pPN512, ret);
58 }
59 
60 static inline void pn512_poll_callback(pn512_t *pPN512, nfc_err_t ret)
61 {
62  pPN512->poll.cb(pPN512, ret);
63 }
64 
65 static inline void pn512_anticollision_callback(pn512_t *pPN512, nfc_err_t ret)
66 {
67  pPN512->anticollision.cb(pPN512, ret);
68 }
69 
70 static inline void pn512_transceive_callback(pn512_t *pPN512, nfc_err_t ret)
71 {
72  pPN512->transceive.cb(pPN512, ret);
73 }
74 
75 
76 
77 #ifdef __cplusplus
78 }
79 #endif
80 
81 #endif /* PN512_INTERNAL_H_ */
Definition: pn512.h:53
int nfc_err_t
Type for NFC errors.
Definition: nfc_errors.h:59
static void sleep(void)
Send the microcontroller to sleep.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.