add method peek data.
This commit is contained in:
@@ -786,17 +786,20 @@ void Phy_GetLastSlotStartTimeStamp(PHY_INST* instPtr, TIME_WORD* slotStart) {
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* @brief Get received data (base on PL Record), store it to data buffer.
|
||||
* @brief Copy ans store the received data, if received data valid.
|
||||
*
|
||||
* @param instPtr a pointer to physical layer control instance.
|
||||
*
|
||||
* @return SUCCESS
|
||||
* FAILURE last frame type cannot be recognized.
|
||||
* @return NONE
|
||||
*
|
||||
******************************************************************************/
|
||||
void Phy_RetrieveRecvData(PHY_INST* instPtr, uint8_t* dataBuff) {
|
||||
void Phy_PeekRecvData(PHY_INST* instPtr, uint8_t* dataBuff) {
|
||||
ASSERT(instPtr != NULL);
|
||||
ASSERT(dataBuff != NULL);
|
||||
if (instPtr->isValid == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
uint32_t frameLen, offset;
|
||||
|
||||
frameLen = (PhyRead(instPtr, RECVDATA_STATE) & RECVDATA_STATE_LEN_MASK) >> RECVDATA_STATE_LEN_SHIFT;
|
||||
@@ -804,3 +807,24 @@ void Phy_RetrieveRecvData(PHY_INST* instPtr, uint8_t* dataBuff) {
|
||||
|
||||
memcpy(dataBuff, (uint8_t*)(instPtr->recvDataAddr + offset), frameLen);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* @brief Get the received data (if valid), store it to data buffer.
|
||||
* and clear data valid flag.
|
||||
*
|
||||
* @param instPtr a pointer to physical layer control instance.
|
||||
*
|
||||
* @return NONE
|
||||
*
|
||||
******************************************************************************/
|
||||
void Phy_RetrieveRecvData(PHY_INST* instPtr, uint8_t* dataBuff) {
|
||||
ASSERT(instPtr != NULL);
|
||||
ASSERT(dataBuff != NULL);
|
||||
if (instPtr->isValid == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Phy_RetrievePeekData(instPtr, dataBuff);
|
||||
instPtr->isValid = false;
|
||||
}
|
||||
|
||||
@@ -242,6 +242,7 @@ void Phy_Halt(PHY_INST* instPtr);
|
||||
int32_t Phy_SetMode(PHY_INST* instPtr, PHY_MODE modeCod);
|
||||
|
||||
int32_t Phy_SetupNextSlot(PHY_INST* instPtr, PHY_TOR_TYPE txrxMode, L1_FRAME_TYPE frameType, uint8_t* dataBuff);
|
||||
void Phy_PeekRecvData(PHY_INST* instPtr, uint8_t* dataBuff);
|
||||
void Phy_RetrieveRecvData(PHY_INST* instPtr, uint8_t* dataBuff);
|
||||
|
||||
bool Phy_IsFrameDetected(PHY_INST* instPtr);
|
||||
|
||||
Reference in New Issue
Block a user