111 lines
		
	
	
		
			3.1 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
		
		
			
		
	
	
			111 lines
		
	
	
		
			3.1 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
|  | /****************************************************************************
 | ||
|  | 
 | ||
|  | Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED. | ||
|  | 
 | ||
|  | This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT | ||
|  | be copied by any method or incorporated into another program without | ||
|  | the express written consent of Aerospace C.Power. This Information or any portion | ||
|  | thereof remains the property of Aerospace C.Power. The Information contained herein | ||
|  | is believed to be accurate and Aerospace C.Power assumes no responsibility or | ||
|  | liability for its use in any way and conveys no license or title under | ||
|  | any patent or copyright and makes no representation or warranty that this | ||
|  | Information is free from patent or copyright infringement. | ||
|  | 
 | ||
|  | ****************************************************************************/ | ||
|  | 
 | ||
|  | #ifndef MP_MODE_H
 | ||
|  | #define MP_MODE_H
 | ||
|  | 
 | ||
|  | #include "phy_rf_chn.h"
 | ||
|  | 
 | ||
|  | #ifdef __cplusplus
 | ||
|  | extern "C" { | ||
|  | #endif
 | ||
|  | 
 | ||
|  | #define IOT_MP_MODE_DIRECT_ENABLE       0
 | ||
|  | 
 | ||
|  | #define IOT_MP_TX_MODE_ENABLE           0
 | ||
|  | 
 | ||
|  | #define IOT_MP_RX_MODE_ENABLE           0
 | ||
|  | 
 | ||
|  | #define IOT_MP_AUTO_TONE_TX             0
 | ||
|  | 
 | ||
|  | #define IOT_MP_RF_MODE_DIRECT_ENABLE    0
 | ||
|  | 
 | ||
|  | /* mp rf golden tx power info count*/ | ||
|  | #define IOT_MP_RF_GU_TX_POWER_INFO_CNT  10
 | ||
|  | 
 | ||
|  | /* pack for the structures in the whole file */ | ||
|  | #pragma pack(push)  // save the pack status
 | ||
|  | #pragma pack(1)     // 1 byte align
 | ||
|  | 
 | ||
|  | /* mp rf golden tx tone power info */ | ||
|  | typedef struct _mp_rf_gu_tx_tone_pwr_info_t { | ||
|  |     /* power, unit: dbm */ | ||
|  |     int8_t   power; | ||
|  |     /* tx rf_att, range: [0x7e, 0x7d, 0x7b, 0x77, 0x6f, 0x5f, 0x3f] */ | ||
|  |     uint8_t  rf_att; | ||
|  |     /* if gain, range: 0~31 */ | ||
|  |     uint16_t if_gain : 5, | ||
|  |     /* ldovs, range: 0~511 */ | ||
|  |              ldovs   : 9, | ||
|  |     /* rservd */ | ||
|  |              rsvd    : 2; | ||
|  | } mp_rf_gu_tx_tone_pwr_info_t; | ||
|  | 
 | ||
|  | typedef struct _mp_rf_gu_cali_t { | ||
|  |     /* reserved for future */ | ||
|  |     uint32_t rsvd0; | ||
|  |     /* how much valid data has been stored */ | ||
|  |     uint8_t valid_rx_gain_item_cnt; | ||
|  |     /* rf golden gain calibration value */ | ||
|  |     int8_t  rx_gain_cal[PHY_RF_GAIN_MAX - PHY_RF_GAIN_MIN + 1]; | ||
|  |     /* tx tone power info */ | ||
|  |     mp_rf_gu_tx_tone_pwr_info_t power_info[IOT_MP_RF_GU_TX_POWER_INFO_CNT]; | ||
|  |     /* rservd for future */ | ||
|  |     uint8_t rsvd[93]; | ||
|  | } mp_rf_gu_cali_t; | ||
|  | 
 | ||
|  | #pragma pack(pop)   // restore the pack status
 | ||
|  | 
 | ||
|  | /**
 | ||
|  |  *@brief mp_pt_golden_nid_config. | ||
|  |  *  Golden Nid GPIO Status to config nid. | ||
|  |  */ | ||
|  | uint8_t mp_pt_golden_nid_config(); | ||
|  | 
 | ||
|  | /**
 | ||
|  |  *@brief iot_init_mp_mode_entry. | ||
|  |  *  This special API is designed for production line testing. | ||
|  |  *  Enter different mode in mp mode directly. | ||
|  |  * | ||
|  |  *@param none                [none.] | ||
|  |  *@exception                 [none.] | ||
|  |  *@return                    [none.] | ||
|  | */ | ||
|  | void iot_init_mp_mode_entry(); | ||
|  | 
 | ||
|  | /**
 | ||
|  |  *@brief mp_pt_rf_gu_cali_load. | ||
|  |  *  get the calibration struct. | ||
|  |  * | ||
|  |  *@param cali_data            [calibration value corresponding to gain.] | ||
|  |  *@return                    [0 success; others fail] | ||
|  | */ | ||
|  | uint8_t mp_pt_rf_gu_cali_load(mp_rf_gu_cali_t **cali_data); | ||
|  | 
 | ||
|  | /**
 | ||
|  |  *@brief mp_pt_rf_gu_cali_commit. | ||
|  |  *  save the calibration data. | ||
|  |  * | ||
|  |  *@return                    [0 success; others fail] | ||
|  | */ | ||
|  | uint8_t mp_pt_rf_gu_cali_commit(); | ||
|  | 
 | ||
|  | #ifdef __cplusplus
 | ||
|  | } | ||
|  | #endif
 | ||
|  | 
 | ||
|  | #endif /* MP_MODE_H */
 | ||
|  | 
 |