Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 

751 righe
21 KiB

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