XilinxProcessorIPLib/drivers/axiethernet/examples/avb/xavb.c
void XAvb_Reset(XAvb * InstancePtr)
{
  /** Assert bad arguments and conditions */
  Xil_AssertVoid(InstancePtr != NULL);
  Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);

  /**
   * Perform a Software Reset of the AVB Core.
   * This will reset both the transmitter and receiver paths.
   * The RTC counter is not reset here.
   */
  XAvb_WriteReg(InstancePtr->Config.BaseAddress,
                 XAVB_SW_RESET_OFFSET,
                 XAVB_SW_RESET_TX_AND_RX_PATHS);

  /**
   * Set IEEE specification default values in the device's data structure
   */
  xil_printf("\r\n*** XAvb_Reset() : Call XAvb_BecomeRtcMaster() *** \r\n");
  XAvb_BecomeRtcMaster(InstancePtr,0);
  XAvb_ChangePeerASCapability(InstancePtr, 0);

  InstancePtr->PtpIsRunning                                  = 0;
  InstancePtr->PtpRecords.LinkDelay                          = 0;
  InstancePtr->SignallingFrameData.SyncIntervalDuration      =
    XAvb_ConvertLogMeanToDuration(XAVB_DEFAULT_LOG_MEAN_SYNC_INTERVAL);
  InstancePtr->SignallingFrameData.LinkDelayIntervalDuration =
    XAvb_ConvertLogMeanToDuration(XAVB_DEFAULT_LOG_MEAN_PDELAY_REQ_INTERVAL);
  InstancePtr->SignallingFrameData.AnnounceIntervalDuration  =
    XAvb_ConvertLogMeanToDuration(XAVB_DEFAULT_LOG_MEAN_ANNOUNCE_INTERVAL);

  InstancePtr->latestMDSyncReceive.SyncIntervalDuration     =
     XAvb_ConvertLogMeanToDuration(XAVB_DEFAULT_LOG_MEAN_SYNC_INTERVAL);

  /** Update logMeanMessageInterval in the pre-loaded TX SYNC message buffer */
  XAvb_UpdateLogMeanMessageInterval(InstancePtr->Config.BaseAddress,
                                    XAVB_PTP_TX_SYNC_OFFSET,
                                    InstancePtr->SignallingFrameData.SyncIntervalDuration);
  /** Update logMeanMessageInterval in the pre-loaded TX FOLLOW_UP message buffer */
  XAvb_UpdateLogMeanMessageInterval(InstancePtr->Config.BaseAddress,
                                    XAVB_PTP_TX_FOLLOW_UP_OFFSET,
                                    InstancePtr->SignallingFrameData.SyncIntervalDuration);

  /** Update logMeanMessageInterval in the pre-loaded TX PDELAYREQ message buffer */
  XAvb_UpdateLogMeanMessageInterval(InstancePtr->Config.BaseAddress,
                                    XAVB_PTP_TX_PDELAYREQ_OFFSET,
                                    InstancePtr->SignallingFrameData.LinkDelayIntervalDuration);

  /** Update logMeanMessageInterval in the pre-loaded TX ANNOUNCE message buffer  */
  XAvb_UpdateLogMeanMessageInterval(InstancePtr->Config.BaseAddress,
                                    XAVB_PTP_TX_ANNOUNCE_OFFSET,
                                    InstancePtr->SignallingFrameData.AnnounceIntervalDuration);

  /**
   * Initialise other driver variables in the device's data structure
   */
  InstancePtr->PtpCounters.RxPtpHardPointer               = 0;
  InstancePtr->PtpCounters.RxPtpSoftPointer               = 0xFF;
  InstancePtr->PtpCounters.CounterSyncInterval            = 0;
  InstancePtr->PtpCounters.CounterLinkDelayInterval       = 0;
  InstancePtr->PtpCounters.CounterAnnounceInterval        = 0;
  InstancePtr->PtpCounters.CounterSyncEvents              = 0;
  InstancePtr->StateMachineData.lostResponses             = 0;
  InstancePtr->StateMachineData.rcvdPDelayResp            = 0;
  InstancePtr->StateMachineData.rcvdPDelayRespFollowUp    = 0;
#ifdef DEBUG_XAVB_LEVEL1
  xil_printf("\r\n** XAvb_Reset(): PTP Driver Reset **");
#endif
}
/*****************************************************************************/
/**
*
* This function resets all of the AVB device driver functions to the start-up
* (reset) defaults.
*
* @param  InstancePtr is a pointer to the Xavb instance to be worked on.
*
* @return None.
*
* @note   None.
*
******************************************************************************/
This function resets all of the AVB device driver functions to the start-up
(reset) defaults.
This function resets all of the AVB device driver functions to the start - up ( reset ) defaults .
void XAvb_Reset(XAvb * InstancePtr)
{
  Xil_AssertVoid(InstancePtr != NULL);
  Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
  XAvb_WriteReg(InstancePtr->Config.BaseAddress,
                 XAVB_SW_RESET_OFFSET,
                 XAVB_SW_RESET_TX_AND_RX_PATHS);
  xil_printf("\r\n*** XAvb_Reset() : Call XAvb_BecomeRtcMaster() *** \r\n");
  XAvb_BecomeRtcMaster(InstancePtr,0);
  XAvb_ChangePeerASCapability(InstancePtr, 0);
  InstancePtr->PtpIsRunning                                  = 0;
  InstancePtr->PtpRecords.LinkDelay                          = 0;
  InstancePtr->SignallingFrameData.SyncIntervalDuration      =
    XAvb_ConvertLogMeanToDuration(XAVB_DEFAULT_LOG_MEAN_SYNC_INTERVAL);
  InstancePtr->SignallingFrameData.LinkDelayIntervalDuration =
    XAvb_ConvertLogMeanToDuration(XAVB_DEFAULT_LOG_MEAN_PDELAY_REQ_INTERVAL);
  InstancePtr->SignallingFrameData.AnnounceIntervalDuration  =
    XAvb_ConvertLogMeanToDuration(XAVB_DEFAULT_LOG_MEAN_ANNOUNCE_INTERVAL);
  InstancePtr->latestMDSyncReceive.SyncIntervalDuration     =
     XAvb_ConvertLogMeanToDuration(XAVB_DEFAULT_LOG_MEAN_SYNC_INTERVAL);
  XAvb_UpdateLogMeanMessageInterval(InstancePtr->Config.BaseAddress,
                                    XAVB_PTP_TX_SYNC_OFFSET,
                                    InstancePtr->SignallingFrameData.SyncIntervalDuration);
  XAvb_UpdateLogMeanMessageInterval(InstancePtr->Config.BaseAddress,
                                    XAVB_PTP_TX_FOLLOW_UP_OFFSET,
                                    InstancePtr->SignallingFrameData.SyncIntervalDuration);
  XAvb_UpdateLogMeanMessageInterval(InstancePtr->Config.BaseAddress,
                                    XAVB_PTP_TX_PDELAYREQ_OFFSET,
                                    InstancePtr->SignallingFrameData.LinkDelayIntervalDuration);
  XAvb_UpdateLogMeanMessageInterval(InstancePtr->Config.BaseAddress,
                                    XAVB_PTP_TX_ANNOUNCE_OFFSET,
                                    InstancePtr->SignallingFrameData.AnnounceIntervalDuration);
  InstancePtr->PtpCounters.RxPtpHardPointer               = 0;
  InstancePtr->PtpCounters.RxPtpSoftPointer               = 0xFF;
  InstancePtr->PtpCounters.CounterSyncInterval            = 0;
  InstancePtr->PtpCounters.CounterLinkDelayInterval       = 0;
  InstancePtr->PtpCounters.CounterAnnounceInterval        = 0;
  InstancePtr->PtpCounters.CounterSyncEvents              = 0;
  InstancePtr->StateMachineData.lostResponses             = 0;
  InstancePtr->StateMachineData.rcvdPDelayResp            = 0;
  InstancePtr->StateMachineData.rcvdPDelayRespFollowUp    = 0;
#ifdef DEBUG_XAVB_LEVEL1
  xil_printf("\r\n** XAvb_Reset(): PTP Driver Reset **");
#endif
}
void XAvb_Reset ( XAvb * InstancePtr ) { Xil_AssertVoid ( InstancePtr != NULL ) ; Xil_AssertVoid ( InstancePtr -> IsReady == XIL_COMPONENT_IS_READY ) ; XAvb_WriteReg ( InstancePtr -> Config . BaseAddress , XAVB_SW_RESET_OFFSET , XAVB_SW_RESET_TX_AND_RX_PATHS ) ; xil_printf ( " \r \n \r \n " ) ; XAvb_BecomeRtcMaster ( InstancePtr , 0 ) ; XAvb_ChangePeerASCapability ( InstancePtr , 0 ) ; InstancePtr -> PtpIsRunning = 0 ; InstancePtr -> PtpRecords . LinkDelay = 0 ; InstancePtr -> SignallingFrameData . SyncIntervalDuration = XAvb_ConvertLogMeanToDuration ( XAVB_DEFAULT_LOG_MEAN_SYNC_INTERVAL ) ; InstancePtr -> SignallingFrameData . LinkDelayIntervalDuration = XAvb_ConvertLogMeanToDuration ( XAVB_DEFAULT_LOG_MEAN_PDELAY_REQ_INTERVAL ) ; InstancePtr -> SignallingFrameData . AnnounceIntervalDuration = XAvb_ConvertLogMeanToDuration ( XAVB_DEFAULT_LOG_MEAN_ANNOUNCE_INTERVAL ) ; InstancePtr -> latestMDSyncReceive . SyncIntervalDuration = XAvb_ConvertLogMeanToDuration ( XAVB_DEFAULT_LOG_MEAN_SYNC_INTERVAL ) ; XAvb_UpdateLogMeanMessageInterval ( InstancePtr -> Config . BaseAddress , XAVB_PTP_TX_SYNC_OFFSET , InstancePtr -> SignallingFrameData . SyncIntervalDuration ) ; XAvb_UpdateLogMeanMessageInterval ( InstancePtr -> Config . BaseAddress , XAVB_PTP_TX_FOLLOW_UP_OFFSET , InstancePtr -> SignallingFrameData . SyncIntervalDuration ) ; XAvb_UpdateLogMeanMessageInterval ( InstancePtr -> Config . BaseAddress , XAVB_PTP_TX_PDELAYREQ_OFFSET , InstancePtr -> SignallingFrameData . LinkDelayIntervalDuration ) ; XAvb_UpdateLogMeanMessageInterval ( InstancePtr -> Config . BaseAddress , XAVB_PTP_TX_ANNOUNCE_OFFSET , InstancePtr -> SignallingFrameData . AnnounceIntervalDuration ) ; InstancePtr -> PtpCounters . RxPtpHardPointer = 0 ; InstancePtr -> PtpCounters . RxPtpSoftPointer = 0xFF ; InstancePtr -> PtpCounters . CounterSyncInterval = 0 ; InstancePtr -> PtpCounters . CounterLinkDelayInterval = 0 ; InstancePtr -> PtpCounters . CounterAnnounceInterval = 0 ; InstancePtr -> PtpCounters . CounterSyncEvents = 0 ; InstancePtr -> StateMachineData . lostResponses = 0 ; InstancePtr -> StateMachineData . rcvdPDelayResp = 0 ; InstancePtr -> StateMachineData . rcvdPDelayRespFollowUp = 0 ; #ifdef DEBUG_XAVB_LEVEL1 xil_printf ( " \r \n " ) ; #endif }
This function resets all of the AVB device driver functions to the start-up
(reset) defaults.
This function resets all of the AVB device driver functions to the start - up ( reset ) defaults .
/** Assert bad arguments and conditions */ /**
   * Perform a Software Reset of the AVB Core.
   * This will reset both the transmitter and receiver paths.
   * The RTC counter is not reset here.
   */ /**
   * Set IEEE specification default values in the device's data structure
   */ /** Update logMeanMessageInterval in the pre-loaded TX SYNC message buffer */ /** Update logMeanMessageInterval in the pre-loaded TX FOLLOW_UP message buffer */ /** Update logMeanMessageInterval in the pre-loaded TX PDELAYREQ message buffer */ /** Update logMeanMessageInterval in the pre-loaded TX ANNOUNCE message buffer  */ /**
   * Initialise other driver variables in the device's data structure
   */