• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 Winner Microelectronics Co., Ltd. All rights reserved.
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  */
15 
16 #ifndef __LITEPOINT_H
17 #define __LITEPOINT_H
18 #include "wm_type_def.h"
19 typedef struct _ltpt_rx_info {
20     volatile int cnt_total;
21     volatile int cnt_good;
22     volatile int cnt_bad;
23     volatile unsigned char valid;
24     volatile unsigned char snr;
25     volatile unsigned char rcpi;
26     volatile unsigned char rate;
27     volatile unsigned char channel;
28     volatile unsigned char bandwidth;
29     volatile unsigned char bprocess;
30 }ltpt_rx_info;
31 
32 typedef struct _ltpt_tx_info {
33     volatile int cnt_total;
34     volatile int packetcount;
35     volatile int psdulen;
36     /* input parameters */
37     volatile unsigned char txgain;
38     volatile unsigned char datarate;
39     volatile unsigned char gimode;
40     volatile unsigned char greenfield;
41     volatile unsigned char rifs;
42     volatile unsigned char bprocess;
43     volatile unsigned char channel;
44     volatile unsigned char longpreamble;
45 }ltpt_tx_info;
46 
47 enum Rate {
48     S2M = 0x0000,
49     S5M5 = 0x0001,
50     S11M = 0x0002,
51     L1M = 0x0003,
52     L2M = 0x0004,
53     L5M5 = 0x0005,
54     L11M = 0x0006,
55     R06M = 0x0100,
56     R09M = 0x0101,
57     R12M = 0x0102,
58     R18M = 0x0103,
59      R24M = 0x0104,
60     R36M = 0x0105,
61     R48M = 0x0106,
62     R54M = 0x0107,
63     MCS0 = 0x0200,
64     MCS1 = 0x0201,
65     MCS2 = 0x0202,
66     MCS3 = 0x0203,
67     MCS4 = 0x0204,
68     MCS5 = 0x0205,
69     MCS6 = 0x0206,
70     MCS7 = 0x0207,
71     MCS8 = 0x0208,
72     MCS9 = 0x0209,
73     MCS10 = 0x0210,
74     MCS11 = 0x0211,
75     MCS12 = 0x0212,
76     MCS13 = 0x0213,
77     MCS14 = 0x0214,
78     MCS15 = 0x0215,
79     MCS32 = 0x0232,
80 };
81 
82 extern volatile int g_ltpt_testmode;
83 extern ltpt_rx_info *g_ltpt_rxinfo;
84 extern ltpt_tx_info *g_ltpt_txinfo;
85 extern unsigned char hed_rf_txgainmap[];
86 extern const unsigned int hed_bbp_value[];
87 
88 void tls_litepoint_start(void);
89 void tls_tx_send_litepoint(void);
90 void tls_set_test_channel(u8 channel, u8 bandwidth);
91 void tls_tx_litepoint_test_start(u32 tempcomp, u32 Packetcnt, u16 Psdulen,
92                                  u32 Gain, u32 TxRate, u8 GiMode, u8 Gf, u8 Rifs);
93 void tls_txrx_litepoint_test_stop(void);
94 void tls_txrx_litepoint_clear_data(void);
95 int  tls_tx_litepoint_test_get_totalsnd(void);
96 void tls_rx_litepoint_test_start(u32 Channel, u32 BandWidth);
97 void tls_rx_litepoint_test_result(u32 *total, u32 *goodcnt, u32 *badcnt);
98 void tls_tx_litepoint_param_update(u8 Gain, u8 TxRate);
99 void tls_rx_litepoint_test_rate(u8 rate);
100 void tls_rx_litepoint_pwr_result(u32 *valid, u32 *snr, u32 *rcpi);
101 void tls_tx_litepoint_period(u32 period);
102 u32  tls_get_tx_litepoint_period(void);
103 void tls_set_tx_litepoint_period(u32 period);
104 void tls_lp_notify_lp_tx_data(void);
105 #endif
106