RA Flexible Software Package Documentation  Release v5.6.0

 
PTP Interface

Detailed Description

Interface for PTP functions.

Summary

The PTP interface provides the functionality for using PTP.

Data Structures

struct  ptp_clock_properties_t
 
struct  ptp_time_t
 
struct  ptp_message_flags_t
 
struct  ptp_message_header_t
 
struct  ptp_message_sync_t
 
struct  ptp_message_pdelay_req_t
 
struct  ptp_message_pdelay_resp_t
 
struct  ptp_message_announce_t
 
struct  ptp_message_signaling_t
 
struct  ptp_message_management_t
 
struct  ptp_message_t
 
struct  ptp_callback_args_t
 
struct  ptp_pulse_timer_common_cfg_t
 
struct  ptp_pulse_timer_cfg_t
 
struct  ptp_sync_state_cfg_t
 
struct  ptp_synfp_cfg_t
 
struct  ptp_synfp_cfg_t.ether
 
struct  ptp_synfp_cfg_t.ipv4
 
struct  ptp_stca_cfg_t
 
struct  ptp_cfg_t
 
struct  ptp_api_t
 
struct  ptp_instance_t
 

Typedefs

typedef enum PTP_PACKED e_ptp_ctrl_field ptp_ctrl_field_t
 
typedef ptp_message_sync_t ptp_message_delay_req_t
 
typedef ptp_message_sync_t ptp_message_follow_up_t
 
typedef ptp_message_pdelay_resp_t ptp_message_delay_resp_t
 
typedef ptp_message_delay_resp_t ptp_message_pdelay_resp_follow_up_t
 

Enumerations

enum  ptp_message_type_t
 
enum  ptp_port_state_t
 
enum  ptp_clock_delay_mechanism_t
 
enum  ptp_frame_format_t
 
enum  ptp_frame_filter_mode_t
 
enum  ptp_stca_clock_freq_t
 
enum  ptp_stca_clock_sel_t
 
enum  ptp_message_interval_t
 
enum  ptp_clock_correction_mode_t
 
enum  ptp_event_t
 
enum  ptp_ethernet_phy_interface_t
 

Variables

enum PTP_PACKED e_ptp_ctrl_field
 

Data Structure Documentation

◆ ptp_clock_properties_t

struct ptp_clock_properties_t

Clock properties used in the best master clock algorithm (BMCA) in order to determine the grandmaster clock.

In master mode, these properties will be advertised in announce messages.

Note: The final property used in BMCA is the clock ID. This is usually configured at runtime because it is often based on the hardware address.

Data Fields
uint8_t priority1 Priority1 value used in best master calculation.
uint8_t cclass Class value.
uint8_t accuracy Accuracy of the clock.
uint16_t variance Variance of the clock.
uint8_t priority2 Priority2 value used as secondary priority in best master calculation.

◆ ptp_time_t

struct ptp_time_t

Structure for storing time with nanosecond precision .

Data Fields
uint16_t seconds_upper Upper 16 bits of the seconds.
uint32_t seconds_lower Lower 32 bits of the seconds.
uint32_t nanoseconds Nanoseconds.

◆ ptp_message_flags_t

struct ptp_message_flags_t

Flags field in PTP message header.

◆ ptp_message_header_t

struct ptp_message_header_t

Commom PTP Message Header.

Data Fields
uint8_t message_type: 4 The message type.
uint8_t sdoid_major: 4 Standard Organization ID Major.
uint8_t version: 4 PTP Version.
uint8_t minor_version: 4 PTP Minor Version.
uint16_t message_length The total message length (Including the header).
uint8_t domain The clock domain.
uint8_t sdoid_minor: 8 Standard Organization ID minor.
ptp_message_flags_t flags Flags set in the message.
uint64_t correction_field Correction Field that is updated when a message passes through a transparent clock.
uint32_t reserved
uint8_t clock_id[8] Clock ID that the message was sent from.
uint16_t source_port_id Port ID that the message was sent from.
uint16_t sequence_id Sequence ID of the message.
ptp_ctrl_field_t control_field Control field (Message specifc).
uint8_t log_message_interval Logbase2 of the message period.

◆ ptp_message_sync_t

struct ptp_message_sync_t

Sync Message Type (0x00).

Data Fields
ptp_time_t origin_timestamp Timestamp when the message was transmitted.

◆ ptp_message_pdelay_req_t

struct ptp_message_pdelay_req_t

PDelay_req Message Type (0x02).

Data Fields
ptp_time_t origin_timestamp Timestamp when the message was transmitted.
uint8_t reserved[10]

◆ ptp_message_pdelay_resp_t

struct ptp_message_pdelay_resp_t

PDelay_resp Message Type (0x03).

Data Fields
ptp_time_t origin_timestamp Timestamp when the message was transmitted.
uint8_t source_port_identity[10] Clock ID + sourcePortId.

◆ ptp_message_announce_t

struct ptp_message_announce_t

Announce Message Type (0x0B).

Data Fields
ptp_time_t origin_timestamp Timestamp when the message was transmitted.
uint16_t current_utc_offset Offset from UTC in seconds.
uint8_t reserved
ptp_clock_properties_t clock_properties Clock properties used in Best Master Clock Algorithm.
uint8_t clock_id[8] Clock ID that the message was sent from.
uint16_t steps_removed The number of boundary clocks between the clock and the grand master clock.
uint8_t time_source The source of time (Eg. INTERNAL_OSC).

◆ ptp_message_signaling_t

struct ptp_message_signaling_t

Signaling Message Type (0x0C).

Data Fields
uint8_t target_clock_id[8] ID of the target PTP instance.
uint16_t target_port_id Port of the target PTP instance.

◆ ptp_message_management_t

struct ptp_message_management_t

Management Message Type (0x0D).

Data Fields
uint8_t target_clock_id[8] ID of the target PTP instance.
uint16_t target_port_id Port of the target PTP instance.
uint8_t starting_boundary_hops The starting number of times the message is retransmitted by boundary clocks.
uint8_t boundary_hops The remaining number of retransmissions.
uint8_t action The action that will be taken on reception of the message.
uint8_t reserved

◆ ptp_message_t

struct ptp_message_t

Complete PTP Message.

Data Fields
ptp_message_header_t header Header of the message.
union ptp_message_t __unnamed__

◆ ptp_callback_args_t

struct ptp_callback_args_t

Arguments passed to p_ptp_callback.

Data Fields
ptp_event_t event Event that caused the callback.
ptp_message_t const * p_message The message received (PTP message fields will be little endian).
uint8_t const * p_tlv_data Start of TLV data (TLV data will be big endian).
uint16_t tlv_data_size Total bytes of TLV data.
uint32_t pulse_timer_channel Channel of the pulse timer that caused ptp_event_t::PTP_EVENT_PULSE_TIMER_MINT_RISING_EDGE.
void const * p_context Context value set in the configuration.

◆ ptp_pulse_timer_common_cfg_t

struct ptp_pulse_timer_common_cfg_t

Structure for configuring the IPLS IRQ settings that are common to all pulse timer channels.

Data Fields
ptp_enable_t ipls_rising_irq Enable the IPLS IRQ when a rising edge is detected.
ptp_enable_t ipls_falling_irq Enable the IPLS IRQ when a falling edge is detected.
ptp_enable_t ipls_rising_irq_auto_clear Auto disable the rising edge IRQ after the first rising edge is detected.
ptp_enable_t ipls_falling_irq_auto_clear Auto disable the falling edge IRQ after the first falling edge is detected.

◆ ptp_pulse_timer_cfg_t

struct ptp_pulse_timer_cfg_t

Structure for configuring a pulse timer channel.

Data Fields
ptp_time_t start_time The exact time when the timer will start.
uint32_t period The period of the timer in nanoseconds.
uint32_t pulse The pulse width of the timer in nanoseconds.
ptp_enable_t mint_rising_irq Enable MINT rising edge IRQ.
ptp_enable_t ipls_rising_event Enable IPLS rising edge ELC event.
ptp_enable_t ipls_falling_event Enable IPLS falling edge ELC event.
ptp_enable_t ipls_rising_event_auto_clear Enable IPLS rising edge ELC event.
ptp_enable_t ipls_falling_event_auto_clear Enable IPLS falling edge ELC event.
ptp_enable_t ipls_irq_source Enable using this channel as a source for the IPLS IRQ.

◆ ptp_sync_state_cfg_t

struct ptp_sync_state_cfg_t

Configuration settings for determining when the PTP clock is synchronized.

Data Fields
uint64_t threshold

The maximum clock offset required to transition between synchronization states.

uint8_t count

The number of times the clock must be above the threshold in order to transition between synchronization states.

◆ ptp_synfp_cfg_t

struct ptp_synfp_cfg_t

Configuration settings for the SYNFP.

Data Fields
ptp_ethernet_phy_interface_t ethernet_phy_interface The type of interface used to communicate with the PHY.
ptp_frame_format_t frame_format Frame format used to transport PTP messages.
ptp_frame_filter_mode_t frame_filter Frame filter mode.
uint8_t clock_domain Clock domain that the clock operates in.
ptp_enable_t clock_domain_filter Filter out messages from other clock domains.
ptp_message_interval_t announce_interval Interval for transmitting announce messages.
ptp_message_interval_t sync_interval Interval for transmitting sync messages.
ptp_message_interval_t delay_req_interval Interval for transmitting delay_req messages.
uint32_t message_timeout Timeout in milliseconds for receiving PTP messages.
ptp_clock_properties_t clock_properties Clock properties used in annonce messages.
uint8_t timesource TimeSource field used in announce messages.
uint8_t * p_multicast_addr_filter Filter for multicast packets.
struct ptp_synfp_cfg_t ether

Valid if frame_format is set to Ethernet II or IEEE 802.3.

struct ptp_synfp_cfg_t ipv4

Valid if frame_format is set to IPV4_UDP.

◆ ptp_synfp_cfg_t.ether

struct ptp_synfp_cfg_t.ether

Valid if frame_format is set to Ethernet II or IEEE 802.3.

Data Fields
uint8_t * p_primary_mac_addr The MAC address to send primary messages.
uint8_t * p_pdelay_mac_addr The MAC address to send p2p messages.

◆ ptp_synfp_cfg_t.ipv4

struct ptp_synfp_cfg_t.ipv4

Valid if frame_format is set to IPV4_UDP.

Data Fields
uint32_t primary_ip_addr The IP address to send primary messages.
uint32_t pdelay_ip_addr The IP address to send pdelay messages.
uint8_t event_tos Type of service for event messages.
uint8_t general_tos Type of service for general messages.
uint8_t primary_ttl Time to live for primary messages.
uint8_t pdelay_ttl Time to live for pdelay messages.
uint16_t event_udp_port The port to send event messages.
uint16_t general_udp_port The port to send general messages.

◆ ptp_stca_cfg_t

struct ptp_stca_cfg_t

Configuration settings for the STCA.

Data Fields
ptp_stca_clock_freq_t clock_freq Select the clock frequency of the STCA.
ptp_stca_clock_sel_t clock_sel Select the input clock to the STCA.
ptp_clock_correction_mode_t clock_correction_mode Select the clock correction mode.
uint8_t gradient_worst10_interval Select the interval for the gradient worst10 acquisition.
ptp_sync_state_cfg_t sync_threshold Configure the synchronization threshold.
ptp_sync_state_cfg_t sync_loss_threshold Configure the SYnchronization lost threshold.

◆ ptp_cfg_t

struct ptp_cfg_t

User configuration structure, used in open function

Data Fields

ptp_synfp_cfg_t synfp
 Configuration settings for the SYNFP.
 
ptp_stca_cfg_t stca
 Configuration settings for the STCA.
 
edmac_instance_t * p_edmac_instance
 Pointer to PTP edmac instance.
 
uint16_t buffer_size
 The maximum Ethernet packet size that can be transmitted or received.
 
uint8_t ** p_rx_buffers
 Pointer to list of buffers used to receive PTP packets.
 
uint8_t ** p_tx_buffers
 Pointer to list of buffers used to transmit PTP packets.
 
IRQn_Type mint_irq
 Interrupt number for PTP event IRQ.
 
IRQn_Type ipls_irq
 Interrupt number for PTP timer IRQ.
 
uint8_t mint_ipl
 Interrupt priority of the PTP event IRQ.
 
uint8_t ipls_ipl
 Interrupt priority of the PTP timer IRQ.
 
void(* p_callback )(ptp_callback_args_t *p_args)
 

Field Documentation

◆ p_callback

void(* ptp_cfg_t::p_callback) (ptp_callback_args_t *p_args)

Callback for handling received PTP events.

◆ ptp_api_t

struct ptp_api_t

Timer API structure. General timer functions implemented at the HAL layer follow this API.

Data Fields

fsp_err_t(* open )(ptp_ctrl_t *const p_ctrl, ptp_cfg_t const *const p_cfg)
 
fsp_err_t(* macAddrSet )(ptp_ctrl_t *const p_ctrl, uint8_t const *const p_mac_addr)
 
fsp_err_t(* ipAddrSet )(ptp_ctrl_t *const p_ctrl, uint32_t ip_addr)
 
fsp_err_t(* localClockIdSet )(ptp_ctrl_t *const p_ctrl, uint8_t const *const p_clock_id)
 
fsp_err_t(* masterClockIdSet )(ptp_ctrl_t *const p_ctrl, uint8_t const *const p_clock_id, uint16_t port_id)
 
fsp_err_t(* messageFlagsSet )(ptp_ctrl_t *const p_ctrl, ptp_message_type_t message_type, ptp_message_flags_t flags)
 
fsp_err_t(* currentUtcOffsetSet )(ptp_ctrl_t *const p_ctrl, uint16_t offset)
 
fsp_err_t(* portStateSet )(ptp_ctrl_t *const p_ctrl, uint32_t state)
 
fsp_err_t(* messageSend )(ptp_ctrl_t *const p_ctrl, ptp_message_t const *const p_message, uint8_t const *const p_tlv_data, uint16_t tlv_data_size)
 
fsp_err_t(* localClockValueSet )(ptp_ctrl_t *const p_ctrl, ptp_time_t const *const p_time)
 
fsp_err_t(* localClockValueGet )(ptp_ctrl_t *const p_ctrl, ptp_time_t *const p_time)
 
fsp_err_t(* pulseTimerCommonConfig )(ptp_ctrl_t *const p_ctrl, ptp_pulse_timer_common_cfg_t *p_timer_cfg)
 
fsp_err_t(* pulseTimerEnable )(ptp_ctrl_t *const p_ctrl, uint32_t channel, ptp_pulse_timer_cfg_t *const p_timer_cfg)
 
fsp_err_t(* pulseTimerDisable )(ptp_ctrl_t *const p_ctrl, uint32_t channel)
 
fsp_err_t(* close )(ptp_ctrl_t *const p_ctrl)
 

Field Documentation

◆ open

fsp_err_t(* ptp_api_t::open) (ptp_ctrl_t *const p_ctrl, ptp_cfg_t const *const p_cfg)

Initial configuration.

Note
To reconfigure after calling this function, call ptp_api_t::close first.
Parameters
[in]p_ctrlPointer to control structure.
[in]p_cfgPointer to pin configuration structure.

◆ macAddrSet

fsp_err_t(* ptp_api_t::macAddrSet) (ptp_ctrl_t *const p_ctrl, uint8_t const *const p_mac_addr)

Set the MAC address for the PTP.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_hw_addrPointer to the 6 byte MAC address.

◆ ipAddrSet

fsp_err_t(* ptp_api_t::ipAddrSet) (ptp_ctrl_t *const p_ctrl, uint32_t ip_addr)

Set the IP address for the PTP.

Parameters
[in]p_ctrlPointer to control structure.
[in]ip_addr32 bit IPv4 address of the PTP.

◆ localClockIdSet

fsp_err_t(* ptp_api_t::localClockIdSet) (ptp_ctrl_t *const p_ctrl, uint8_t const *const p_clock_id)

Set the local clock ID (Usually based off of the PTP MAC address).

Parameters
[in]p_ctrlPointer to control structure.
[in]p_clock_idPointer to 8 byte clock ID.

◆ masterClockIdSet

fsp_err_t(* ptp_api_t::masterClockIdSet) (ptp_ctrl_t *const p_ctrl, uint8_t const *const p_clock_id, uint16_t port_id)

Set the master clock ID (Usually obtained from previously received announce message).

Parameters
[in]p_ctrlPointer to control structure.
[in]p_clock_idPointer to 8 byte clock ID.
[in]port_idThe port on the master clock.

◆ messageFlagsSet

fsp_err_t(* ptp_api_t::messageFlagsSet) (ptp_ctrl_t *const p_ctrl, ptp_message_type_t message_type, ptp_message_flags_t flags)

Set the flags field for the given message type.

Parameters
[in]p_ctrlPointer to control structure.
[in]message_typeThe message type.
[in]flagsFlags to set.

◆ currentUtcOffsetSet

fsp_err_t(* ptp_api_t::currentUtcOffsetSet) (ptp_ctrl_t *const p_ctrl, uint16_t offset)

Sets the offsetFromMaster field in announce messages.

Parameters
[in]p_ctrlPointer to control structure.
[in]offsetNew currentUtcOffset value.

◆ portStateSet

fsp_err_t(* ptp_api_t::portStateSet) (ptp_ctrl_t *const p_ctrl, uint32_t state)

Transition to a new clock state.

Parameters
[in]p_ctrlPointer to control structure.
[in]stateThe state to transition into.

◆ messageSend

fsp_err_t(* ptp_api_t::messageSend) (ptp_ctrl_t *const p_ctrl, ptp_message_t const *const p_message, uint8_t const *const p_tlv_data, uint16_t tlv_data_size)

Send a PTP message. Appropriate fields in the PTP message will be endian swapped. The application must ensure that the TLV data is in big endian format.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_messagePointer to a PTP message.
[in]p_tlv_dataPointer to TLV data that is appended to the end of the PTP message.
[in]tlv_data_sizeSize of the TLV data in bytes.

◆ localClockValueSet

fsp_err_t(* ptp_api_t::localClockValueSet) (ptp_ctrl_t *const p_ctrl, ptp_time_t const *const p_time)

Set the local clock value.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_timePointer to the new time setting.

◆ localClockValueGet

fsp_err_t(* ptp_api_t::localClockValueGet) (ptp_ctrl_t *const p_ctrl, ptp_time_t *const p_time)

Get the local clock value.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_timePointer to store the current time setting.

◆ pulseTimerCommonConfig

fsp_err_t(* ptp_api_t::pulseTimerCommonConfig) (ptp_ctrl_t *const p_ctrl, ptp_pulse_timer_common_cfg_t *p_timer_cfg)

Configuration that is common to all of the pulse timers.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_timer_cfgPointer to the pulse timer common configuration.

◆ pulseTimerEnable

fsp_err_t(* ptp_api_t::pulseTimerEnable) (ptp_ctrl_t *const p_ctrl, uint32_t channel, ptp_pulse_timer_cfg_t *const p_timer_cfg)

Setup a pulse timer.

Parameters
[in]p_ctrlPointer to control structure.
[in]channelThe pulse timer channel to setup.
[in]p_timer_cfgPointer to the pulse timer configuration.

◆ pulseTimerDisable

fsp_err_t(* ptp_api_t::pulseTimerDisable) (ptp_ctrl_t *const p_ctrl, uint32_t channel)

Stop a pulse timer.

Parameters
[in]p_ctrlPointer to control structure.
[in]channelThe pulse timer channel to stop.

◆ close

fsp_err_t(* ptp_api_t::close) (ptp_ctrl_t *const p_ctrl)

Stop PTP operation.

Parameters
[in]p_ctrlPointer to control structure.

◆ ptp_instance_t

struct ptp_instance_t

This structure encompasses everything that is needed to use an instance of this interface.

Data Fields
ptp_ctrl_t * p_ctrl Pointer to the control structure for this instance.
ptp_cfg_t const * p_cfg Pointer to the configuration structure for this instance.
ptp_api_t const * p_api Pointer to the API structure for this instance.

Typedef Documentation

◆ ptp_ctrl_field_t

typedef enum PTP_PACKED e_ptp_ctrl_field ptp_ctrl_field_t

The control field for PTP message header.

◆ ptp_message_delay_req_t

Delay_req Message Type (0x01).

◆ ptp_message_follow_up_t

Follow_up Message Type (0x08).

◆ ptp_message_delay_resp_t

Delay_resp Message Type (0x09).

◆ ptp_message_pdelay_resp_follow_up_t

PDelay_resp_follow_up Message Type (0x0A).

Enumeration Type Documentation

◆ ptp_message_type_t

Standard PTP message types.

Enumerator
PTP_MESSAGE_TYPE_SYNC 

Sync Message Type.

PTP_MESSAGE_TYPE_DELAY_REQ 

Delay_req Message Type.

PTP_MESSAGE_TYPE_PDELAY_REQ 

PDelay_req Message Type.

PTP_MESSAGE_TYPE_PDELAY_RESP 

PDelay_resp Message Type.

PTP_MESSAGE_TYPE_FOLLOW_UP 

Follow_up Message Type.

PTP_MESSAGE_TYPE_DELAY_RESP 

Delay_resp Message Type.

PTP_MESSAGE_TYPE_PDELAY_RESP_FOLLOW_UP 

PDelay_resp_follow_up Message Type.

PTP_MESSAGE_TYPE_ANNOUNCE 

Announce Message Type.

PTP_MESSAGE_TYPE_SIGNALING 

Signaling Message Type.

PTP_MESSAGE_TYPE_MANAGEMENT 

Management Message Type.

◆ ptp_port_state_t

Possible states that the PTP instance can be in.

Enumerator
PTP_PORT_STATE_GENERATE_ANNOUNCE 

Generate Announce Messages.

PTP_PORT_STATE_GENERATE_SYNC 

Generate Sync Messages.

PTP_PORT_STATE_GENERATE_DELAY_REQ 

Generate Delay_req Messages.

PTP_PORT_STATE_GENERATE_PDELAY_REQ 

Generate PDelay_req Messages.

PTP_PORT_STATE_RECEIVE_ANNOUNCE 

Receive Announce Messages from ptp_cfg_t::p_callback.

PTP_PORT_STATE_RECEIVE_SYNC 

Receive Sync Messages from ptp_cfg_t::p_callback.

PTP_PORT_STATE_RECEIVE_FOLLOW_UP 

Receive Follow_up Messages from ptp_cfg_t::p_callback.

PTP_PORT_STATE_RECEIVE_DELAY_REQ 

Receive Delay_req Messages from ptp_cfg_t::p_callback.

PTP_PORT_STATE_RECEIVE_DELAY_RESP 

Receive Delay_resp Messages from ptp_cfg_t::p_callback.

PTP_PORT_STATE_RECEIVE_PDELAY_REQ 

Receive PDelay_req Messages from ptp_cfg_t::p_callback.

PTP_PORT_STATE_RECEIVE_PDELAY_RESP 

Receive PDelay_resp Messages from ptp_cfg_t::p_callback.

PTP_PORT_STATE_RECEIVE_PDELAY_RESP_FOLLOW_UP 

Receive PDelay_resp_follow_up Messages from ptp_cfg_t::p_callback.

PTP_PORT_STATE_RECEIVE_MANAGEMENT 

Receive Management Messages from ptp_cfg_t::p_callback.

PTP_PORT_STATE_RECEIVE_SIGNALING 

Receive Signaling Messages from ptp_cfg_t::p_callback.

PTP_PORT_STATE_PROCESS_SYNC 

Enable Sync Message processing.

PTP_PORT_STATE_PROCESS_FOLLOW_UP 

Enable Follow_up Message processing.

PTP_PORT_STATE_PROCESS_DELAY_REQ 

Enable Delay_req Message processing.

PTP_PORT_STATE_PROCESS_DELAY_RESP 

Enable Delay_resp Message processing.

PTP_PORT_STATE_PROCESS_PDELAY_REQ 

Enable PDelay_req Message processing.

PTP_PORT_STATE_PROCESS_PDELAY_RESP 

Enable PDelay_resp Message processing.

PTP_PORT_STATE_PROCESS_PDELAY_RESP_FOLLOW_UP 

Enable PDelay_resp_follow_up Message processing.

PTP_PORT_STATE_PASSIVE 

Configure the PTP instance to only receive Announce, Management, and Signaling Messages.

PTP_PORT_STATE_E2E_MASTER 

Configure the PTP instance to operate as a E2E Master.

PTP_PORT_STATE_E2E_SLAVE 

Configure the PTP instance to operate as a E2E Slave.

PTP_PORT_STATE_P2P_MASTER 

Configure the PTP instance to operate as a P2P Master.

PTP_PORT_STATE_P2P_SLAVE 

Configure the PTP instance to operate as a P2P Slave.

PTP_PORT_STATE_RECEIVE_ALL 

Configure the PTP instance to receive all messages.

PTP_PORT_STATE_DISABLE 

Disable all PTP message generation, processing, and reception.

◆ ptp_clock_delay_mechanism_t

The mechanism used for delay messages.

Enumerator
PTP_CLOCK_DELAY_MECHANISM_E2E 

End to end delay mechanism.

PTP_CLOCK_DELAY_MECHANISM_P2P 

Peer to peer delay mechanism.

◆ ptp_frame_format_t

Frame formats that PTP messages can be encapsulated in.

Enumerator
PTP_FRAME_FORMAT_ETHERII 

Send PTP messages using Ethernet II frames.

PTP_FRAME_FORMAT_IEEE802_3 

Send PTP messages using IEEE802_3 frames.

PTP_FRAME_FORMAT_ETHERII_IPV4_UDP 

Send PTP messages using Ethernet II frames with an IP and UDP header.

PTP_FRAME_FORMAT_IEEE802_3_IPV4_UDP 

Send PTP messages using IEEE802.3 frames with an IP and UDP header.

◆ ptp_frame_filter_mode_t

Filter PTP messages based on destination MAC address. Messages that pass the filter will be transferred to the ETHERC EDMAC.

Enumerator
PTP_FRAME_FILTER_MODE_EXT_PROMISCUOUS_MODE 

Receive all packets.

PTP_FRAME_FILTER_MODE_UNICAST_MULTICAST 

Receive all unicast packets destined for the PTP and all multicast packets.

PTP_FRAME_FILTER_MODE_UNICAST_MULTICAST_FILTERED 

Receive Unicast packets destined for the PTP and filter configured multicast packets.

PTP_FRAME_FILTER_MODE_UNICAST 

Receive unicast packets destined for the PTP.

◆ ptp_stca_clock_freq_t

STCA input clock frequency.

Enumerator
PTP_STCA_CLOCK_FREQ_20MHZ 

20 Mhz Input Clock

PTP_STCA_CLOCK_FREQ_25MHZ 

25 Mhz Input Clock

PTP_STCA_CLOCK_FREQ_50MHZ 

50 Mhz Input Clock

PTP_STCA_CLOCK_FREQ_100MHZ 

100 Mhz Input Clock

◆ ptp_stca_clock_sel_t

STCA input clock selection.

Enumerator
PTP_STCA_CLOCK_SEL_PCLKA_DIV_1 

PCLKA.

PTP_STCA_CLOCK_SEL_PCLKA_DIV_2 

PCLKA Divided by 2.

PTP_STCA_CLOCK_SEL_PCLKA_DIV_3 

PCLKA Divided by 3.

PTP_STCA_CLOCK_SEL_PCLKA_DIV_4 

PCLKA Divided by 4.

PTP_STCA_CLOCK_SEL_PCLKA_DIV_5 

PCLKA Divided by 5.

PTP_STCA_CLOCK_SEL_PCLKA_DIV_6 

PCLKA Divided by 6.

PTP_STCA_CLOCK_SEL_REF50CK0 

50-MHz Reference Signal for timing in RMII mode (STCA clock frequency is 25 Mhz when REF50CK0 is used).

◆ ptp_message_interval_t

Message interval for transmitting PTP messages.

Enumerator
PTP_MESSAGE_INTERVAL_1_128 

1 / 128 seconds

PTP_MESSAGE_INTERVAL_1_64 

1 / 64 seconds

PTP_MESSAGE_INTERVAL_1_32 

1 / 32 seconds

PTP_MESSAGE_INTERVAL_1_16 

1 / 16 seconds

PTP_MESSAGE_INTERVAL_1_8 

1 / 8 seconds

PTP_MESSAGE_INTERVAL_1_4 

1 / 4 seconds

PTP_MESSAGE_INTERVAL_1_2 

1 / 2 seconds

PTP_MESSAGE_INTERVAL_1 

1 seconds

PTP_MESSAGE_INTERVAL_2 

2 seconds

PTP_MESSAGE_INTERVAL_4 

4 seconds

PTP_MESSAGE_INTERVAL_8 

8 seconds

PTP_MESSAGE_INTERVAL_16 

16 seconds

PTP_MESSAGE_INTERVAL_32 

32 seconds

PTP_MESSAGE_INTERVAL_64 

64 seconds

◆ ptp_clock_correction_mode_t

Clock correction mode.

Enumerator
PTP_CLOCK_CORRECTION_MODE1 

Correct the local clock using the current offsetFromMaster value.

PTP_CLOCK_CORRECTION_MODE2 

Correct the local clock using the calculated clock gradient.

◆ ptp_event_t

PTP events provided by ptp_cfg_t::p_callback.

Enumerator
PTP_EVENT_SYNC_ACQUIRED 

The local clock is synchronized to the master clock.

PTP_EVENT_SYNC_LOST 

The local clock is not synchronized to the master clcok.

PTP_EVENT_SYNC_MESSAGE_TIMEOUT 

A sync message has not been received for the configured time.

PTP_EVENT_WORST10_ACQUIRED 

Gradient worst10 values has been calcualted.

PTP_EVENT_OFFSET_FROM_MASTER_UPDATED 

The offset from the master clock has been updated.

PTP_EVENT_LOG_MESSAGE_INT_CHANGED 

The message interval was changed.

PTP_EVENT_MEAN_PATH_DELAY_UPDATED 

The mean path delay has been updated.

PTP_EVENT_DELAY_RESP_TIMEOUT 

A delay_resp has not been received for the configured time.

PTP_EVENT_LOG_MESSAGE_INT_OUT_OF_RANGE 

The updated message interval is out of range.

PTP_EVENT_DELAY_REQ_FIFO_OVERFLOW 

The FIFO buffer for storing information from received Delay_Req messages holds 32 or more entries.

PTP_EVENT_LOOP_RECEPTION_DETECTED 

A packet with the same sourcePortIdendity as the local clock was received.

PTP_EVENT_CTRL_INFO_ABNORMALITY 

A malformed frame was received (EDMAC, ETHERC, and EPTPC must be reset).

PTP_EVENT_DELAY_RESP_PROCESSING_HALTED 

Processing of delay_resp messages has been halted.

PTP_EVENT_MESSAGE_GENERATION_HALTED 

Generation of messages has been halted.

PTP_EVENT_MESSAGE_RECEIVED 

A PTP message was received from the EDMAC.

PTP_EVENT_MESSAGE_TRANSMIT_COMPLETE 

A PTP message has been transmitted.

PTP_EVENT_PULSE_TIMER_MINT_RISING_EDGE 

A rising edge occurred on a pulse timer channel.

PTP_EVENT_PULSE_TIMER_IPLS_COMMON 

A rising or falling edge occurred on any pulse timer channel.

◆ ptp_ethernet_phy_interface_t

The Ethernet PHY interface type.

Enumerator
PTP_ETHERNET_PHY_INTERFACE_MII 

Media-independant interface.

PTP_ETHERNET_PHY_INTERFACE_RMII 

Reduced media-independant interface.

Variable Documentation

◆ e_ptp_ctrl_field

enum PTP_PACKED e_ptp_ctrl_field

The control field for PTP message header.