I am trying to find certain information in datasheet for PTP_TDR (page 4), but with no luck.
I am using the dp83640 April 2015 datasheet.
In paragraph 5.6.1.5.2 it is indicated:
"On Writes, successively stores the 16-bit values of Clock time or Trigger Control
Information as selected by controls in the PTP Control Register."
However, I can't find anywhere information about which are the successive stores from Clock time or Trigger Control.
Related to that, in the software development guide I see:
EXPORT void
PTPArmTrigger (
IN PEPL_PORT_HANDLE portHandle,
IN NS_UINT trigger,
IN NS_UINT32 expireTimeSeconds,
IN NS_UINT32 expireTimeNanoSeconds,
IN NS_BOOL initialStateFlag,
IN NS_BOOL waitForRolloverFlag,
IN NS_UINT32 pulseWidth,
IN NS_UINT32 pulseWidth2)
// Establishes a trigger's expiration time and trigger pulse width behavior.
//
// portHandle
// Handle that represents a port. This is obtained using the EPLEnumPort
// function.
// trigger
// The trigger to arm, 0 - 7.
// expireTimeSeconds
// The seconds portion of the desired expiration time relative to the
// IEEE 1588 hardware clock.
// expireTimeNanoSeconds
// The nanoseconds portion of the desired expiration time relative to
// the IEEE 1588 hardware clock. This value may be not be larger then
// 1e9 (1 second).
// initialStateFlag
// Indicates initial state of signal to be set when trigger is armed
// (FALSE will cause a signal rise at trigger time, TRUE will cause a
// signal fall at trigger time). This parameter is ignored in toggle
// mode.
// waitForRolloverFlag
// If set to TRUE the device should not arm the trigger until after
// the seconds field of the clock time has rolled over from
// 0xFFFF_FFFF to 0.
// pulseWidth
// Sets the 50% duty cycle time for triggers 2 - 7. Its format is
// bits [31:30] = seconds, [29:0] = nanoseconds. For triggers 0 and 1
// sets the width of the first part of the pulse, the width of the
// second part of the pulse is set by the pulseWidth2 parameter.
// pulseWidth2
// Ignored for triggers 2 - 7. For Triggers 0 and 1, in a single or
// periodic pulse type signal, a second pulse width value controls the
// 2nd pulse width (period is pulseWidth + pulseWidth2).
// Its format is bits [31:30] = seconds, [29:0] = nanoseconds.
//
// For Edge type signals, pulseWidth2 is interpreted as a 16-bit seconds
// field and pulseWidth is a 30-bit nanoseconds field.
//
// Returns
// Nothing
//
// Once this function has been called, the trigger will be armed.
//****************************************************************************
{
NS_UINT reg;
OAIBeginMultiCriticalSection( portHandle->oaiDevHandle);
reg = (trigger << P640_TRIG_SEL_SHIFT) | P640_TRIG_LOAD;
EPLWriteReg( portHandle, PHY_PG4_PTP_CTL, reg);
EPLWriteReg( portHandle, PHY_PG4_PTP_TDR, expireTimeNanoSeconds & 0xFFFF);
reg = (expireTimeNanoSeconds >> 16) | (initialStateFlag ? 0x80000000 : 0) |
(waitForRolloverFlag ? 0x40000000 : 0);
EPLWriteReg( portHandle, PHY_PG4_PTP_TDR, reg);
EPLWriteReg( portHandle, PHY_PG4_PTP_TDR, expireTimeSeconds & 0xFFFF);
EPLWriteReg( portHandle, PHY_PG4_PTP_TDR, expireTimeSeconds >> 16);
EPLWriteReg( portHandle, PHY_PG4_PTP_TDR, pulseWidth & 0xFFFF);
EPLWriteReg( portHandle, PHY_PG4_PTP_TDR, pulseWidth >> 16);
if ( trigger <= 1)
{
EPLWriteReg( portHandle, PHY_PG4_PTP_TDR, pulseWidth2 & 0xFFFF);
EPLWriteReg( portHandle, PHY_PG4_PTP_TDR, pulseWidth2 >> 16);
}
reg = (trigger << P640_TRIG_SEL_SHIFT) | P640_TRIG_EN;
EPLWriteReg( portHandle, PHY_PG4_PTP_CTL, reg);
OAIEndMultiCriticalSection( portHandle->oaiDevHandle);
return;
}
I can't find in the datasheet these consecutive data fields that are written in PTP_TDR.
Moreover, the above PTPArmTrigger method has a variable name expireTimeSeconds. However, in the example of the software development guide this variable is named ppsStartTime.
PTPArmTrigger( portHandle, 0, ptpStackCfg->ppsStartTime, 0,
ptpStackCfg->ppsRiseOrFallFlag, FALSE, 500000000, 500000000);
Which of the two holds? Is it a start time or expiring time?