1 #ifndef DBG_MWSGEN_H_
2 #define DBG_MWSGEN_H_
3 
4 /**
5  ****************************************************************************************
6  * @addtogroup DBGMWSGEN
7  * @ingroup DBG
8  * @brief Debug SW - MWS/WLAN Generator.
9  *
10  * @{
11  ****************************************************************************************
12  */
13 
14 /*
15  * INCLUDE FILES
16  ****************************************************************************************
17  */
18 #include "rwip_config.h"
19 
20 #if (RW_WLAN_COEX_TEST) || (RW_MWS_COEX_TEST)
21 
22 #include "reg_mwsgen.h"       // MWS Event Generator register functions
23 
24 /*
25  * CONSTANT DEFINITIONS
26  ****************************************************************************************
27  */
28 
29 #if (RW_WLAN_COEX)
30 /// WLAN coexistence disabled
31 #define DBG_COEX_WLAN_DISABLED    0
32 /// WLAN coexistence enabled
33 #define DBG_COEX_WLAN_ENABLED     1
34 #endif
35 
36 #if (RW_MWS_COEX)
37 /// MWS coexistence disabled
38 #define DBG_COEX_MWS_DISABLED     0
39 /// MWS coexistence enabled
40 #define DBG_COEX_MWS_ENABLED      1
41 #endif
42 
43 /*
44  * VARIABLE DECLARATION
45  ****************************************************************************************
46  */
47 #if (RW_WLAN_COEX_TEST)
48 extern uint32_t dbg_coex_scenario;
49 #endif // RW_WLAN_COEX_TEST
50 
51 #if (RW_MWS_COEX_TEST)
52 extern uint32_t dbg_coex_scenario;
53 #endif // RW_MWS_COEX_TEST
54 
55 /*
56  * FUNCTION DECLARATIONS
57  ****************************************************************************************
58  */
59 
60 #if (RW_MWS_COEX_TEST)
61 /**
62  ****************************************************************************************
63  * @brief Set the scenario for the unitary testing.
64  *
65  * @param[in] scenario    Scenario type
66  *
67  * @return none
68  *
69  ****************************************************************************************
70  */
71 uint8_t dbg_mwscoex_scen_set(uint32_t scenario);
72 
73 /**
74  ****************************************************************************************
75  * @brief Initialize and configure MWS event generator registers to be in MWS mode.
76  ****************************************************************************************
77  */
78 void dbg_mwsgen_init(void);
79 
80 /**
81  ****************************************************************************************
82  * @brief Configure MWS generator
83  *
84  * @param[in]  period       Period of the mws signal (us)
85  * @param[in]  duty_cycle   Duration of the high level (us)
86  * @param[in]  tx_act       Duration of the tx activity (us)
87  * @param[in]  rx_act       Duration of the rx activity (us)
88  *
89  ****************************************************************************************
90  */
91 void dbg_mwsgen_config(uint32_t period, uint32_t duty_cycle, uint32_t tx_act, uint32_t rx_act);
92 
93 /**
94  ****************************************************************************************
95  * @brief Configure the WLAN COEX mode for BT.
96  *
97  * @param[in]  txmode
98  * @param[in]  rxmode
99  * @param[in]  txmsk
100  * @param[in]  rxmsk
101  * @param[in]  txfmsk
102  * @param[in]  rxfmsk
103  * @param[in]  scanfmsk
104  * @param[in]  knudge
105  *
106  ****************************************************************************************
107  */
108 void dbg_mws_config(uint8_t txmode, uint8_t rxmode, uint8_t txmsk, uint8_t rxmsk, uint8_t txfms, uint8_t rxfmsk, uint8_t scanfmsk, uint8_t knudge);
109 
110 /**
111  ****************************************************************************************
112  * @brief Start the MWS signal generator.
113  *
114  ****************************************************************************************
115  */
116 void dbg_mwsgen_start(void);
117 
118 /**
119  ****************************************************************************************
120  * @brief Stop the MWS signal generator.
121  *
122  ****************************************************************************************
123  */
124 void dbg_mwsgen_stop(void);
125 #endif // RW_MWS_COEX_TEST
126 
127 #if (RW_WLAN_COEX_TEST)
128 /**
129  ****************************************************************************************
130  * @brief Set the scenario for the unitary testing.
131  *
132  * @param[in] scenario    Scenario type
133  *
134  * @return none
135  *
136  ****************************************************************************************
137  */
138 
139 uint8_t dbg_wlcoex_scen_set(uint32_t scenario);
140 
141 /**
142  ****************************************************************************************
143  * @brief Initialize and configure MWS event generator registers to be in WLAN mode.
144  ****************************************************************************************
145  */
146 void dbg_wlangen_init(void);
147 
148 /**
149  ****************************************************************************************
150  * @brief Set the period and duty cycle for the wlrxbsy signal.
151  *
152  * @param[in]  period       Period of the wlrxbsy signal (us)
153  * @param[in]  duty_cycle   Duration of the high level (us)
154  * @param[in]  tx_act       Duration of the tx activity (us)
155  * @param[in]  rx_act       Duration of the rx activity (us)
156  *
157  ****************************************************************************************
158  */
159 void dbg_wlangen_config(uint32_t period, uint32_t duty_cycle, uint32_t tx_act, uint32_t rx_act);
160 
161 /**
162  ****************************************************************************************
163  * @brief Configure the WLAN COEX mode for BT.
164  *
165  * @param[in]  txmode
166  * @param[in]  rxmode
167  * @param[in]  txmsk
168  * @param[in]  rxmsk
169  * @param[in]  txthr
170  * @param[in]  rxthr
171  * @param[in]  pduration
172  * @param[in]  pdelay
173  *
174  ****************************************************************************************
175  */
176 void dbg_wlan_config(uint8_t txmode, uint8_t rxmode, uint8_t txmsk, uint8_t rxmsk, uint8_t txthr, uint8_t rxthr, uint8_t pduration, uint8_t pdelay);
177 
178 /**
179  ****************************************************************************************
180  * @brief Start the wlrxbs signal generator.
181  *
182  ****************************************************************************************
183  */
184 void dbg_wlangen_start(void);
185 
186 /**
187  ****************************************************************************************
188  * @brief Stop the wlrxbs signal generator.
189  *
190  ****************************************************************************************
191  */
192 void dbg_wlangen_stop(void);
193 #endif // RW_WLAN_COEX_TEST
194 
195 #endif // (RW_WLAN_COEX_TEST) || (RW_MWS_COEX_TEST)
196 
197 /// @} DBGMWSGEN
198 
199 #endif // DBG_MWSGEN_H_
200