1 /*
2  * Copyright (C) 2012-2020, 2022-2023 NXP
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef _PHNXPNCIHAL_ADAPTATION_H_
18 #define _PHNXPNCIHAL_ADAPTATION_H_
19 
20 #include <hardware/nfc.h>
21 
22 typedef struct {
23   struct nfc_nci_device nci_device;
24 
25   /* Local definitions */
26 } pn547_dev_t;
27 
28 /* NXP HAL functions */
29 int phNxpNciHal_open(nfc_stack_callback_t* p_cback,
30                      nfc_stack_data_callback_t* p_data_cback);
31 int phNxpNciHal_MinOpen();
32 int phNxpNciHal_write(uint16_t data_len, const uint8_t* p_data);
33 int phNxpNciHal_write_internal(uint16_t data_len, const uint8_t* p_data);
34 int phNxpNciHal_core_initialized(uint16_t core_init_rsp_len = 0,
35                                  uint8_t* p_core_init_rsp_params = nullptr);
36 int phNxpNciHal_pre_discover(void);
37 int phNxpNciHal_close(bool);
38 int phNxpNciHal_configDiscShutdown(void);
39 int phNxpNciHal_control_granted(void);
40 int phNxpNciHal_power_cycle(void);
41 int phNxpNciHal_ioctl(long arg, void* p_data);
42 void phNxpNciHal_do_factory_reset(void);
43 void phNxpNciHal_setVerboseLogging(bool enable);
44 bool phNxpNciHal_getVerboseLogging();
45 #endif /* _PHNXPNCIHAL_ADAPTATION_H_ */
46