60 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			60 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
| /****************************************************************************
 | |
| 
 | |
| 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.
 | |
| 
 | |
| ****************************************************************************/
 | |
| #include "mac_sys_reg.h"
 | |
| #include "phy_reg.h"
 | |
| #include "hw_reg_api.h"
 | |
| #include "phy_tx_reg.h"
 | |
| 
 | |
| void phy_tx_long_pream_enable()
 | |
| {
 | |
|     uint32_t tmp = 0;
 | |
| 
 | |
|     /* enable phy tx long preamble */
 | |
|     tmp = RGF_MAC_READ_REG(CFG_PHY_CTRL_ADDR);
 | |
|     REG_FIELD_SET(CFG_PHY_TX_LONG_PREAM_EN, tmp, 1);
 | |
|     RGF_MAC_WRITE_REG(CFG_PHY_CTRL_ADDR,tmp);
 | |
| 
 | |
|     /* matching SG num of preambles to be sent */
 | |
|     tmp = PHY_READ_REG(CFG_BB_PRE_CFG_ADDR);
 | |
|     REG_FIELD_SET(SW_TX_PRE_NUM,tmp,13);
 | |
|     PHY_WRITE_REG(CFG_BB_PRE_CFG_ADDR, tmp);
 | |
| 
 | |
| #if PLC_SUPPORT_CCO_ROLE
 | |
|     tmp = PHY_TX_READ_REG(CFG_BB_TX_DLY_ADDR);
 | |
|     REG_FIELD_SET(SW_TX_DLY_SG, tmp, 4095);
 | |
|     REG_FIELD_SET(SW_TX_DLY_GP, tmp, 4095);
 | |
|     PHY_TX_WRITE_REG(CFG_BB_TX_DLY_ADDR, tmp);
 | |
| #else
 | |
|     tmp = PHY_TX_READ_REG(CFG_BB_TX_DLY_ADDR);
 | |
|     REG_FIELD_SET(SW_TX_DLY_SG, tmp, 4095);
 | |
|     REG_FIELD_SET(SW_TX_DLY_GP, tmp, 4095);
 | |
|     PHY_TX_WRITE_REG(CFG_BB_TX_DLY_ADDR, tmp);
 | |
| #endif
 | |
| 
 | |
| }
 | |
| 
 | |
| void phy_spcl_feat_init()
 | |
| {
 | |
| #if HW_PLATFORM >= HW_PLATFORM_FPGA
 | |
| 
 | |
|     /* enable phy tx long preamble */
 | |
| #if IOT_TX_LONG_PREAMBLE_ENABLE
 | |
|     phy_tx_long_pream_enable();
 | |
| #endif
 | |
| 
 | |
| #endif
 | |
| }
 | |
| 
 |