Compare commits
5
Commits
0c270df599
...
1192f7b4cd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1192f7b4cd | ||
|
|
871c9882b4 | ||
|
|
04a75154c5 | ||
|
|
f1e1ddf48f | ||
|
|
09cc2ce347 |
@@ -110,6 +110,7 @@ static PHY_CONFIG phyConfig =
|
|||||||
.devId = 0,
|
.devId = 0,
|
||||||
.baseAddr = PHY_BASEADDR,
|
.baseAddr = PHY_BASEADDR,
|
||||||
.antBramId = PHY_ANTCONFIG_BRAM_DEVICE_ID,
|
.antBramId = PHY_ANTCONFIG_BRAM_DEVICE_ID,
|
||||||
|
.antInfoBramId = -1,
|
||||||
.txBramId = PHY_TXBUFF_BRAM_DEVICE_ID,
|
.txBramId = PHY_TXBUFF_BRAM_DEVICE_ID,
|
||||||
.rxBramId = PHY_RXBUFF_BRAM_DEVICE_ID,
|
.rxBramId = PHY_RXBUFF_BRAM_DEVICE_ID,
|
||||||
.hwXadcId = PHY_HW_XADC_DEVICE_ID,
|
.hwXadcId = PHY_HW_XADC_DEVICE_ID,
|
||||||
|
|||||||
@@ -58,6 +58,7 @@
|
|||||||
#define PHY_BEAM_FORMING_ENABLE
|
#define PHY_BEAM_FORMING_ENABLE
|
||||||
// -- Antenna Bram Configs
|
// -- Antenna Bram Configs
|
||||||
#define PHY_ANTCONFIG_BRAM_DEVICE_ID XPAR_PHY_DATA_INTERFACE_ANT_INFO_BRAM_CTRL_DEVICE_ID
|
#define PHY_ANTCONFIG_BRAM_DEVICE_ID XPAR_PHY_DATA_INTERFACE_ANT_INFO_BRAM_CTRL_DEVICE_ID
|
||||||
|
#define PHY_ANTINFO_BRAM_DEVICE_ID XPAR_PHY_DATA_INTERFACE_ANT_BEAM_BRAM_CTRL_DEVICE_ID
|
||||||
// -- Buffers
|
// -- Buffers
|
||||||
#define PHY_TXBUFF_BRAM_DEVICE_ID XPAR_PHY_DATA_INTERFACE_TX_FRAME_BRAM_CTRL_DEVICE_ID
|
#define PHY_TXBUFF_BRAM_DEVICE_ID XPAR_PHY_DATA_INTERFACE_TX_FRAME_BRAM_CTRL_DEVICE_ID
|
||||||
#define PHY_RXBUFF_BRAM_DEVICE_ID XPAR_PHY_DATA_INTERFACE_RX_FRAME_BRAM_CTRL_DEVICE_ID
|
#define PHY_RXBUFF_BRAM_DEVICE_ID XPAR_PHY_DATA_INTERFACE_RX_FRAME_BRAM_CTRL_DEVICE_ID
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ static PHY_CONFIG phyConfig = {
|
|||||||
.devId = 0,
|
.devId = 0,
|
||||||
.baseAddr = PHY_BASEADDR,
|
.baseAddr = PHY_BASEADDR,
|
||||||
.antBramId = PHY_ANTCONFIG_BRAM_DEVICE_ID,
|
.antBramId = PHY_ANTCONFIG_BRAM_DEVICE_ID,
|
||||||
|
.antInfoBramId = PHY_ANTINFO_BRAM_DEVICE_ID,
|
||||||
.txBramId = PHY_TXBUFF_BRAM_DEVICE_ID,
|
.txBramId = PHY_TXBUFF_BRAM_DEVICE_ID,
|
||||||
.rxBramId = PHY_RXBUFF_BRAM_DEVICE_ID,
|
.rxBramId = PHY_RXBUFF_BRAM_DEVICE_ID,
|
||||||
.hwXadcId = PHY_HW_XADC_DEVICE_ID,
|
.hwXadcId = PHY_HW_XADC_DEVICE_ID,
|
||||||
|
|||||||
@@ -662,6 +662,8 @@ int32_t Linklayer_Init(L2_INST **instPtr, const L2_CONFIG *config)
|
|||||||
}
|
}
|
||||||
memset(*instPtr, 0x00, sizeof(L2_INST));
|
memset(*instPtr, 0x00, sizeof(L2_INST));
|
||||||
memcpy(&((*instPtr)->config), config, sizeof(L2_CONFIG));
|
memcpy(&((*instPtr)->config), config, sizeof(L2_CONFIG));
|
||||||
|
// Clear log
|
||||||
|
memset(&((*instPtr)->log), 0x00, sizeof((*instPtr)->log));
|
||||||
|
|
||||||
// Packet buffer
|
// Packet buffer
|
||||||
(*instPtr)->sendPktData = calloc(L2_PACK_LEN_MAX / sizeof(uint64_t), sizeof(uint64_t));
|
(*instPtr)->sendPktData = calloc(L2_PACK_LEN_MAX / sizeof(uint64_t), sizeof(uint64_t));
|
||||||
@@ -954,6 +956,7 @@ int32_t Linklayer_EventHandler(L2_INST *instPtr, const L2_EVENT *l2Event)
|
|||||||
L2_Service_Reset(instPtr->serviceFSM);
|
L2_Service_Reset(instPtr->serviceFSM);
|
||||||
instPtr->cxn2Net = false;
|
instPtr->cxn2Net = false;
|
||||||
UpdateMainSate(instPtr, L2_INIT_STATE);
|
UpdateMainSate(instPtr, L2_INIT_STATE);
|
||||||
|
instPtr->log.reconnectCnt++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case L2_EV_LOST_NODE:
|
case L2_EV_LOST_NODE:
|
||||||
@@ -962,6 +965,8 @@ int32_t Linklayer_EventHandler(L2_INST *instPtr, const L2_EVENT *l2Event)
|
|||||||
L2_Scan_Reset(instPtr->scanFSM);
|
L2_Scan_Reset(instPtr->scanFSM);
|
||||||
L2_Service_Reset(instPtr->serviceFSM);
|
L2_Service_Reset(instPtr->serviceFSM);
|
||||||
UpdateMainSate(instPtr, L2_INIT_STATE);
|
UpdateMainSate(instPtr, L2_INIT_STATE);
|
||||||
|
// Log reconnect
|
||||||
|
instPtr->log.reconnectCnt++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case L2_ROUTINE_FINISH:
|
case L2_ROUTINE_FINISH:
|
||||||
@@ -1234,12 +1239,11 @@ int32_t Linklayer_Proc(L2_INST *instPtr)
|
|||||||
instPtr->linkLog.nodeType = (instPtr->config.myType == L2_NODE_HEAD) ? 0xAA : 0xCC;
|
instPtr->linkLog.nodeType = (instPtr->config.myType == L2_NODE_HEAD) ? 0xAA : 0xCC;
|
||||||
instPtr->linkLog.cxnStatus = (instPtr->cxn2Net) ? 0x11 : 0x00;
|
instPtr->linkLog.cxnStatus = (instPtr->cxn2Net) ? 0x11 : 0x00;
|
||||||
instPtr->linkLog.linkStage = (instPtr->mainState == L2_INIT_STATE) ? 0x11 : 0x22;
|
instPtr->linkLog.linkStage = (instPtr->mainState == L2_INIT_STATE) ? 0x11 : 0x22;
|
||||||
// TODO:
|
instPtr->linkLog.recxnCnt = instPtr->log.reconnectCnt;
|
||||||
// instPtr->linkLog.recxnCnt =
|
instPtr->linkLog.beamNo = instPtr->log.scanBeamNo;
|
||||||
// instPtr->linkLog.beamNo =
|
instPtr->linkLog.beamWidth = instPtr->log.lastBeamWidth;
|
||||||
// instPtr->linkLog.beamWidth =
|
instPtr->linkLog.beamAz = antSubnrrwPattern[instPtr->log.scanBeamNo].oaxis;
|
||||||
// instPtr->linkLog.beamAz =
|
instPtr->linkLog.beamEl = antSubnrrwPattern[instPtr->log.scanBeamNo].raxis;
|
||||||
// instPtr->linkLog.beamEl =
|
|
||||||
instPtr->linkLog.advTxCnt = (uint16_t)instPtr->log.advTxCnt;
|
instPtr->linkLog.advTxCnt = (uint16_t)instPtr->log.advTxCnt;
|
||||||
instPtr->linkLog.advRecvCnt = (uint16_t)instPtr->log.advRecvCnt;
|
instPtr->linkLog.advRecvCnt = (uint16_t)instPtr->log.advRecvCnt;
|
||||||
instPtr->linkLog.advCorrectCnt = (uint16_t)instPtr->log.advCorrectCnt;
|
instPtr->linkLog.advCorrectCnt = (uint16_t)instPtr->log.advCorrectCnt;
|
||||||
|
|||||||
@@ -66,6 +66,9 @@ typedef struct
|
|||||||
uint32_t svcCorrectCnt;
|
uint32_t svcCorrectCnt;
|
||||||
|
|
||||||
int64_t timeDev;
|
int64_t timeDev;
|
||||||
|
uint8_t scanBeamNo;
|
||||||
|
uint8_t lastBeamWidth;
|
||||||
|
uint32_t reconnectCnt;
|
||||||
} L2_LOG;
|
} L2_LOG;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
|||||||
@@ -405,6 +405,10 @@ int32_t L2_Scan_PktHandler(L2_INST *instPtr, uint8_t *msg)
|
|||||||
node->nodeInfo.pos.y = (double) nodePos;
|
node->nodeInfo.pos.y = (double) nodePos;
|
||||||
L2_FrameGetChunk(msg, L2_MSG_ADV_SRC_POSZ, L2_MSG_ADV_SRC_POSZ_LEN, &nodePos);
|
L2_FrameGetChunk(msg, L2_MSG_ADV_SRC_POSZ, L2_MSG_ADV_SRC_POSZ_LEN, &nodePos);
|
||||||
node->nodeInfo.pos.z = (double) nodePos;
|
node->nodeInfo.pos.z = (double) nodePos;
|
||||||
|
node->nodeInfo.beamNo = Phy_LastScanBeamNo(instPtr->config.phyInstPtr);
|
||||||
|
|
||||||
|
// log last scan beam number
|
||||||
|
instPtr->log.scanBeamNo = node->nodeInfo.beamNo;
|
||||||
|
|
||||||
// Reset node ttl
|
// Reset node ttl
|
||||||
node->ttlCnt = 0;
|
node->ttlCnt = 0;
|
||||||
@@ -591,6 +595,7 @@ int32_t L2_Scan_Routine(L2_INST *instPtr, const L2_RTNE_TABLE_ENTRY *rtneEntry)
|
|||||||
ASSERT(instPtr != NULL);
|
ASSERT(instPtr != NULL);
|
||||||
L2_TOR_TYPE torState;
|
L2_TOR_TYPE torState;
|
||||||
int32_t Status;
|
int32_t Status;
|
||||||
|
const NODE_ENTRY* commNode;
|
||||||
DBG_INFO("-------- Scan Routine --------\n");
|
DBG_INFO("-------- Scan Routine --------\n");
|
||||||
|
|
||||||
if (rtneEntry->slotSeq != 0)
|
if (rtneEntry->slotSeq != 0)
|
||||||
@@ -603,15 +608,24 @@ int32_t L2_Scan_Routine(L2_INST *instPtr, const L2_RTNE_TABLE_ENTRY *rtneEntry)
|
|||||||
if (rtneEntry->dst == L2_GetNodeId(instPtr) || rtneEntry->dst == L2_BROADCAST_ID)
|
if (rtneEntry->dst == L2_GetNodeId(instPtr) || rtneEntry->dst == L2_BROADCAST_ID)
|
||||||
{
|
{
|
||||||
torState = L2_TOR_RX;
|
torState = L2_TOR_RX;
|
||||||
|
commNode = L2_GetNodeById(rtneEntry->dst);
|
||||||
}
|
}
|
||||||
else if (rtneEntry->src == L2_GetNodeId(instPtr) || rtneEntry->src == L2_BROADCAST_ID)
|
else if (rtneEntry->src == L2_GetNodeId(instPtr) || rtneEntry->src == L2_BROADCAST_ID)
|
||||||
{
|
{
|
||||||
torState = L2_TOR_TX;
|
torState = L2_TOR_TX;
|
||||||
|
commNode = L2_GetNodeById(rtneEntry->src);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
torState = L2_TOR_SUSPEND;
|
torState = L2_TOR_SUSPEND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Phy_SetBeamWidth(instPtr->config.phyInstPtr, PHY_ANT_BEAM_25);
|
||||||
|
instPtr->log.lastBeamWidth = PHY_ANT_BEAM_25;
|
||||||
|
if (commNode != NULL)
|
||||||
|
{
|
||||||
|
Phy_SetBeamNo(commNode->nodeInfo.beamNo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -627,6 +641,8 @@ int32_t L2_Scan_Routine(L2_INST *instPtr, const L2_RTNE_TABLE_ENTRY *rtneEntry)
|
|||||||
{
|
{
|
||||||
torState = L2_TOR_SUSPEND;
|
torState = L2_TOR_SUSPEND;
|
||||||
}
|
}
|
||||||
|
Phy_SetBeamWidth(instPtr->config.phyInstPtr, PHY_ANT_BEAM_120);
|
||||||
|
instPtr->log.lastBeamWidth = PHY_ANT_BEAM_120;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (rtneEntry->slotType)
|
switch (rtneEntry->slotType)
|
||||||
|
|||||||
@@ -369,19 +369,34 @@ int32_t L2_Service_Routine(L2_INST *instPtr, const L2_RTNE_TABLE_ENTRY *rtneEntr
|
|||||||
|
|
||||||
PHY_INST* phyRef = instPtr->config.phyInstPtr;
|
PHY_INST* phyRef = instPtr->config.phyInstPtr;
|
||||||
L2_TOR_TYPE torState;
|
L2_TOR_TYPE torState;
|
||||||
|
const NODE_ENTRY* commNode;
|
||||||
if (rtneEntry->src == L2_GetNodeId(instPtr))
|
if (rtneEntry->src == L2_GetNodeId(instPtr))
|
||||||
{
|
{
|
||||||
torState = L2_TOR_TX;
|
torState = L2_TOR_TX;
|
||||||
|
commNode = L2_GetNodeById(rtneEntry->src);
|
||||||
}
|
}
|
||||||
else if (rtneEntry->dst == L2_GetNodeId(instPtr))
|
else if (rtneEntry->dst == L2_GetNodeId(instPtr))
|
||||||
{
|
{
|
||||||
torState = L2_TOR_RX;
|
torState = L2_TOR_RX;
|
||||||
|
commNode = L2_GetNodeById(rtneEntry->src);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
torState = L2_TOR_SUSPEND;
|
torState = L2_TOR_SUSPEND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (L2_GetNodeType(instPtr) != L2_NODE_HEAD && commNode != NULL)
|
||||||
|
{
|
||||||
|
Phy_SetBeamWidth(phyRef, PHY_ANT_BEAM_25);
|
||||||
|
Phy_SetBeamNo(phyRef, commNode->nodeInfo.beamNo);
|
||||||
|
instPtr->log.lastBeamWidth = PHY_ANT_BEAM_25;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Phy_SetBeamWidth(phyRef, PHY_ANT_BEAM_120);
|
||||||
|
instPtr->log.lastBeamWidth = PHY_ANT_BEAM_120;
|
||||||
|
}
|
||||||
|
|
||||||
switch (rtneEntry->slotType)
|
switch (rtneEntry->slotType)
|
||||||
{
|
{
|
||||||
case L2_SLOT_SERVICE:
|
case L2_SLOT_SERVICE:
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ uint16_t hopPattern_1M2BPS_5MS[L1_FRAME_1M2BPS_5MS_HOPS] =
|
|||||||
#ifdef PHY_BEAM_SET_PRESET
|
#ifdef PHY_BEAM_SET_PRESET
|
||||||
PHY_ANT_ANGLE antSubnrrwPattern[L1_NUM_ANT_SUBNRRW_PATTERN] =
|
PHY_ANT_ANGLE antSubnrrwPattern[L1_NUM_ANT_SUBNRRW_PATTERN] =
|
||||||
{
|
{
|
||||||
{.oaxis = 0 , .raxis = 222}, {.oaxis = 10, .raxis = 85 },
|
{.oaxis = 0 , .raxis = 0 }, {.oaxis = 10, .raxis = 85 },
|
||||||
{.oaxis = 14, .raxis = 307}, {.oaxis = 17, .raxis = 170},
|
{.oaxis = 14, .raxis = 307}, {.oaxis = 17, .raxis = 170},
|
||||||
{.oaxis = 19, .raxis = 32 }, {.oaxis = 21, .raxis = 255},
|
{.oaxis = 19, .raxis = 32 }, {.oaxis = 21, .raxis = 255},
|
||||||
{.oaxis = 24, .raxis = 117}, {.oaxis = 25, .raxis = 340},
|
{.oaxis = 24, .raxis = 117}, {.oaxis = 25, .raxis = 340},
|
||||||
@@ -144,7 +144,7 @@ PHY_ANT_ANGLE antSubnrrwPattern[L1_NUM_ANT_SUBNRRW_PATTERN] =
|
|||||||
};
|
};
|
||||||
PHY_ANT_ANGLE antNrrwPattern[L1_NUM_ANT_NRRW_PATTERN] =
|
PHY_ANT_ANGLE antNrrwPattern[L1_NUM_ANT_NRRW_PATTERN] =
|
||||||
{
|
{
|
||||||
{.oaxis = 0 , .raxis = 222}, {.oaxis = 7 , .raxis = 85 },
|
{.oaxis = 0 , .raxis = 0 }, {.oaxis = 7 , .raxis = 85 },
|
||||||
{.oaxis = 10, .raxis = 307}, {.oaxis = 13, .raxis = 170},
|
{.oaxis = 10, .raxis = 307}, {.oaxis = 13, .raxis = 170},
|
||||||
{.oaxis = 15, .raxis = 32 }, {.oaxis = 17, .raxis = 255},
|
{.oaxis = 15, .raxis = 32 }, {.oaxis = 17, .raxis = 255},
|
||||||
{.oaxis = 18, .raxis = 117}, {.oaxis = 20, .raxis = 340},
|
{.oaxis = 18, .raxis = 117}, {.oaxis = 20, .raxis = 340},
|
||||||
@@ -280,10 +280,10 @@ int32_t Phy_SetBeamNo(PHY_INST *instPtr, int32_t beamNo)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
instPtr->beamNo.next = beamNo;
|
instPtr->beamNo.next = beamNo;
|
||||||
instPtr->antConfig.oaxis[1] = (uint8_t)(antNrrwPattern[beamNo].oaxis);
|
instPtr->antConfig.oaxis[1] = (uint8_t)(antNrrwPattern[beamNo].oaxis >> 8);
|
||||||
instPtr->antConfig.oaxis[0] = (uint8_t)((antNrrwPattern[beamNo].oaxis) >> 8);
|
instPtr->antConfig.oaxis[0] = (uint8_t)(antNrrwPattern[beamNo].oaxis);
|
||||||
instPtr->antConfig.raxis[1] = (uint8_t)(antNrrwPattern[beamNo].raxis);
|
instPtr->antConfig.raxis[1] = (uint8_t)(antNrrwPattern[beamNo].raxis >> 8);
|
||||||
instPtr->antConfig.raxis[0] = (uint8_t)((antNrrwPattern[beamNo].raxis) >> 8);
|
instPtr->antConfig.raxis[0] = (uint8_t)(antNrrwPattern[beamNo].raxis);
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -296,10 +296,10 @@ int32_t Phy_SetBeamNo(PHY_INST *instPtr, int32_t beamNo)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
instPtr->beamNo.next = beamNo;
|
instPtr->beamNo.next = beamNo;
|
||||||
instPtr->antConfig.oaxis[1] = (uint8_t)(antSubnrrwPattern[beamNo].oaxis);
|
instPtr->antConfig.oaxis[1] = (uint8_t)(antSubnrrwPattern[beamNo].oaxis >> 8);
|
||||||
instPtr->antConfig.oaxis[0] = (uint8_t)((antSubnrrwPattern[beamNo].oaxis) >> 8);
|
instPtr->antConfig.oaxis[0] = (uint8_t)(antSubnrrwPattern[beamNo].oaxis);
|
||||||
instPtr->antConfig.raxis[1] = (uint8_t)(antSubnrrwPattern[beamNo].raxis);
|
instPtr->antConfig.raxis[1] = (uint8_t)(antSubnrrwPattern[beamNo].raxis >> 8);
|
||||||
instPtr->antConfig.raxis[0] = (uint8_t)((antSubnrrwPattern[beamNo].raxis) >> 8);
|
instPtr->antConfig.raxis[0] = (uint8_t)(antSubnrrwPattern[beamNo].raxis);
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -338,7 +338,6 @@ int32_t Phy_SetBeamWidth(PHY_INST *instPtr, PHY_ANT_BEAM_WIDTH beamWidth)
|
|||||||
default:
|
default:
|
||||||
DBG_ERROR("Beam width code: 0x%08X is illegal.\n\r", beamWidth);
|
DBG_ERROR("Beam width code: 0x%08X is illegal.\n\r", beamWidth);
|
||||||
return EPARAM;
|
return EPARAM;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
instPtr->antConfig.antMode = beamConfig;
|
instPtr->antConfig.antMode = beamConfig;
|
||||||
instPtr->beamWd.next = beamWidth;
|
instPtr->beamWd.next = beamWidth;
|
||||||
|
|||||||
@@ -456,6 +456,40 @@ int32_t Phy_InstInit(PHY_INST **instPtr, PHY_CONFIG *phyConfig)
|
|||||||
(*instPtr)->recvDataAddr = rxDataBram.Config.MemBaseAddress;
|
(*instPtr)->recvDataAddr = rxDataBram.Config.MemBaseAddress;
|
||||||
(*instPtr)->sendDataAddr = txDataBram.Config.MemBaseAddress;
|
(*instPtr)->sendDataAddr = txDataBram.Config.MemBaseAddress;
|
||||||
|
|
||||||
|
// Setup antenna presets
|
||||||
|
XBram antInfoBram;
|
||||||
|
if (phyConfig->antInfoBramId != -1)
|
||||||
|
{
|
||||||
|
bramConfigPtr = XBram_LookupConfig(phyConfig->antInfoBramId);
|
||||||
|
if (bramConfigPtr == NULL)
|
||||||
|
{
|
||||||
|
Status = EDCONF;
|
||||||
|
goto init_error;
|
||||||
|
}
|
||||||
|
Status = XBram_CfgInitialize(&antInfoBram, bramConfigPtr,
|
||||||
|
bramConfigPtr->CtrlBaseAddress);
|
||||||
|
if (Status != SUCCESS)
|
||||||
|
{
|
||||||
|
goto init_error;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Execute the BRAM driver selftest.
|
||||||
|
*/
|
||||||
|
Status = XBram_SelfTest(&antConfigBram, 0);
|
||||||
|
if (Status != SUCCESS)
|
||||||
|
{
|
||||||
|
goto init_error;
|
||||||
|
}
|
||||||
|
|
||||||
|
memccpy(antConfigBram.config.MemBaseAddress,
|
||||||
|
antSubnrrwPattern, sizeof(antSubnrrwPattern));
|
||||||
|
uint32_t phyMainCtrl = PhyRead(*instPtr, PHY_MAIN_CTRL);
|
||||||
|
phyMainCtrl &= ~PHY_MAIN_CTRL_NSCAN_MASK;
|
||||||
|
phyMainCtrl |= PHY_MAIN_CTRL_NSCAN_MASK &
|
||||||
|
(L1_NUM_ANT_SUBNRRW_PATTERN << PHY_MAIN_CTRL_NSCAN_SHIFT);
|
||||||
|
PhyWrite(*instPtr, phyMainCtrl);
|
||||||
|
}
|
||||||
|
|
||||||
/* Initialize the XAdc driver. */
|
/* Initialize the XAdc driver. */
|
||||||
XAdcPs_Config *xadcConfigPtr;
|
XAdcPs_Config *xadcConfigPtr;
|
||||||
|
|
||||||
@@ -821,6 +855,21 @@ uint32_t Phy_GetTimeComp(L1_FRAME_TYPE frameType)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/**
|
||||||
|
* @brief Get the last scan beam number after autoscan.
|
||||||
|
*
|
||||||
|
* @param instPtr a pointer to physical instance
|
||||||
|
*
|
||||||
|
* @return beam number
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
uint8_t Phy_LastScanBeamNo(PHY_INST *instPtr)
|
||||||
|
{
|
||||||
|
ASSERT(instPtr != NULL);
|
||||||
|
return (uint8_t)PhyRead(instPtr, BEAM_SELECT_INDEX);
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/**
|
/**
|
||||||
* @brief Get frequency estimation of last valid frame.
|
* @brief Get frequency estimation of last valid frame.
|
||||||
|
|||||||
@@ -181,6 +181,7 @@ typedef struct
|
|||||||
uint32_t txBramId;
|
uint32_t txBramId;
|
||||||
uint32_t rxBramId;
|
uint32_t rxBramId;
|
||||||
uint32_t antBramId;
|
uint32_t antBramId;
|
||||||
|
uint32_t antInfoBramId;
|
||||||
uint32_t hwXadcId;
|
uint32_t hwXadcId;
|
||||||
uintptr_t baseAddr;
|
uintptr_t baseAddr;
|
||||||
#ifndef EMULATION
|
#ifndef EMULATION
|
||||||
@@ -276,6 +277,7 @@ int32_t Phy_SetBeamNo(PHY_INST *instPtr, int32_t beamNo);
|
|||||||
int32_t Phy_SetBeamAngle(PHY_INST *phyInstPtr, double offAx, double rndAx);
|
int32_t Phy_SetBeamAngle(PHY_INST *phyInstPtr, double offAx, double rndAx);
|
||||||
int32_t Phy_SetTimeWord(PHY_INST *instPtr, const TIME_WORD *tmWord, PHY_TIME_WORD_TYPE tmType);
|
int32_t Phy_SetTimeWord(PHY_INST *instPtr, const TIME_WORD *tmWord, PHY_TIME_WORD_TYPE tmType);
|
||||||
|
|
||||||
|
uint8_t Phy_LastScanBeamNo(PHY_INST *instPtr);
|
||||||
double Phy_GetFreqEst(PHY_INST *instPtr);
|
double Phy_GetFreqEst(PHY_INST *instPtr);
|
||||||
double Phy_GetCoarseFreqEst(PHY_INST *instPtr);
|
double Phy_GetCoarseFreqEst(PHY_INST *instPtr);
|
||||||
double Phy_GetFineFreqEst(PHY_INST *instPtr);
|
double Phy_GetFineFreqEst(PHY_INST *instPtr);
|
||||||
|
|||||||
@@ -40,6 +40,9 @@
|
|||||||
#define PHY_MAIN_CTRL_MODE_SHIFT 8
|
#define PHY_MAIN_CTRL_MODE_SHIFT 8
|
||||||
#define PHY_MAIN_CTRL_MODE_WIDTH 8
|
#define PHY_MAIN_CTRL_MODE_WIDTH 8
|
||||||
#define PHY_MAIN_CTRL_MODE_MASK 0x0000FF00U
|
#define PHY_MAIN_CTRL_MODE_MASK 0x0000FF00U
|
||||||
|
#define PHY_MAIN_CTRL_NSCAN_SHIFT 16
|
||||||
|
#define PHY_MAIN_CTRL_NSCAN_WIDTH 8
|
||||||
|
#define PHY_MAIN_CTRL_NSCAN_MASK 0x00FF0000U
|
||||||
|
|
||||||
#define PHY_MAIN_CTRL_EN_EN 0x00000001U
|
#define PHY_MAIN_CTRL_EN_EN 0x00000001U
|
||||||
#define PHY_MAIN_CTRL_EN_DSBL 0x00000000U
|
#define PHY_MAIN_CTRL_EN_DSBL 0x00000000U
|
||||||
|
|||||||
Reference in New Issue
Block a user