• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 EXT_UCI_MSG_DBG_DATA_LOGGER_NTF 0x01
39 #define EXT_UCI_MSG_DBG_GET_ERROR_LOG 0x02
40 #define EXT_UCI_MSG_DBG_PSDU_LOG_NTF 0x33
41 #define EXT_UCI_MSG_DBG_CIR_LOG_NTF 0x34
42 
43 #define EXT_UCI_PROP_GEN_DEBUG_NTF_0x18        0x18
44 
45 #define UCI_PARAM_ID_LOW_POWER_MODE            0x01
46 
47 /* customer specific calib params */
48 #define VENDOR_CALIB_PARAM_TX_POWER_PER_ANTENNA 0x04
49 
50 /* Proprietary GID */
51 #define UCI_GID_PROPRIETARY_0x0F 0x0F
52 
53 /* Customer Specific  OID */
54 #define SET_VENDOR_SET_CALIBRATION 0x21
55 
56 #define RMS_TX_POWER_SHIFT 8
57 #define UCI_RMS_TX_POWER_INDEX 7
58 #define UCI_RMS_TX_POWER_LEN 2
59 
60 /* Extended Uci status Reason code */
61 #define UCI_EXT_STATUS_SE_RECOVERY_FAILURE  0x72
62 #define UCI_EXT_STATUS_SE_RECOVERY_SUCCESS  0x73
63 #define UCI_EXT_STATUS_SE_APDU_CMD_FAIL     0x74
64 #define UCI_EXT_STATUS_SE_AUTH_FAIL         0x75
65 
66 tHAL_UWB_STATUS phNxpUciHal_send_ext_cmd(size_t cmd_len, const uint8_t* p_cmd);
67 tHAL_UWB_STATUS phNxpUciHal_process_ext_rsp(size_t cmd_len, uint8_t* p_buff);
68 tHAL_UWB_STATUS phNxpUciHal_set_board_config();
69 void phNxpUciHal_handle_set_calibration(uint8_t *p_data, size_t data_len);
70 void phNxpUciHal_extcal_handle_coreinit(void);
71 void phNxpUciHal_process_response();
72 void phNxpUciHal_handle_set_country_code(const char country_code[2]);
73 bool phNxpUciHal_handle_set_app_config(size_t *data_len, uint8_t *p_data);
74 
75 // Handles CORE_GET_CAPS_INFO_RSP
76 // Returns true if the packet is patched / reported to upper layer.
77 bool phNxpUciHal_handle_get_caps_info(size_t data_len, const uint8_t *p_data);
78 
79 void apply_per_country_calibrations(void);
80 #endif /* _PHNXPNICHAL_EXT_H_ */
81