1 /**
2  *
3  * \file
4  *
5  * \brief WINC ATE Test Driver Interface.
6  *
7  * Copyright (c) 2016-2017 Atmel Corporation. All rights reserved.
8  *
9  * \asf_license_start
10  *
11  * \page License
12  *
13  * Redistribution and use in source and binary forms, with or without
14  * modification, are permitted provided that the following conditions are met:
15  *
16  * 1. Redistributions of source code must retain the above copyright notice,
17  *    this list of conditions and the following disclaimer.
18  *
19  * 2. Redistributions in binary form must reproduce the above copyright notice,
20  *    this list of conditions and the following disclaimer in the documentation
21  *    and/or other materials provided with the distribution.
22  *
23  * 3. The name of Atmel may not be used to endorse or promote products derived
24  *    from this software without specific prior written permission.
25  *
26  * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
27  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
28  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
29  * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
30  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
35  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36  * POSSIBILITY OF SUCH DAMAGE.
37  *
38  * \asf_license_stop
39  *
40  */
41 
42 #ifdef _M2M_ATE_FW_
43 
44 #ifndef _M2M_ATE_MODE_H_
45 #define _M2M_ATE_MODE_H_
46 
47 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
48 INCLUDES
49 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
50 #include "common/include/nm_common.h"
51 #include "driver/include/m2m_types.h"
52 
53 /** \defgroup m2m_ate ATE
54 */
55 /**@defgroup  ATEDefine Defines
56  * @ingroup m2m_ate
57  * @{
58  */
59 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
60 MACROS
61 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
62 #define M2M_ATE_MAX_NUM_OF_RATES		(20)
63 /*!<
64 Maximum number of all rates (b,g and n)
65  */
66 #define M2M_ATE_MAX_FRAME_LENGTH		(1024)
67 /*!< Maximum number of length for each frame
68  */
69 #define M2M_ATE_MIN_FRAME_LENGTH		(1)
70 /*!< Minimum number of length for each frame
71  */
72 #define M2M_ATE_SUCCESS					(M2M_SUCCESS)
73 /*!< No Error and operation has been completed successfully.
74 */
75 #define M2M_ATE_ERR_VALIDATE			(M2M_ERR_FAIL)
76 /*!< Error in parameters passed to functions.
77  */
78 #define M2M_ATE_ERR_TX_ALREADY_RUNNING	(-1)
79 /*!< Error in starting a transmission test. Another test is already running and its not allowed to start another ATE test.
80  */
81 #define M2M_ATE_ERR_RX_ALREADY_RUNNING	(-2)
82 /*!< Error in starting a reception test. Another test is already running and its not allowed to start another ATE test.
83  */
84 #define M2M_ATE_ERR_UNHANDLED_CASE		(-3)
85 /*!< Invalid case.
86  */
87 #define M2M_ATE_RX_DISABLE_DA          		0x0
88 /*!< Filter selection for received frames: Disable filtering received frames by the destination address.
89  */
90 #define M2M_ATE_RX_ENABLE_DA          		0x1
91 /*!< Filter selection for received frames: Enable filtering received frames by the destination address.
92  */
93 #define M2M_ATE_RX_DISABLE_SA          		0x0
94 /*!< Filter selection for received frames: Disable filtering received frames by the source address.
95  */
96 #define M2M_ATE_RX_ENABLE_SA          		0x1
97 /*!< Filter selection for received frames: Enable filtering received frames by the source address.
98  */
99 #define M2M_ATE_DISABLE_SELF_MACADDR       0x0
100 /*!<Disable setting a new mac address through the ATE test application and use the pre-set mac address in the firmware.
101  */
102 #define M2M_ATE_SET_SELF_MACADDR         	0x1
103 /*!<Enable setting a new mac address through the ATE test application and use the pre-set mac address.
104  */
105 #define M2M_ATE_TX_DUTY_MAX_VALUE	M2M_ATE_TX_DUTY_1
106 /*!< The maximum value of duty cycle
107 */
108 #define M2M_ATE_TX_DUTY_MIN_VALUE	M2M_ATE_TX_DUTY_10
109 /*!< The minimum value of duty cycle
110 */
111   //@}
112 /**@defgroup  ATEDataTypes DataTypes
113  * @ingroup m2m_ate
114  * @{
115  */
116 
117 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
118 DATA TYPES
119 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
120 /*!
121  *@enum		tenuM2mAteFwState
122  *@brief	Enumeration used to change ATE firmware states
123  */
124 typedef enum {
125 	M2M_ATE_FW_STATE_STOP			= 0x00,
126 	/*!< State to stop ATE firmware
127 	 */
128 	M2M_ATE_FW_STATE_RUN			= 0x01,
129 	/*!< State to run ATE firmware
130 	 */
131 }tenuM2mAteFwState;
132 
133 /*!
134  *@enum		tenuM2mAteTxRates
135  *@brief	Enumeration used to index the TX rates that can be used during the transmission test.
136  */
137 typedef enum {
138 	M2M_ATE_TX_RATE_1_Mbps_INDEX	= 0x00,
139 	M2M_ATE_TX_RATE_2_Mbps_INDEX	= 0x01,
140 	M2M_ATE_TX_RATE_55_Mbps_INDEX	= 0x02,
141 	M2M_ATE_TX_RATE_11_Mbps_INDEX	= 0x03,
142 	/*!< B-Rates
143 	 */
144 	M2M_ATE_TX_RATE_6_Mbps_INDEX	= 0x04,
145 	M2M_ATE_TX_RATE_9_Mbps_INDEX	= 0x05,
146 	M2M_ATE_TX_RATE_12_Mbps_INDEX	= 0x06,
147 	M2M_ATE_TX_RATE_18_Mbps_INDEX	= 0x07,
148 	M2M_ATE_TX_RATE_24_Mbps_INDEX	= 0x08,
149 	M2M_ATE_TX_RATE_36_Mbps_INDEX	= 0x09,
150 	M2M_ATE_TX_RATE_48_Mbps_INDEX	= 0x0A,
151 	M2M_ATE_TX_RATE_54_Mbps_INDEX	= 0x0B,
152 	/*!< G-Rates
153 	 */
154 	M2M_ATE_TX_RATE_MCS_0_INDEX		= 0x0C,
155 	M2M_ATE_TX_RATE_MCS_1_INDEX		= 0x0D,
156 	M2M_ATE_TX_RATE_MCS_2_INDEX		= 0x0E,
157 	M2M_ATE_TX_RATE_MCS_3_INDEX		= 0x0F,
158 	M2M_ATE_TX_RATE_MCS_4_INDEX		= 0x10,
159 	M2M_ATE_TX_RATE_MCS_5_INDEX		= 0x11,
160 	M2M_ATE_TX_RATE_MCS_6_INDEX		= 0x12,
161 	M2M_ATE_TX_RATE_MCS_7_INDEX		= 0x13,
162 	/*!< N-Rates
163 	 */
164 }tenuM2mAteTxIndexOfRates;
165 
166 /*!
167  *@enum		tenuM2mAteTxDutyCycle
168  *@brief	Enumeration used to index the TX duty cycle that can be used during the transmission test.
169  */
170 typedef enum {
171 	M2M_ATE_TX_DUTY_1				= 0x01,
172 	M2M_ATE_TX_DUTY_2				= 0x02,
173 	M2M_ATE_TX_DUTY_3				= 0x03,
174 	M2M_ATE_TX_DUTY_4				= 0x04,
175 	M2M_ATE_TX_DUTY_5				= 0x05,
176 	M2M_ATE_TX_DUTY_6				= 0x06,
177 	M2M_ATE_TX_DUTY_7				= 0x07,
178 	M2M_ATE_TX_DUTY_8				= 0x08,
179 	M2M_ATE_TX_DUTY_9				= 0x09,
180 	M2M_ATE_TX_DUTY_10				= 0xA0,
181 }tenuM2mAteTxDutyCycle;
182 
183 /*!
184  *@enum		tenuM2mAteTxDpdControl
185  *@brief	Enumeration for the allowed Digital-pre distortion(DPD) control values.
186  */
187 typedef enum {
188 	M2M_ATE_TX_DPD_DYNAMIC	= 0x00,
189 	/*!< Dynamic mode indicates that DPD values will be set dynamically from a lookup table pre-set with the DPD coefficents.
190 	*/
191 	M2M_ATE_TX_DPD_BYPASS	= 0x01,
192 	/*!< Bypass mode indicates that the DPD control will be bypassed.
193 	*/
194 	M2M_ATE_TX_DPD_ENABLED	= 0x02,
195 	/*!< Enabled mode allows the tester to manually set the DPD coefficients.
196 	*/
197 }tenuM2mAteTxDpdControl;
198 
199 /*!
200  *@enum		tenuM2mAteTxGainSetting
201  *@brief	Enumeration for the allowed TX gain selection modes.
202  */
203 typedef enum {
204 	M2M_ATE_TX_GAIN_DYNAMIC	= 0x00,
205 	/*!< Dynamic mode indicates that Tx gain values for the digital gain,pa and ppa, will be set dynamically from a lookup table based on the Tx_rate configured.
206 	*/
207 	M2M_ATE_TX_GAIN_BYPASS	= 0x01,
208 	/*!< Bypass mode indicates that Tx gain configurations will be bypassed.
209 	*/
210 	M2M_ATE_TX_GAIN_FCC		= 0x02,
211 	/*!< Using the FCC tx gain configuration indicates that the tx gain values will be used from the FCC flashed table(pre-configured values from a customer).
212 	*/
213 	M2M_ATE_TX_GAIN_TELEC	= 0x03,
214 	/*!< Using the TELEC tx gain configuration indicates that the tx gain values will be used from the TELEC flashed table(pre-configured values from a customer).
215 	*/
216 }tenuM2mAteTxGainSetting;
217 
218 /*!
219  *@enum		tenuM2mAtePMUSetting
220  *@brief	Used to Enable PMU or disable it
221  */
222 typedef enum {
223 	M2M_ATE_PMU_DISBLE	= 0x00,
224 	/*!< Disable using PMU mode
225 	*/
226 	M2M_ATE_PMU_ENABLE	= 0x01,
227 	/*!< Enable using PMU mode
228 	*/
229 }tenuM2mAtePMUSetting;
230 
231 /*!
232  *@enum	 tenuM2mAteTxSource
233  *@brief	Used to define the Tx source, either PHY mode or MAC mode.
234  */
235 typedef enum {
236 	M2M_ATE_TX_SRC_MAC	= 0x00,
237 	/*!< When the TX Source is set to MAC, it indicates that the TX frames are manually framed and sent from the MAC layer
238 	*/
239 	M2M_ATE_TX_SRC_PHY	= 0x01,
240 	/*!< When the TX source is set to PHY, it indicates that transmission sequence occurs from PHY layer in the form of  pulses
241 	*/
242 }tenuM2mAteTxSource;
243 
244 /*!
245  *@enum	tenuM2mAteTxMode
246  *@brief	Used to define the mode of PHY TX transmission source: Continuous Wave(CW) or Normal(i.e CW is disabled) TX sequence
247  */
248 typedef enum {
249 	M2M_ATE_TX_MODE_NORM	= 0x00,
250 	/*!< When the TX source is set to PHY,normal mode indicates that continous transmission is disabled.
251 	*/
252 	M2M_ATE_TX_MODE_CW		= 0x01,
253 	/*!< When the TX source is set to PHY, continous mode indicates that transmission sequences occur back to back in a continous wave from the PHY layer.
254 	*/
255 }tenuM2mAteTxMode;
256 
257 /*!
258  *@enum		tenuM2mAteRxPwrMode
259  *@brief	Used to define type of RX mode either high power or low power
260  */
261 typedef enum {
262 	M2M_ATE_RX_PWR_HIGH	= 0x00,
263 	/*!< Indicates that receive mode is operating at high power
264 	*/
265 	M2M_ATE_RX_PWR_LOW	= 0x01,
266 	/*!< Indicates that receive mode is operating at low power
267 	*/
268 }tenuM2mAteRxPwrMode;
269 
270 /*!
271  *@enum		tenuM2mAteChannels
272  *@brief	Available channels for TX and RX in the 2.4GHz spectrum starting at 2412MHz with a 5MHz bandwidth.
273  */
274 typedef enum {
275 	M2M_ATE_CHANNEL_1	= 0x01,
276 	/*!< Channel 1: 2412MHz
277 	 */
278 	M2M_ATE_CHANNEL_2	= 0x02,
279 	/*!< Channel 2: 2417MHz
280 	 */
281 	M2M_ATE_CHANNEL_3	= 0x03,
282 	/*!< Channel 3: 2422MHz
283 	 */
284 	M2M_ATE_CHANNEL_4	= 0x04,
285 	/*!< Channel 4: 2427MHz
286 	 */
287 	M2M_ATE_CHANNEL_5	= 0x05,
288 	/*!< Channel 5: 2432MHz
289 	 */
290 	M2M_ATE_CHANNEL_6	= 0x06,
291 	/*!< Channel 6: 2437MHz
292 	 */
293 	M2M_ATE_CHANNEL_7	= 0x07,
294 	/*!< Channel 7: 2442MHz
295 	 */
296 	M2M_ATE_CHANNEL_8	= 0x08,
297 	/*!< Channel 8: 2447MHz
298 	 */
299 	M2M_ATE_CHANNEL_9	= 0x09,
300 	/*!< Channel 9: 2452MHz
301 	 */
302 	M2M_ATE_CHANNEL_10	= 0x0A,
303 	/*!< Channel 10: 2462MHz
304 	 */
305 	M2M_ATE_CHANNEL_11	= 0x0B,
306 	/*!< Channel 11: 2467MHz
307 	 */
308 	M2M_ATE_CHANNEL_12	= 0x0C,
309 	/*!< Channel 12: 2472MHz
310 	 */
311 	M2M_ATE_CHANNEL_13	= 0x0D,
312 	/*!< Channel 13: 2472MHz
313 	 */
314 	M2M_ATE_CHANNEL_14	= 0x0E,
315 	/*!< Channel 14: 2484MHz
316 	 */
317 }tenuM2mAteChannels;
318 
319 /*!
320  *@struct	tstrM2mAteRxStatus
321  *@brief	Used to save statistics for receive(RX) test case
322  */
323 typedef struct {
324 	uint32 num_rx_pkts;
325 	/*!< Number of total RX packets
326 	 */
327 	uint32 num_err_pkts;
328 	/*!< Number of RX failed packets
329 	 */
330 	 uint32 num_good_pkts;
331 	/*!< Number of RX packets actually received
332 	 */
333 } tstrM2mAteRxStatus;
334 
335 /*!
336  *@struct	tstrM2mAteRxStatus
337  *@brief	Used to save recieve test case configuration
338  *@see    tenuM2mAteRxPwrMode
339  */
340 typedef struct {
341 	uint8 u8RxPwrMode;
342 	/*!< RX power mode review \ref tenuM2mAteRxPwrMode
343 	 */
344 } tstrM2mAteInit;
345 
346 /*!
347  *@struct	tstrM2mAteTx
348  *@brief	Used for the transmission(Tx) test configuration.
349  */
350 typedef struct {
351 	uint32	num_frames;
352 	/*!< Number of frames to be sent where maximum number allowed is 4294967295 ul, and ZERO means infinite number of frames
353 	 */
354 	uint32	data_rate;
355 	/*!< Rate to send packets, to select a rate use values from the enumeration \ref tenuM2mAteTxIndexOfRates and pass it to \ref m2m_ate_get_tx_rate
356 	 */
357 	uint8	channel_num;
358 	/*!< Channel number as enumerated at \ref tenuM2mAteChannels
359 	 */
360 	uint8    duty_cycle;
361 	/*!< Duty cycle value between from 1 to 10, where maximum = 1, minimum = 10. As enumerated \ref tenuM2mAteTxDutyCycle
362 	 */
363 	uint16    frame_len;
364     /*!< Use @ref M2M_ATE_MAX_FRAME_LENGTH (1024) as the maximum value while @ref M2M_ATE_MIN_FRAME_LENGTH (1) is the minimum value
365 	 */
366 	uint8     tx_gain_sel;
367 	/*!< TX gain mode selection value \ref tenuM2mAteTxGainSetting
368 	 */
369 	uint8     dpd_ctrl;
370 	/*!< DPD mode value\ref tenuM2mAteTxDpdControl
371 	 */
372 	uint8     use_pmu;
373 	/*!< This is 0 if PMU is not used otherwise it must be be 1 \ref tenuM2mAtePMUSetting
374 	 */
375 	uint8     phy_burst_tx;
376 	/*!< Source of Burst TX either PHY or MAC \ref tenuM2mAteTxSource
377 	 */
378 	uint8     cw_tx;
379 	/*!< Mode of Phy TX transmission either normal TX sequence or CW(Continuous Wave) TX sequence \ref tenuM2mAteTxMode
380 	 */
381 	uint32     xo_offset_x1000;
382 	/*!< Signed XO offset value in Part Per Million(PPM) multiplied by 1000.
383 	 */
384 	uint8     use_efuse_xo_offset;
385 	/*!< Set to 0 to use the XO offset provided in xo_offset_x1000. Set to 1 to use XO offset programmed on WINC efuse.
386 	*/
387 	uint8 peer_mac_addr[6];
388 	/*!< Set peer address to send directed frames to a certain address.
389 	*/
390 } tstrM2mAteTx;
391 
392 /*!
393  *@struct	tstrM2mAteRx
394  *@brief	Used for the reception(Rx) test configuration.
395  */
396 typedef struct {
397 	uint8		channel_num;
398 	/*!< Channel number \ref tenuM2mAteChannels
399 	 */
400 	uint8     use_pmu;
401 	/*!< This is 0 if PMU is not used otherwise it must be be 1 \ref tenuM2mAtePMUSetting
402 	 */
403 	uint32     xo_offset_x1000;
404 	/*!< Signed XO offset value in PPM (Part Per Million) multiplied by 1000.
405 	 */
406 	uint8     use_efuse_xo_offset;
407 	/*!< Set to 0 to use the XO offset provided in xo_offset_x1000. Set to 1 to use XO offset programmed on WINC efuse.
408 	*/
409 	uint8    self_mac_addr[6];
410 	/*!< Set to the self mac address required to be overriden.
411 	*/
412 	uint8    peer_mac_addr[6];
413 	/*!< Set to the source mac address expected to filter frames from.
414 	*/
415 	uint8    mac_filter_en_da;
416 	/*!< Flag set to enable or disable reception with destination address as a filter. Using the following flags \ref M2M_ATE_RX_ENABLE_DA
417 	\ref M2M_ATE_RX_DISABLE_DA
418 	*/
419 	uint8    mac_filter_en_sa;
420 	/*!< Flag set to enable or disable reception with source address as a filter.Using the following flags \ref M2M_ATE_RX_ENABLE_SA
421 	\ref M2M_ATE_RX_DISABLE_SA
422 	*/
423 	uint8   override_self_mac_addr;
424 	/*!< Flag set to enable or disable self mac address feature. Using the following flags \ref M2M_ATE_DISABLE_SELF_MACADDR
425 	\ref M2M_ATE_SET_SELF_MACADDR
426 	*/
427 } tstrM2mAteRx;
428   //@}
429 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
430 FUNCTION PROTOTYPES
431 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
432 #ifdef __cplusplus
433      extern "C" {
434 #endif
435 /**@defgroup  ATEFunction Function
436  * @ingroup m2m_ate
437  * @{
438  */
439 /*!
440 @fn	\
441 	sint8 m2m_ate_init(void);
442 
443 @brief
444 	This function used to download the ATE firmware from flash and start it.
445 
446 @return
447 	The function SHALL return @ref M2M_SUCCESS for success and a negative value otherwise.
448 @see
449 	m2m_ate_init_param
450 */
451 sint8 m2m_ate_init(void);
452 
453 
454 /*!
455 @fn	\
456 	sint8 m2m_ate_init(tstrM2mAteInit *pstrInit);
457 
458 @brief
459 	This function is used to download and start the ATE firmware with an initialization value
460 	stating the rx mode power \ref tstrM2mAteInit.
461 @param [in]	tstrM2mAteInit *
462 	Pointer to a structure \ref tstrM2mAteInit, defining the initial RX mode value.
463 @return
464 	The function SHALL return @ref M2M_SUCCESS for success and a negative value otherwise.
465 @see
466 	m2m_ate_init
467 */
468 sint8 m2m_ate_init_param(tstrM2mAteInit *pstrInit);
469 
470 /*!
471 @fn	\
472 	sint8 m2m_ate_deinit(void);
473 
474 @brief
475 	De-Initialization of ATE firmware mode
476 
477 @return
478 	The function SHALL return @ref M2M_SUCCESS for success and a negative value otherwise.
479 */
480 sint8 m2m_ate_deinit(void);
481 
482 /*!
483 @fn	\
484 	sint8 m2m_ate_set_fw_state(uint8);
485 
486 @brief
487 	This function is used to change the ATE firmware status from running to stopped or vice versa.
488 
489 @param [in]	u8State
490 		Required state of the ATE firmware, one of \ref tenuM2mAteFwState enumeration values.
491 @return
492 	The function SHALL return @ref M2M_SUCCESS for success and a negative value otherwise.
493 @see
494 	m2m_ate_init
495 */
496 sint8 m2m_ate_set_fw_state(uint8);
497 
498 /*!
499 @fn	\
500 	sint8 m2m_ate_get_fw_state(uint8);
501 
502 @brief
503 	This function is used to return the status of ATE firmware.
504 
505 @return
506 	The function SHALL return the status of ATE firmware, one of \ref tenuM2mAteFwState enumeration values.
507 @see
508 	m2m_ate_init, m2m_ate_set_fw_state
509 */
510 sint8 m2m_ate_get_fw_state(void);
511 
512 /*!
513 @fn	\
514 	uint32 m2m_ate_get_tx_rate(uint8);
515 
516 @brief
517 	This function is used to return value of TX rate required by application developer.
518 
519 @param [in]	u8Index
520 		Index of the required rate , one of \ref tenuM2mAteTxIndexOfRates enumeration values.
521 @return
522 	The function SHALL return 0 in case of receiving invalid index, otherwise the selected rate value is returned.
523 @see
524 	tenuM2mAteTxIndexOfRates
525 */
526 uint32 m2m_ate_get_tx_rate(uint8);
527 
528 /*!
529 @fn	\
530 	sint8 m2m_ate_get_tx_status(void);
531 
532 @brief
533 	This function is used to return the status of TX test case either running or stopped.
534 
535 @return
536 	The function SHALL return the status of ATE firmware, 1 if TX test case is running or 0 if TX test case has been stopped.
537 @see
538 	m2m_ate_start_tx, m2m_ate_stop_tx
539 */
540 sint8 m2m_ate_get_tx_status(void);
541 
542 /*!
543 @fn	\
544 	sint8 m2m_ate_start_tx(tstrM2mAteTx *)
545 
546 @brief
547 	This function is used to start the TX test case.
548 
549 @param [in]	strM2mAteTx
550 		Type of \ref tstrM2mAteTx, with the values required to enable TX test case. Application must use \ref m2m_ate_init first.
551 @return
552 	The function SHALL return 0 for success and a negative value otherwise.
553 @see
554 	m2m_ate_init, m2m_ate_stop_tx, m2m_ate_get_tx_status
555 */
556 sint8 m2m_ate_start_tx(tstrM2mAteTx *);
557 
558 /*!
559 @fn	\
560 	sint8 m2m_ate_stop_tx(void)
561 
562 @brief
563 	This function is used to stop the TX test case.
564 
565 @return
566 	The function SHALL return @ref M2M_SUCCESS for success and a negative value otherwise.
567 @see
568 	m2m_ate_init, m2m_ate_start_tx, m2m_ate_get_tx_status
569 */
570 sint8 m2m_ate_stop_tx(void);
571 
572 /*!
573 @fn	\
574 	sint8 m2m_ate_get_rx_status(uint8);
575 
576 @brief
577 	This function is used to return the status of RX test case either running or stopped.
578 
579 @return
580 	The function SHALL return status of ATE firmware, 1 if RX test case is running or 0 when the test case has been stopped.
581 @see
582 	m2m_ate_start_rx, m2m_ate_stop_rx
583 */
584 sint8 m2m_ate_get_rx_status(void);
585 
586 /*!
587 @fn	\
588 	sint8 m2m_ate_start_rx(tstrM2mAteRx *)
589 
590 @brief
591 	This function is used to start RX test case.
592 
593 @param [in]	strM2mAteRx
594 		Type of \ref tstrM2mAteRx, with the values required to enable RX test case. Application must use \ref m2m_ate_init first.
595 @return
596 	The function SHALL return @ref M2M_SUCCESS for success and a negative value otherwise.
597 @see
598 	m2m_ate_init, m2m_ate_stop_rx, m2m_ate_get_rx_status
599 */
600 sint8 m2m_ate_start_rx(tstrM2mAteRx *);
601 
602 /*!
603 @fn	\
604 	sint8 m2m_ate_stop_rx(void)
605 
606 @brief
607 	This function is used to stop RX test case.
608 
609 @return
610 	The function SHALL return @ref M2M_SUCCESS for success and a negative value otherwise.
611 @see
612 	m2m_ate_init, m2m_ate_start_rx, m2m_ate_get_rx_status
613 */
614 sint8 m2m_ate_stop_rx(void);
615 
616 /*!
617 @fn	\
618 	sint8 m2m_ate_read_rx_status(tstrM2mAteRxStatus *)
619 
620 @brief
621 	This function is used to read RX statistics from the ATE firmware.
622 
623 @param [out]	strM2mAteRxStatus
624 		Type of \ref tstrM2mAteRxStatus used to save statistics of RX test case. Application must use \ref m2m_ate_start_rx first.
625 @return
626 	The function SHALL return @ref M2M_SUCCESS for success and a negative value otherwise.
627 @see
628 	m2m_ate_init, m2m_ate_start_rx
629 */
630 sint8 m2m_ate_read_rx_status(tstrM2mAteRxStatus *);
631 
632 /*!
633 @fn	\
634 	sint8 m2m_ate_set_dig_gain(double dGaindB)
635 
636 @brief
637 	This function is used to set the digital gain value to the HW registers in dB.
638 
639 @param [in]	double dGaindB
640 		The digital gain value required to be set.
641 @return
642 	The function SHALL return @ref M2M_SUCCESS for success and a negative value otherwise.
643 @see
644 m2m_ate_get_dig_gain, m2m_ate_get_pa_gain,m2m_ate_get_ppa_gain,m2m_ate_get_tot_gain
645 */
646 sint8 m2m_ate_set_dig_gain(double dGaindB);
647 
648 /*!
649 @fn	\
650 	sint8 m2m_ate_get_dig_gain(double * dGaindB)
651 
652 @brief
653 	This function is used to retrieve the digital gain value from the HW registers in dB.
654 	Digital gain is one of the values that are set to calculate the total tx gain value.
655 
656 @param [out]	double * dGaindB
657 		The retrieved digital gain value obtained from HW registers in dB.
658 @return
659 	The function SHALL return @ref M2M_SUCCESS for success and a negative value otherwise.
660 @see
661 m2m_ate_set_dig_gain, m2m_ate_get_pa_gain,m2m_ate_get_ppa_gain,m2m_ate_get_tot_gain
662 */
663 sint8 m2m_ate_get_dig_gain(double * dGaindB);
664 
665 /*!
666 @fn	\
667 	void m2m_ate_set_pa_gain(uint8 gain_db)
668 
669 @brief
670 	This function is used to set the PA gain (18/15/12/9/6/3/0 only)
671 
672 @param [in]	uint8 gain_db
673 		PA gain level allowed (18/15/12/9/6/3/0 only)
674 
675 */
676 void m2m_ate_set_pa_gain(uint8 gain_db);
677 /*!
678 @fn	\
679 	sint8 m2m_ate_get_pa_gain(double *paGaindB)
680 
681 @brief
682 	This function is used to get the Power Amplifier(PA) gain
683 
684 @param [out]	double *paGaindB
685 	The retrieved PA gain value obtained from HW registers in dB.
686 @return
687 		The function SHALL return @ref M2M_SUCCESS for success and a negative value otherwise.
688 @see
689 m2m_ate_set_dig_gain, m2m_ate_get_dig_gain,m2m_ate_get_ppa_gain,m2m_ate_get_tot_gain
690 */
691 sint8 m2m_ate_get_pa_gain(double *paGaindB);
692 
693 /*!
694 @fn	\
695 	sint8 m2m_ate_get_ppa_gain(double * ppaGaindB)
696 
697 @brief
698 	This function is used to get the Pre-Power Amplifier(PPA) gain
699 
700 @param [out]	uint32 * ppaGaindB
701 		The retrieved PPA gain value obtained from HW registers in dB.
702 @return
703 	The function SHALL return 0 for success and a negative value otherwise.
704 @see
705 m2m_ate_set_dig_gain, m2m_ate_get_dig_gain,m2m_ate_get_pa_gain,m2m_ate_get_tot_gain
706 */
707 sint8 m2m_ate_get_ppa_gain(double * ppaGaindB);
708 
709 /*!
710 @fn	\
711 	sint8 m2m_ate_get_tot_gain(double * totGaindB)
712 
713 @brief
714 	This function is used to calculate the total tx gain value
715 
716 @param [out]	double * totGaindB
717 		The retrieved total gain value obtained from calculations made based on the digital gain, PA and PPA gain values.
718 @return
719 	The function SHALL return @ref M2M_SUCCESS for success and a negative value otherwise.
720 @see
721 m2m_ate_set_dig_gain, m2m_ate_get_dig_gain,m2m_ate_get_pa_gain,m2m_ate_get_ppa_gain
722 */
723 sint8 m2m_ate_get_tot_gain(double * totGaindB);
724    //@}
725 
726 #ifdef __cplusplus
727 }
728 #endif
729 
730 #endif /* _M2M_CONFIG_MODE_H_ */
731 
732 #endif //_M2M_ATE_FW_