1 /******************************************************************************
2  *
3  *  Copyright (C) 2018 ST Microelectronics S.A.
4  *
5  *  Licensed under the Apache License, Version 2.0 (the "License");
6  *  you may 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,
13  *  WITHOUT 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  ******************************************************************************/
19 
20 #ifndef _STNFC_HAL_API_H_
21 #define _STNFC_HAL_API_H_
22 
23 #include <android/hardware/nfc/1.2/INfc.h>
24 #include <android/hardware/nfc/1.2/types.h>
25 #include <hardware/nfc.h>
26 
27 using ::android::hardware::nfc::V1_2::NfcConfig;
28 
29 #define NFC_MODE_OFF 0
30 #define NFC_MODE_ON  1
31 #define NFC_MODE_QuickBoot 2
32 
33 
34 int StNfc_hal_open(nfc_stack_callback_t* p_cback,
35                    nfc_stack_data_callback_t* p_data_cback);
36 int StNfc_hal_write(uint16_t data_len, const uint8_t* p_data);
37 int StNfc_hal_core_initialized(uint8_t* p_core_init_rsp_params);
38 
39 int StNfc_hal_pre_discover();
40 
41 int StNfc_hal_close(int nfc_mode);
42 
43 int StNfc_hal_control_granted();
44 
45 int StNfc_hal_power_cycle();
46 
47 void StNfc_hal_factoryReset();
48 
49 int StNfc_hal_closeForPowerOffCase();
50 
51 void StNfc_hal_getConfig(android::hardware::nfc::V1_1::NfcConfig& config);
52 void StNfc_hal_getConfig_1_2(NfcConfig& config);
53 
54 #endif /* _STNFC_HAL_API_H_ */
55