To initialize a trigger, set the trigger
configuration using the appropriate PTP Trigger Configuration
Register. Arming a trigger consists of the following steps:
- Set the
'Trigger Load' bit in the PTP Control Register
(PTP_CTL) along with the 'Trigger Select' setting
for the trigger. This disables the trigger if the
trigger is previously enabled.
- Write to
PTP_TDR: Start_time_ns[15:0].
- Write to
PTP_TDR: Initial state, Wait for Rollover,
Start_time_ns[29:16] (Initial state is the stage of
the GPIO before triggering starts) (If the wait for
rollover bit is set, the bit indicates that the
trigger is not be armed until the seconds field of
the clock time has rolled over from 0xFFFF_FFFF to
0.)
- Write to
PTP_TDR: Start_time_sec[15:0].
- Write to
PTP_TDR: Start_time_sec[31:16].
- Write to
PTP_TDR: Pulsewidth[15:0].
- Write to
PTP_TDR: Pulsewidth[31:16].
- Write to
PTP_TDR: Pulsewidth2[15:0].
- Write to
PTP_TDR: Pulsewidth2[31:16].
- Set the
'Trigger Enable' bit in the PTP_CTL register along
with the 'Trigger Select' setting for the
trigger
For Edge type signals, Pulsewidth2 is
interpreted as a 16-bit seconds field and Pulsewidth1 is a 30-bit nanoseconds
field.
For Triggers 0 and 1, when used for
Single or Periodic Pulse type signal, Pulsewidth controls the first pulse width and
Pulsewidth2 value controls the second pulse width (total period is Pulsewidth +
Pulsewidth2). For Pulsewidth and Pulsewidth2, bits[31:30] is the seconds field and
bits[29:0] is the nanoseconds field.
For all other triggers in periodic
mode, the high and low pulse widths are the same (period is twice Pulsewidth) and
Pulsewidth2 is not used. For Pulsewidth, bits[31:30] is the seconds field and
bits[29:0] is the nanoseconds field.
Step 10 is not necessary if all appropriate fields
are written. If fields are not changing from previous settings, the
latter writes to the PTP_TDR register can be skipped and Step 10 can be excluded.
Reading the trigger control settings is similar to
the process for writing these values.
- Set the
'Trigger Read' bit in the PTP Control Register
(PTP_CTL) along with the 'Trigger Select' setting
for the trigger.
- Read
fields from PTP_TDR in same order as written
above.
Note that for periodic signals, the time value being read back
is the next programmed trigger time rather than the start trigger
time (these are or are not the same value). This capability is
essential for diagnostic purposes only.