1 /****************************************************************************** 2 * 3 * Copyright (C) 1999-2014 Broadcom Corporation 4 * Copyright 2018-2019 NXP 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at: 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 * 18 ******************************************************************************/ 19 /****************************************************************************** 20 * 21 * UWB Hardware Abstraction Layer API 22 * 23 ******************************************************************************/ 24 #ifndef UWB_HAL_API_H 25 #define UWB_HAL_API_H 26 #include "data_types.h" 27 #include "hal_uwb.h" 28 29 typedef uint8_t tUWB_STATUS; 30 typedef void(tHAL_UWB_CBACK)(uint8_t event, tUWB_STATUS status); 31 typedef void(tHAL_UWB_DATA_CBACK)(uint16_t data_len, uint8_t* p_data); 32 33 /******************************************************************************* 34 ** tHAL_UWB_ENTRY HAL entry-point lookup table 35 *******************************************************************************/ 36 typedef void(tHAL_API_OPEN)(tHAL_UWB_CBACK* p_hal_cback, 37 tHAL_UWB_DATA_CBACK* p_data_cback); 38 typedef void(tHAL_API_CLOSE)(void); 39 typedef tUWB_STATUS(tHAL_API_CORE_INIT)(); 40 typedef tUWB_STATUS(tHAL_API_SESSION_INIT)(int); 41 typedef void(tHAL_API_WRITE)(uint16_t data_len, uint8_t* p_data); 42 typedef tUWB_STATUS(tHAL_API_IOCTL)(long arg, void* p_data); 43 44 typedef struct { 45 tHAL_API_OPEN* open; 46 tHAL_API_CLOSE* close; 47 tHAL_API_WRITE* write; 48 tHAL_API_IOCTL* ioctl; 49 tHAL_API_CORE_INIT* CoreInitialization; 50 tHAL_API_SESSION_INIT* SessionInitialization; 51 } tHAL_UWB_ENTRY; 52 53 typedef struct { 54 tHAL_UWB_ENTRY* hal_entry_func; 55 } tHAL_UWB_CONTEXT; 56 57 #endif /* UWB_HAL_API_H */ 58