XilinxProcessorIPLib/drivers/axiethernet/examples/avb/xavb_ptp_packets.c
void XAvb_UpdateLogMeanMessageInterval(u32 BaseAddress,
                                       u32 PtpFrameBaseAddr,
                                       u16 intervalDuration) {

  u32 ReadVal;
  u8 logMean;

  /** Convert intervalDuration to a logMean value */
  logMean = (u8)XAvb_ConvertDurationToLogMean(intervalDuration);

  /** Read the current fields */
  ReadVal = XAvb_ReadPtpBuffer(BaseAddress,
                                PtpFrameBaseAddr,
                                XAVB_PTP_TX_PKT_SEQUENCEID_OFFSET);

  /** Update just the logMeanMessageInterval field */
  ReadVal = (ReadVal & 0x00ffffff) | (logMean << 24);

  /** Write back */
  XAvb_WritePtpBuffer(BaseAddress,
                       PtpFrameBaseAddr,
                       XAVB_PTP_TX_PKT_SEQUENCEID_OFFSET,
                       ReadVal);
}
/****************************************************************************/
/**
*
* A function to update the logMeanMessageInterval field in a PTP packet
*
* @param  BaseAddress is the base address of the device
* @param  PtpFrameBaseAddr is the base address of the TX PTP Buffer to be updated
* @param  intervalDuration is the "fraction of 128" value of the data to be written
*
* @return None.  But the relevant Tx PTP Packet Buffer is written to with the
*                updated logMeanMessageInterval
*
* @note   None.
*
*****************************************************************************/
A function to update the logMeanMessageInterval field in a PTP packet
A function to update the logMeanMessageInterval field in a PTP packet
void XAvb_UpdateLogMeanMessageInterval(u32 BaseAddress,
                                       u32 PtpFrameBaseAddr,
                                       u16 intervalDuration) {
  u32 ReadVal;
  u8 logMean;
  logMean = (u8)XAvb_ConvertDurationToLogMean(intervalDuration);
  ReadVal = XAvb_ReadPtpBuffer(BaseAddress,
                                PtpFrameBaseAddr,
                                XAVB_PTP_TX_PKT_SEQUENCEID_OFFSET);
  ReadVal = (ReadVal & 0x00ffffff) | (logMean << 24);
  XAvb_WritePtpBuffer(BaseAddress,
                       PtpFrameBaseAddr,
                       XAVB_PTP_TX_PKT_SEQUENCEID_OFFSET,
                       ReadVal);
}
void XAvb_UpdateLogMeanMessageInterval ( u32 BaseAddress , u32 PtpFrameBaseAddr , u16 intervalDuration ) { u32 ReadVal ; u8 logMean ; logMean = ( u8 ) XAvb_ConvertDurationToLogMean ( intervalDuration ) ; ReadVal = XAvb_ReadPtpBuffer ( BaseAddress , PtpFrameBaseAddr , XAVB_PTP_TX_PKT_SEQUENCEID_OFFSET ) ; ReadVal = ( ReadVal & 0x00ffffff ) | ( logMean << 24 ) ; XAvb_WritePtpBuffer ( BaseAddress , PtpFrameBaseAddr , XAVB_PTP_TX_PKT_SEQUENCEID_OFFSET , ReadVal ) ; }
A function to update the logMeanMessageInterval field in a PTP packet
A function to update the logMeanMessageInterval field in a PTP packet
/** Convert intervalDuration to a logMean value */ /** Read the current fields */ /** Update just the logMeanMessageInterval field */ /** Write back */