Mbed OS Reference
Loading...
Searching...
No Matches
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
27extern "C" {
28#endif
29
30#include "stack/nfc_common.h"
32
33#include "pn512.h"
34#include "pn512_callback.h"
35
36//Public
37void pn512_set_protocols(nfc_transceiver_t *pTransceiver, nfc_tech_t initiators, nfc_tech_t targets, polling_options_t options);
38void pn512_poll(nfc_transceiver_t *pTransceiver);
39void pn512_set_crc(nfc_transceiver_t *pTransceiver, bool crc_out, bool crc_in);
40void pn512_set_timeout(nfc_transceiver_t *pTransceiver, int timeout);
41void pn512_set_transceive_options(nfc_transceiver_t *pTransceiver, bool transmit, bool receive, bool repoll);
42void pn512_set_transceive_framing(nfc_transceiver_t *pTransceiver, nfc_framing_t framing);
43void pn512_set_write(nfc_transceiver_t *pTransceiver, ac_buffer_t *pWriteBuf);
44ac_buffer_t *pn512_get_read(nfc_transceiver_t *pTransceiver);
45size_t pn512_get_last_byte_length(nfc_transceiver_t *pTransceiver);
46void pn512_set_last_byte_length(nfc_transceiver_t *pTransceiver, size_t lastByteLength);
47void pn512_set_first_byte_align(nfc_transceiver_t *pTransceiver, size_t firstByteAlign);
48void pn512_abort(nfc_transceiver_t *pTransceiver);
49void pn512_transceive(nfc_transceiver_t *pTransceiver);
50void pn512_close(nfc_transceiver_t *pTransceiver);
51void pn512_sleep(nfc_transceiver_t *pTransceiver, bool sleep);
52
53void pn512_transceiver_callback(pn512_t *pPN512, nfc_err_t ret);
54
55static inline void pn512_rf_callback(pn512_t *pPN512, nfc_err_t ret)
56{
57 pPN512->rf.cb(pPN512, ret);
58}
59
60static inline void pn512_poll_callback(pn512_t *pPN512, nfc_err_t ret)
61{
62 pPN512->poll.cb(pPN512, ret);
63}
64
65static inline void pn512_anticollision_callback(pn512_t *pPN512, nfc_err_t ret)
66{
67 pPN512->anticollision.cb(pPN512, ret);
68}
69
70static 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_ */
int nfc_err_t
Type for NFC errors.
Definition: nfc_errors.h:60
Definition: pn512.h:53