• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  * Description: NV common header file.
15  */
16 
17 #ifndef __NV_COMMON_CFG_H__
18 #define __NV_COMMON_CFG_H__
19 
20 #include "stdint.h"
21 /* 修改此文件后需要先编译A核任意版本生成中间文件application.etypes后才能在编译nv.bin时生效 */
22 #define WLAN_MAC_ADDR_LEN 6
23 #define WLAN_COUNTRY_CODE_LEN 2
24 #define WLAN_XO_TRIM_TEMP_LEN 8
25 #define WLAN_RF_FE_RX_LOSS_NUM 3
26 #define WLAN_RF_FE_MAX_POWER_NUM 1
27 #define WLAN_RF_FE_TARGET_POWER_NUM 33
28 #define WLAN_RF_FE_LIMIT_POWER_NUM 56
29 #define WLAN_RF_FE_SAR_POWER_NUM 3
30 #define WLAN_RF_FE_RSSI_COMP_NUM 3
31 #define WLAN_RF_FE_REF_POWER_NUM 6
32 #define WLAN_RF_FE_POWER_CURVE_NUM 9
33 #define WLAN_RF_FE_CURVE_FACTOR_NUM 6
34 #define WLAN_RF_FE_CALI_DATA_LEN 1021   // 校准数据结构总共1024长度 留给数据的1021 目前够用
35 #define WLAN_RF_FE_CALI_DATA_STRUCT_SIZE 1024
36 #define WLAN_HILINK_SSID_LEN 33
37 #define WLAN_HILINK_PWD_LEN 65
38 #define WLAN_HILINK_MAC_LEN 6
39 /* 基础类型无需在此文件中定义,直接引用即可,对应app.json中的sample0 */
40 
41 /* 普通结构体,对应app.json中的sample1 */
42 typedef struct {
43     int8_t param1;
44     int8_t param2;
45     uint32_t param3;
46     uint32_t param4;
47     uint8_t param5;
48 } sample1_type_t;
49 
50 /* 普通数组,对应app.json中的sample2 */
51 typedef struct {
52     uint8_t mac[WLAN_MAC_ADDR_LEN];
53 } mac_type_t;
54 
55 typedef struct {
56     uint8_t country[WLAN_COUNTRY_CODE_LEN];
57 } country_type_t;
58 
59 typedef struct {
60     int8_t xo_trim_temp_fine_code[WLAN_XO_TRIM_TEMP_LEN];
61 } xo_trim_temp_type_t;
62 
63 /* 多类型结构嵌套,对应app.json中的sample3 */
64 typedef struct {
65     uint32_t param1[WLAN_MAC_ADDR_LEN];
66     uint32_t param2;
67     uint8_t param3;
68     sample1_type_t param4;
69 } sample3_type_t;
70 
71 /* 更为复杂的结构体嵌套,对应app.json中的sample4 */
72 typedef struct {
73     sample1_type_t param1;
74     mac_type_t param2;
75     sample3_type_t param3;
76 } sample4_type_t;
77 
78 typedef struct {
79     uint8_t rx_insert_loss[WLAN_RF_FE_RX_LOSS_NUM];
80 } fe_rx_insert_loss_type_t;
81 
82 typedef struct {
83     uint8_t chip_max_power[WLAN_RF_FE_MAX_POWER_NUM];
84     uint8_t target_power[WLAN_RF_FE_TARGET_POWER_NUM];
85     uint8_t limit_power[WLAN_RF_FE_LIMIT_POWER_NUM];
86     uint8_t sar_power[WLAN_RF_FE_SAR_POWER_NUM];
87 } fe_tx_power_type_t;
88 
89 typedef struct {
90     uint8_t rx_rssi_comp[WLAN_RF_FE_RSSI_COMP_NUM];
91 } fe_rx_rssi_comp_type_t;
92 
93 typedef struct {
94     uint16_t ref_power[WLAN_RF_FE_REF_POWER_NUM];
95 } fe_tx_ref_power_type_t;
96 
97 typedef struct {
98     uint16_t power_curve[WLAN_RF_FE_POWER_CURVE_NUM];
99 } fe_tx_power_curve_type_t;
100 
101 typedef struct {
102     uint16_t curve_factor[WLAN_RF_FE_CURVE_FACTOR_NUM];
103 } fe_tx_curve_factor_type_t;
104 
105 typedef struct {
106     uint16_t cali_data_len;
107     uint8_t cali_data_received;
108     uint8_t data[WLAN_RF_FE_CALI_DATA_LEN];
109 } fe_cali_data_type_t;
110 
111 /* btc功率相关在此结构体中添加 */
112 typedef struct {
113     uint8_t btc_max_txpower;
114 } btc_power_type_t;
115 
116 /* 雷达算法相关在此结构体中添加 */
117 typedef struct {
118     uint8_t d_th_1m;              // dispersion
119     uint8_t d_th_2m;
120     uint8_t d_buf_cnt_1m;
121     uint8_t d_buf_cnt_2m;
122     uint8_t d_use_2md1m;
123     uint8_t d_use_1m_dfa;
124     uint8_t t_only_enable;
125     uint8_t d_th_1m_dfa;
126     uint8_t a_always;
127     uint8_t d_buf_cnt_1m_dfa;
128     uint8_t d_buf_cnt_2m_dfa;
129     uint8_t p_buf_cnt;           // presence
130     uint8_t p_th;
131     uint8_t t_th_1m;             // track
132     uint8_t t_th_2m;
133     uint8_t b_th_ratio;          // bitmap
134     uint8_t b_th_cnt;
135     uint8_t a_th;                // ai
136     uint8_t a_buf_cnt;
137     uint8_t res_0;
138 } radar_alg_param_t;
139 
140 typedef struct {
141     uint8_t height;               // 模组安装架高信息: 1/2/3米
142     uint8_t scenario;             // 场景: 家居/空旷
143     uint8_t wifi_mode;            // WIFI模式: STA/SOFTAP
144     uint8_t material;             // 模组视距方向遮挡材料: 塑料/金属
145     uint8_t fusion_track;         // 是否融合距离跟踪结果
146     uint8_t fusion_ai;            // 是否融合AI结果
147     uint16_t quit_dly_time;       // 退出时间
148 } radar_alg_ctrl_t;
149 
150 /* hilink配网 ssid与密码 */
151 typedef struct {
152     uint8_t ssid[WLAN_HILINK_SSID_LEN];
153     uint8_t pwd[WLAN_HILINK_PWD_LEN];
154     uint8_t bssid[WLAN_HILINK_MAC_LEN];
155 } hilink_connect_info_t;
156 #endif /* __NV_COMMON_CFG_H__ */
157