pt1588-SH7216 1
IEEE1588v2 Implementation for Renesas SH7216 Demo
|
Define the platform-dependent interface with the real time clock that is required for the correct operation of PTP. More...
Go to the source code of this file.
Functions | |
void | getClock (Timestamp *timestamp) |
Update the provided Timestamp timestamp with the current clock timestamp. | |
void | stepClockTimeInterval (const TimeInterval *timeInterval) |
Step the clock by the negated value of the provided TimeInterval timeInterval. | |
void | rateAdjustClock (Integer32 rateAdj) |
Adjust the rate of the clock by rateAdj. | |
void | toTimeInterval (const Timestamp *t1, const Timestamp *t2, TimeInterval *timeInterval) |
Convert the difference between two Timestamp, t2 - t1, to a TimeInterval timeInterval. | |
void | addTimeIntervalToTimestamp (const TimeInterval *timeInterval, Timestamp *timestamp) |
Add the TimeInterval timeInterval to the Timestamp timestamp. | |
void | addFutureEvent (const Event *event) |
Fire PTPActor() with Event event at the time of event's timestamp. |
Define the platform-dependent interface with the real time clock that is required for the correct operation of PTP.
Definition in file ptp-clock.h.
void addFutureEvent | ( | const Event * | event | ) |
Fire PTPActor() with Event event at the time of event's timestamp.
[in] | event | The future event. |
Fire PTPActor() with Event event at the time of event's timestamp.
This is implementation specific because it is the responsibily of the program utilizing the PTP protocol to fire the PTPActor() at the correct time.
Definition at line 194 of file ptp-clock.c.
void addTimeIntervalToTimestamp | ( | const TimeInterval * | timeInterval, |
Timestamp * | timestamp | ||
) |
Add the TimeInterval timeInterval to the Timestamp timestamp.
[in] | timeInterval | The TimeInterval being added. |
[in,out] | timestamp | The Timestamp being added to. |
Add the TimeInterval timeInterval to the Timestamp timestamp.
This function may be implementation specific depending on how Integer64 values are handled in computations.
Definition at line 156 of file ptp-clock.c.
void getClock | ( | Timestamp * | timestamp | ) |
Update the provided Timestamp timestamp with the current clock timestamp.
[in,out] | timestamp | The destination of timestamp from clock read. |
Update the provided Timestamp timestamp with the current clock timestamp.
In this implementation, the clock timestamp is retrieved by reading the timestamp from the registers on the DP83640 via a serial interface.
Definition at line 38 of file ptp-clock.c.
void rateAdjustClock | ( | Integer32 | rateAdj | ) |
Adjust the rate of the clock by rateAdj.
[in] | rateAdj | The amount to adjust the rate of the clock in units of 100ps/sec. |
Adjust the rate of the clock by rateAdj.
In this implementation, this is done by correctly setting registers in the DP83640 via a serial interface. Positive is higher frequency.
Definition at line 107 of file ptp-clock.c.
void stepClockTimeInterval | ( | const TimeInterval * | timeInterval | ) |
Step the clock by the negated value of the provided TimeInterval timeInterval.
[in] | timeInterval | The time interval that is negated to step the clock. |
Step the clock by the negated value of the provided TimeInterval timeInterval.
In this implementation, this is done by setting registers on the DP83640 via a serial interface. Note: The timeInterval supplied is an offset (slave time - master time) so actual adjustment is the opposite sign of the offset. The timestamps of events in the event queue are also fixed to account for clock step.
Definition at line 65 of file ptp-clock.c.
void toTimeInterval | ( | const Timestamp * | t1, |
const Timestamp * | t2, | ||
TimeInterval * | timeInterval | ||
) |
Convert the difference between two Timestamp, t2 - t1, to a TimeInterval timeInterval.
[in] | t1 | Base Timestamp. |
[in] | t2 | Timestamp being subtracted. |
[out] | timeInterval | The TimeInterval difference. |
Convert the difference between two Timestamp, t2 - t1, to a TimeInterval timeInterval.
This function may be implementation specific depending on how Integer64 values are handled in computations.
Definition at line 138 of file ptp-clock.c.