91 lines
1.9 KiB
C
Executable File
91 lines
1.9 KiB
C
Executable File
#ifndef __PHY_TEST_API_H
|
|
#define __PHY_TEST_API_H
|
|
|
|
#include "os_types.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define MATH_MAX(a,b) ((a < b) ? b : a)
|
|
#define MATH_MIN(a,b) ((a < b) ? a : b)
|
|
|
|
#pragma pack(push) /* save the pack status */
|
|
#pragma pack(1) /* 1 byte align */
|
|
|
|
/* global variables */
|
|
typedef struct _mac_rx_phy_info
|
|
{
|
|
/* gain table ptr */
|
|
int16_t gain;
|
|
int16_t gain_avg;
|
|
int16_t gain_max;
|
|
int16_t gain_min;
|
|
/* adc power */
|
|
int16_t rmi;
|
|
int16_t rmi_avg;
|
|
int16_t rmi_max;
|
|
int16_t rmi_min;
|
|
/* rssi from calibration */
|
|
int16_t rssi;
|
|
int16_t rssi_avg;
|
|
int16_t rssi_max;
|
|
int16_t rssi_min;
|
|
/* dc value */
|
|
int8_t est_dc;
|
|
int16_t dc_avg;
|
|
int8_t dc_max;
|
|
int8_t dc_min;
|
|
/* ppm from pkt */
|
|
int8_t est_ppm;
|
|
int16_t ppm_avg;
|
|
int8_t ppm_max;
|
|
int8_t ppm_min;
|
|
/* snr from pkt */
|
|
int8_t avr_snr;
|
|
int16_t snr_avg;
|
|
int8_t snr_max;
|
|
int8_t snr_min;
|
|
/* retry cnt */
|
|
uint16_t retry_num;
|
|
} mac_rx_phy_info_t;
|
|
|
|
#pragma pack(pop) /* restore the pack status */
|
|
|
|
/**
|
|
*@brief phy_rx_loopback.
|
|
* get csi dump raw data by trig fft, not care pkt exit or not.
|
|
*
|
|
*@param none [none.]
|
|
*@exception [none.]
|
|
*@return [none.]
|
|
*/
|
|
void phy_rx_loopback();
|
|
|
|
/**
|
|
*@brief phy_info_cnt_cal.
|
|
* calibrate phy info statistics.
|
|
*
|
|
*@param phy_info_ptr [phy info pointer.]
|
|
*@exception [none.]
|
|
*@return [0 success and others fail.]
|
|
*/
|
|
uint32_t phy_info_cnt_cal(mac_rx_phy_info_t *phy_info_ptr);
|
|
|
|
/**
|
|
*@brief phy_info_cnt_print.
|
|
* print the need count depend on related computational formula.
|
|
*
|
|
*@param phy_info_ptr [phy info pointer.]
|
|
*@exception [none.]
|
|
*@return [0 success and others fail.]
|
|
*/
|
|
uint32_t phy_info_cnt_print(mac_rx_phy_info_t *phy_info_ptr);
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|