1 /* 2 * Copyright 2012-2020, 2022-2024 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 #ifndef _PHNXPUCIHAL_EXT_H_ 17 #define _PHNXPUCIHAL_EXT_H_ 18 19 #include <phNxpUciHal.h> 20 #include <string.h> 21 22 #define UCI_GID_NXP_PROPRIETARY 0x0D /* 1101b Proprietary Group */ 23 24 /* Extended device core configirations */ 25 #define EXTENDED_DEVICE_CONFIG_ID 0xE4 26 27 #define UCI_EXT_PARAM_DELAY_CALIBRATION_VALUE 0x00 28 #define UCI_EXT_PARAM_AOA_CALIBRATION_CTRL 0x01 29 #define UCI_EXT_PARAM_DPD_WAKEUP_SRC 0x02 30 #define UCI_EXT_PARAM_WTX_COUNT_CONFIG 0x03 31 #define UCI_EXT_PARAM_DPD_ENTRY_TIMEOUT 0x04 32 #define UCI_EXT_PARAM_WIFI_COEX_FEATURE 0x05 33 #define UCI_EXT_PARAM_TX_BASE_BAND_CONFIG 0x26 34 #define UCI_EXT_PARAM_DDFS_TONE_CONFIG 0x27 35 #define UCI_EXT_PARAM_TX_PULSE_SHAPE_CONFIG 0x28 36 #define UCI_EXT_PARAM_CLK_CONFIG_CTRL 0x30 37 38 #define UCI_PARAM_ID_LOW_POWER_MODE 0x01 39 40 /* customer specific calib params */ 41 #define VENDOR_CALIB_PARAM_TX_POWER_PER_ANTENNA 0x04 42 43 /* Proprietary GID */ 44 #define UCI_GID_PROPRIETARY_0x0F 0x0F 45 46 /* Customer Specific OID */ 47 #define SET_VENDOR_SET_CALIBRATION 0x21 48 49 #define RMS_TX_POWER_SHIFT 8 50 #define UCI_RMS_TX_POWER_INDEX 7 51 #define UCI_RMS_TX_POWER_LEN 2 52 53 /* Extended Uci status Reason code */ 54 #define UCI_EXT_STATUS_SE_RECOVERY_FAILURE 0x72 55 #define UCI_EXT_STATUS_SE_RECOVERY_SUCCESS 0x73 56 #define UCI_EXT_STATUS_SE_APDU_CMD_FAIL 0x74 57 #define UCI_EXT_STATUS_SE_AUTH_FAIL 0x75 58 59 tHAL_UWB_STATUS phNxpUciHal_send_ext_cmd(size_t cmd_len, const uint8_t* p_cmd); 60 tHAL_UWB_STATUS phNxpUciHal_process_ext_rsp(size_t cmd_len, uint8_t* p_buff); 61 tHAL_UWB_STATUS phNxpUciHal_set_board_config(); 62 void phNxpUciHal_handle_set_calibration(uint8_t *p_data, size_t data_len); 63 void phNxpUciHal_extcal_handle_coreinit(void); 64 void phNxpUciHal_process_response(); 65 void phNxpUciHal_handle_set_country_code(const char country_code[2]); 66 bool phNxpUciHal_handle_set_app_config(size_t *data_len, uint8_t *p_data); 67 68 // Handles CORE_GET_CAPS_INFO_RSP 69 // Returns true if the packet is patched / reported to upper layer. 70 bool phNxpUciHal_handle_get_caps_info(size_t data_len, const uint8_t *p_data); 71 72 void apply_per_country_calibrations(void); 73 #endif /* _PHNXPNICHAL_EXT_H_ */ 74