1 #if CONFIG_WLS_CSI_PROC
2 /** @file wls_param_defines.h
3  *
4  * @brief This file contains global header file for configuring fft processing of CSI.
5  *
6  * Copyright 2023-2024 NXP
7  *
8  * SPDX-License-Identifier: BSD-3-Clause
9  *
10  */
11 
12 /************************************************************************
13  * DFW Global header file for configuring fft processing of CSI.
14  ************************************************************************/
15 
16 #ifndef WLS_PARAM_DEFINES_H
17 #define WLS_PARAM_DEFINES_H
18 
19 #define _BIN 0
20 #define _TXT 1
21 #define _TTL 2
22 
23 #define INPUT_FILE _TXT
24 // #define SMAC_BFINFO
25 
26 #ifdef SMAC_BFINFO
27 #define CSI_SIGNATURE      0x0
28 #define HEADER_LEN         0x15
29 #define CSI_BUFFER_SIZE_DW (1024 * 2 + 64)
30 #define CSI_NUM_BUFFER     32
31 #else
32 #define CSI_SIGNATURE      0xabcd0000
33 #define HEADER_LEN         28
34 #define CSI_BUFFER_SIZE_DW (512 + 64) // 1536 // 512 //
35 #define CSI_NUM_BUFFER     32         // 16 //
36 #endif
37 
38 #define ENABLE_SUBSPACE_FTIMING
39 // #define ENABLE_AOA
40 // #define FFT_PARALLEL
41 // #define FFT_INPLACE
42 // #define TDDE_FIRSTPATH
43 #define STA_20_ONLY
44 
45 #define MAX_RX 1
46 #define MAX_TX 4
47 
48 #if defined(FFT_PARALLEL)
49 #define NUM_PARALLEL 4
50 #else
51 #define NUM_PARALLEL 1
52 #endif
53 
54 #if defined(ENABLE_SUBSPACE_FTIMING) && defined(STA_20_ONLY)
55 #define NUM_PROC_BUF (11 + NUM_PARALLEL)
56 #elif defined(ENABLE_SUBSPACE_FTIMING)
57 #define NUM_PROC_BUF (2 + NUM_PARALLEL)
58 #else
59 #define NUM_PROC_BUF (NUM_PARALLEL)
60 #endif
61 
62 #define DUMP_MULTP_PEAKS 3
63 
64 #define _SC4B0_1760_20MHz 0
65 #define _SC4B0_0026_20MHz 1
66 #define _SC4B0_F69C_20MHz 2
67 #define _SC4B0_F798_20MHz 3
68 #define _SC4B0_0354_20MHz 4
69 #define _SC4B0_12C7_20MHz 5
70 #define _SC4B0_127D_20MHz 6
71 #define _SC4B0_0929_20MHz 7
72 #define _SC4B0_0F0B_20MHz 8
73 
74 #define _USE_DEFAULT_CAL 0xFF
75 
76 #define RX_A 0
77 #define RX_B 1
78 #define RX_C 2
79 #define RX_D 3
80 
81 #define BAND_2P4GHZ 0
82 #define BAND_5GHZ   1
83 
84 #define REF_ANTENNA RX_D
85 
86 #define ANTENNA_SPACING_MM 27
87 #define DEFAULT_CHANNEL    36
88 #define DEFAULT_FREQ_BAND  BAND_5GHZ // needs to match DEFAULT_CHANNEL
89 #define DEFAULT_TSF        0
90 #define DEFAULT_FTM_INIT   0
91 #define DEFAULT_FTM_FORMAT 0xD // vht80
92 #define ENABLE_DELAY_PEAKS 1
93 
94 #define DEFAULT_CAL_LOW_A 0x3de  // 0x3d1
95 #define DEFAULT_CAL_LOW_B 0x23d  // 0x222
96 #define DEFAULT_CAL_LOW_C 0x37f  // 0x399
97 
98 #define DEFAULT_CAL_HIGH_A 0x386 // 0x37f
99 #define DEFAULT_CAL_HIGH_B 0x1ff // 0x1e6
100 #define DEFAULT_CAL_HIGH_C 0x362 // 0x37c
101 
102 #define SCREEN_OUT
103 #ifdef SCREEN_OUT
104 // #define SMAC_LOG printf("\n");printf
105 #define HAL_LOG(...) printf(__VA_ARGS__); // printf("\n")
106 #else
107 #define HAL_LOG(...)
108 #endif
109 
110 #define TOA_MIN_DEFAULT  0
111 #define SUBSPACE_DEFAULT 1
112 #define AOA_DEFAULT      0
113 
114 #ifndef ARM
115 // #define FLOATING_POINT
116 #endif
117 
118 // #define DEBUG_OUT_FD
119 
120 #define MAX_TSF_DIFF_POS 10
121 #define MAX_TSF_DIFF_NEG -120
122 
123 #define CAL_DATA _USE_DEFAULT_CAL
124 
125 #define IFFT_OSF_SHIFT 2
126 // #define IFFT_OSF (1<<IFFT_OSF_SHIFT)
127 #define SPATIAL_RES          64 // number of angular bins
128 #define NUM_MAX_PEAKS        32 // max number of angle/delay peaks to keep
129 #define DELAY_DELTA_SHIFT    4
130 #define FFT_ADV_FRAC         16
131 #define TD_FRAC_OF_FFT       4     // as fraction of 3.2 microseconds
132 #define TD_FRAC_OF_FFT_HE    2     // to account for 2x/4x CP lengths
133 #define PEAK_THRESH_SHIFT    2     // consider peaks up to 6 dB below peak
134 #define PEAK_THRESH_MIN_ABS  0xA00 // (0.1976)^2=0.0391 0xC00 // 3/64=0.0469 0x1400 // 5/64=0.0781 in p16
135 #define SUBBAND_DET_THRESH   4     // 18 dB
136 #define REMOVE_IIR           2
137 #define COMPUTE_80P80_AS_160       // or true 160 in SC4+Citril
138 #define TOA_FPATH_BIPT       12
139 
140 #ifdef STA_20_ONLY
141 #define MAX_IFFT_SIZE_SHIFT 2
142 #else // up to 80 MHz
143 #define MAX_IFFT_SIZE_SHIFT 5
144 #endif
145 #define MIN_IFFT_SIZE_SHIFT 1
146 #define MAX_IFFT_SIZE_CSI   (64 << MAX_IFFT_SIZE_SHIFT)
147 #define MIN_IFFT_SIZE_CSI   (64 << MIN_IFFT_SIZE_SHIFT)
148 
149 #define MPY_BIPT     12
150 #define MY_SQRT_BIPT 8
151 
152 #define IIR_FORMAT_NP 12
153 #define IIR_FORMAT_NB 16
154 
155 // #define CAL_FORMAT_NP 12
156 #define CAL_FORMAT_NP 10
157 #define CAL_FORMAT_NB 16
158 
159 #define VAC_LIGHTSPEED_MM_MICROSEC   300000
160 #define CABLE_LIGHTSPEED_MM_MICROSEC 200000
161 
162 #define PI                 3.141592653589795f
163 #define ONE_OVER_PIE_16P15 0x28BE
164 
165 #define SC5_VHT80_PILOTS 8
166 #define SC5_VHT40_PILOTS 6
167 #define SC5_VHT20_PILOTS 4
168 #define SC5_HE80_PILOTS  8
169 #define SC5_HE40_PILOTS  8
170 #define SC5_HE20_PILOTS  4
171 #define SC5_HT20_PILOTS  27
172 
173 #endif
174 
175 #endif /* CONFIG_WLS_CSI_PROC */
176