xref: /aosp_15_r20/system/nfc/src/include/nfc_hal_api.h (revision 7eba2f3b06c51ae21384f6a4f14577b668a869b3)
1*7eba2f3bSAndroid Build Coastguard Worker /******************************************************************************
2*7eba2f3bSAndroid Build Coastguard Worker  *
3*7eba2f3bSAndroid Build Coastguard Worker  *  Copyright (C) 2012-2014 Broadcom Corporation
4*7eba2f3bSAndroid Build Coastguard Worker  *
5*7eba2f3bSAndroid Build Coastguard Worker  *  Licensed under the Apache License, Version 2.0 (the "License");
6*7eba2f3bSAndroid Build Coastguard Worker  *  you may not use this file except in compliance with the License.
7*7eba2f3bSAndroid Build Coastguard Worker  *  You may obtain a copy of the License at:
8*7eba2f3bSAndroid Build Coastguard Worker  *
9*7eba2f3bSAndroid Build Coastguard Worker  *  http://www.apache.org/licenses/LICENSE-2.0
10*7eba2f3bSAndroid Build Coastguard Worker  *
11*7eba2f3bSAndroid Build Coastguard Worker  *  Unless required by applicable law or agreed to in writing, software
12*7eba2f3bSAndroid Build Coastguard Worker  *  distributed under the License is distributed on an "AS IS" BASIS,
13*7eba2f3bSAndroid Build Coastguard Worker  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14*7eba2f3bSAndroid Build Coastguard Worker  *  See the License for the specific language governing permissions and
15*7eba2f3bSAndroid Build Coastguard Worker  *  limitations under the License.
16*7eba2f3bSAndroid Build Coastguard Worker  *
17*7eba2f3bSAndroid Build Coastguard Worker  ******************************************************************************/
18*7eba2f3bSAndroid Build Coastguard Worker 
19*7eba2f3bSAndroid Build Coastguard Worker /******************************************************************************
20*7eba2f3bSAndroid Build Coastguard Worker  *
21*7eba2f3bSAndroid Build Coastguard Worker  *  NFC Hardware Abstraction Layer API
22*7eba2f3bSAndroid Build Coastguard Worker  *
23*7eba2f3bSAndroid Build Coastguard Worker  ******************************************************************************/
24*7eba2f3bSAndroid Build Coastguard Worker #ifndef NFC_HAL_API_H
25*7eba2f3bSAndroid Build Coastguard Worker #define NFC_HAL_API_H
26*7eba2f3bSAndroid Build Coastguard Worker #include "data_types.h"
27*7eba2f3bSAndroid Build Coastguard Worker #include "hardware_nfc.h"
28*7eba2f3bSAndroid Build Coastguard Worker #include "nfc_hal_target.h"
29*7eba2f3bSAndroid Build Coastguard Worker 
30*7eba2f3bSAndroid Build Coastguard Worker typedef uint8_t tHAL_NFC_STATUS;
31*7eba2f3bSAndroid Build Coastguard Worker typedef void(tHAL_NFC_STATUS_CBACK)(tHAL_NFC_STATUS status);
32*7eba2f3bSAndroid Build Coastguard Worker typedef void(tHAL_NFC_CBACK)(uint8_t event, tHAL_NFC_STATUS status);
33*7eba2f3bSAndroid Build Coastguard Worker typedef void(tHAL_NFC_DATA_CBACK)(uint16_t data_len, uint8_t* p_data);
34*7eba2f3bSAndroid Build Coastguard Worker 
35*7eba2f3bSAndroid Build Coastguard Worker /*******************************************************************************
36*7eba2f3bSAndroid Build Coastguard Worker ** tHAL_NFC_ENTRY HAL entry-point lookup table
37*7eba2f3bSAndroid Build Coastguard Worker *******************************************************************************/
38*7eba2f3bSAndroid Build Coastguard Worker 
39*7eba2f3bSAndroid Build Coastguard Worker typedef void(tHAL_API_INITIALIZE)(void);
40*7eba2f3bSAndroid Build Coastguard Worker typedef void(tHAL_API_TERMINATE)(void);
41*7eba2f3bSAndroid Build Coastguard Worker typedef void(tHAL_API_OPEN)(tHAL_NFC_CBACK* p_hal_cback,
42*7eba2f3bSAndroid Build Coastguard Worker                             tHAL_NFC_DATA_CBACK* p_data_cback);
43*7eba2f3bSAndroid Build Coastguard Worker typedef void(tHAL_API_CLOSE)(void);
44*7eba2f3bSAndroid Build Coastguard Worker typedef void(tHAL_API_CORE_INITIALIZED)(uint16_t data_len,
45*7eba2f3bSAndroid Build Coastguard Worker                                         uint8_t* p_core_init_rsp_params);
46*7eba2f3bSAndroid Build Coastguard Worker typedef void(tHAL_API_WRITE)(uint16_t data_len, uint8_t* p_data);
47*7eba2f3bSAndroid Build Coastguard Worker typedef bool(tHAL_API_PREDISCOVER)(void);
48*7eba2f3bSAndroid Build Coastguard Worker typedef void(tHAL_API_CONTROL_GRANTED)(void);
49*7eba2f3bSAndroid Build Coastguard Worker typedef void(tHAL_API_POWER_CYCLE)(void);
50*7eba2f3bSAndroid Build Coastguard Worker typedef uint8_t(tHAL_API_GET_MAX_NFCEE)(void);
51*7eba2f3bSAndroid Build Coastguard Worker 
52*7eba2f3bSAndroid Build Coastguard Worker typedef struct {
53*7eba2f3bSAndroid Build Coastguard Worker   tHAL_API_INITIALIZE* initialize;
54*7eba2f3bSAndroid Build Coastguard Worker   tHAL_API_TERMINATE* terminate;
55*7eba2f3bSAndroid Build Coastguard Worker   tHAL_API_OPEN* open;
56*7eba2f3bSAndroid Build Coastguard Worker   tHAL_API_CLOSE* close;
57*7eba2f3bSAndroid Build Coastguard Worker   tHAL_API_CORE_INITIALIZED* core_initialized;
58*7eba2f3bSAndroid Build Coastguard Worker   tHAL_API_WRITE* write;
59*7eba2f3bSAndroid Build Coastguard Worker   tHAL_API_PREDISCOVER* prediscover;
60*7eba2f3bSAndroid Build Coastguard Worker   tHAL_API_CONTROL_GRANTED* control_granted;
61*7eba2f3bSAndroid Build Coastguard Worker   tHAL_API_POWER_CYCLE* power_cycle;
62*7eba2f3bSAndroid Build Coastguard Worker   tHAL_API_GET_MAX_NFCEE* get_max_ee;
63*7eba2f3bSAndroid Build Coastguard Worker 
64*7eba2f3bSAndroid Build Coastguard Worker } tHAL_NFC_ENTRY;
65*7eba2f3bSAndroid Build Coastguard Worker 
66*7eba2f3bSAndroid Build Coastguard Worker /*******************************************************************************
67*7eba2f3bSAndroid Build Coastguard Worker ** HAL API Function Prototypes
68*7eba2f3bSAndroid Build Coastguard Worker *******************************************************************************/
69*7eba2f3bSAndroid Build Coastguard Worker 
70*7eba2f3bSAndroid Build Coastguard Worker #endif /* NFC_HAL_API_H  */
71