1 /* 2 * Copyright 2012-2020 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 /* Basic type definitions */ 18 #include <phUwbTypes.h> 19 #include <phTmlUwb.h> 20 21 #define SRXXX_MAGIC 0xEA 22 #define SRXXX_SET_PWR _IOW(SRXXX_MAGIC, 0x01, uint32_t) 23 #define SRXXX_SET_FWD _IOW(SRXXX_MAGIC, 0x02, uint32_t) 24 #define SRXXX_ESE_RESET _IOW(SRXXX_MAGIC, 0x03, uint32_t) 25 #define SRXXX_GET_THROUGHPUT _IOW(SRXXX_MAGIC, 0x04, uint32_t) 26 27 #define PWR_DISABLE 0 28 #define PWR_ENABLE 1 29 #define ABORT_READ_PENDING 2 30 31 #define NORMAL_MODE_HEADER_LEN 4 32 #define NORMAL_MODE_LEN_OFFSET 3 33 34 #define EXTENDED_SIZE_LEN_OFFSET 1 35 #define UCI_EXTENDED_PKT_MASK 0xC0 36 #define UCI_EXTENDED_SIZE_SHIFT 6 37 #define UCI_NORMAL_PKT_SIZE 0 38 #define UCI_EXT_PKT_SIZE_512B 1 39 #define UCI_EXT_PKT_SIZE_1K 2 40 #define UCI_EXT_PKT_SIZE_2K 3 41 42 #define UCI_PKT_SIZE_512B 512 43 #define UCI_PKT_SIZE_1K 1024 44 #define UCI_PKT_SIZE_2K 2048 45 46 /* Function declarations */ 47 void phTmlUwb_spi_close(void* pDevHandle); 48 tHAL_UWB_STATUS phTmlUwb_spi_open_and_configure(pphTmlUwb_Config_t pConfig, 49 void** pLinkHandle); 50 int phTmlUwb_spi_read(void* pDevHandle, uint8_t* pBuffer, int nNbBytesToRead); 51 int phTmlUwb_spi_write(void* pDevHandle, uint8_t* pBuffer, int nNbBytesToWrite); 52 int phTmlUwb_Spi_Ioctl(void* pDevHandle, phTmlUwb_ControlCode_t cmd, long arg); 53