1 /*
2  * Copyright (C) 2012-2019 NXP Semiconductors
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 #include <android/hardware/nfc/1.2/INfc.h>
22 #include <android/hardware/nfc/1.2/types.h>
23 
24 using ::android::hardware::nfc::V1_2::NfcConfig;
25 
26 typedef struct {
27   struct nfc_nci_device nci_device;
28 
29   /* Local definitions */
30 } pn547_dev_t;
31 
32 /* NXP HAL functions */
33 int phNxpNciHal_open(nfc_stack_callback_t* p_cback,
34                      nfc_stack_data_callback_t* p_data_cback);
35 int phNxpNciHal_MinOpen();
36 int phNxpNciHal_write(uint16_t data_len, const uint8_t* p_data);
37 int phNxpNciHal_write_internal(uint16_t data_len, const uint8_t* p_data);
38 int phNxpNciHal_core_initialized(uint8_t* p_core_init_rsp_params);
39 int phNxpNciHal_pre_discover(void);
40 int phNxpNciHal_close(bool);
41 int phNxpNciHal_configDiscShutdown(void);
42 int phNxpNciHal_control_granted(void);
43 int phNxpNciHal_power_cycle(void);
44 int phNxpNciHal_ioctl(long arg, void* p_data);
45 void phNxpNciHal_do_factory_reset(void);
46 void phNxpNciHal_getVendorConfig(android::hardware::nfc::V1_1::NfcConfig& config);
47 void phNxpNciHal_getVendorConfig_1_2(NfcConfig& config);
48 #endif /* _PHNXPNCIHAL_ADAPTATION_H_ */
49