Synergy Software Package User's Manual

Driver for the Precision time protocol(PTP). More...

Data Structures

struct  ptp_instance_ctrl_t
 

Functions

ssp_err_t R_PTP_Open (ptp_ctrl_t *const p_api_ctrl, ptp_cfg_t const *const p_cfg)
 Open the PTP driver, handles required initialization described in hardware manual. Implements ptp_api_t::open. More...
 
ssp_err_t R_PTP_Close (ptp_ctrl_t *const p_api_ctrl)
 Closes the PTP driver. Implements ptp_api_t::close. More...
 
ssp_err_t R_PTP_Configure (ptp_ctrl_t *const p_api_ctrl, uint32_t *p_ip_address, uint32_t *p_physical_address_msw, uint32_t *p_physical_address_lsw)
 Configures the PTP driver with IP and MAC address. Implements ptp_api_t::configure. More...
 
ssp_err_t R_PTP_SetExtPromiscuous (ptp_ctrl_t *const p_api_ctrl, uint8_t ptp_channel, bool is_set)
 Sets or clear the extended promiscuous mode of the specified PTP channel. Implements ptp_api_t::setExtPromiscuous. More...
 
ssp_err_t R_PTP_GetLocalClock (ptp_ctrl_t *const p_api_ctrl, ptp_timestamp_t *p_clock, uint32_t wait_option)
 Gets the current local clock counter value in Timestamp format(UNIX time) when configured as slave. Implements ptp_api_t::getLocalClock. More...
 
ssp_err_t R_PTP_SetLocalClock (ptp_ctrl_t *const p_api_ctrl, ptp_timestamp_t *p_clock)
 Sets local clock counter value with Timestamp (UNIX time). Master clock set the master time. Implements ptp_api_t::setLocalClock. More...
 
ssp_err_t R_PTP_GetMasterPortID (ptp_ctrl_t *const p_api_ctrl, uint8_t ptp_channel, uint32_t *p_clock, uint16_t *p_port)
 Gets master clock ID and master port number fields of the specified PTP channel. Note: If the argument (p_clock or p_port) is NULL pointer, the value will not be acquired. Implements ptp_api_t::getMasterPortID. More...
 
ssp_err_t R_PTP_SetMasterPortID (ptp_ctrl_t *const p_api_ctrl, uint8_t ptp_channel, uint32_t *p_clock, uint16_t *p_port)
 Sets master clock ID and master port number fields of the specified PTP channel. Note: If the argument (p_clock or p_port) is NULL pointer, the value will not be updated. Implements ptp_api_t::setMasterPortID. More...
 
ssp_err_t R_PTP_GetSyncInfo (ptp_ctrl_t *const p_api_ctrl, uint8_t ptp_channel, ptp_timeInterval_t *p_master_offset, ptp_timeInterval_t *p_path_delay)
 Gets the current offset from master and mean path delay of the specified PTP channel when configured as slave. Note: If the argument (p_master_offset or p_path_delay) is NULL pointer, the value will not be acquired. Implements ptp_api_t::getSyncInfo. More...
 
ssp_err_t R_PTP_Start (ptp_ctrl_t *const p_api_ctrl, uint32_t wait_option)
 Starts time synchronization. Implements ptp_api_t::start. More...
 
ssp_err_t R_PTP_Stop (ptp_ctrl_t *const p_api_ctrl, uint32_t wait_option)
 Stops time synchronization. Implements ptp_api_t::stop. More...
 
ssp_err_t R_PTP_SetWorst10Values (ptp_ctrl_t *const p_api_ctrl, uint8_t interval)
 Sets the interval for collecting worst 10 values. Implements ptp_api_t::setWorst10Values. More...
 
ssp_err_t R_PTP_CheckWorst10Values (ptp_ctrl_t *const p_api_ctrl, uint32_t wait_option)
 Checks if worst 10 values are acquired and set as gradient limits when configured as slave. Implements ptp_api_t::checkWorst10Values. More...
 
ssp_err_t R_PTP_GetWorst10Values (ptp_ctrl_t *const p_api_ctrl, uint32_t *p_positive_worst10, uint32_t *p_negative_worst10, uint32_t wait_option)
 Gets positive and negative worst 10 values by software. Note: If the argument (p_positive_worst10 or p_negative_worst10) is NULL pointer, the value will not be acquired. Implements ptp_api_t::getWorst10Values. More...
 
ssp_err_t R_PTP_SetGradientLimit (ptp_ctrl_t *const p_api_ctrl, uint32_t *p_positive_limit, uint32_t *p_negative_limit)
 Sets the gradient limits for positive and negative worst 10 values. Note: If the argument (p_positive_limit or p_negative_limit) is NULL pointer, the value will not be acquired. Implements ptp_api_t::setGradientLimit. More...
 
ssp_err_t R_PTP_UpdateClockID (ptp_ctrl_t *const p_api_ctrl, uint8_t ptp_channel, int8_t *p_clock_id)
 Updates clock identity field. Implements ptp_api_t::updateClockID. More...
 
ssp_err_t R_PTP_UpdateDomainNumber (ptp_ctrl_t *const p_api_ctrl, uint8_t ptp_channel, uint8_t domain_num)
 Updates domain number field in the message header. Implements ptp_api_t::updateDomainNumber. More...
 
ssp_err_t R_PTP_UpdateAnnounceFlags (ptp_ctrl_t *const p_api_ctrl, uint8_t ptp_channel, ptp_announce_flag_t *p_flag)
 Updates announce message's flag field. Implements ptp_api_t::updateAnnounceFlags. More...
 
ssp_err_t R_PTP_UpdateAnnounceMsgs (ptp_ctrl_t *const p_api_ctrl, uint8_t ptp_channel, ptp_announce_message_t *p_message)
 Updates announce message's message field. Implements ptp_api_t::updateAnnounceMsgs. More...
 
ssp_err_t R_PTP_UpdateSyncAnnounceMsgInterval (ptp_ctrl_t *const p_api_ctrl, uint8_t ptp_channel, int8_t *p_sync_interval, int8_t *p_announce_interval)
 Updates transmission interval and logMessageInterval of Sync and Announce messages. Note: If the argument (p_sync_interval or p_announce_interval) is NULL pointer, the value will not be acquired. Implements ptp_api_t::updateSyncAnnounceMsgInterval. More...
 
ssp_err_t R_PTP_UpdateDelayMsgInterval (ptp_ctrl_t *const p_api_ctrl, uint8_t ptp_channel, int8_t *p_interval, uint32_t *p_timeout)
 Updates transmission interval, logMessageInterval and timeout values of Delay message. Note: If the argument (p_interval or p_timeout) is NULL pointer, the value will not be updated. Implements ptp_api_t::updateDelayMsgInterval. More...
 
ssp_err_t R_PTP_GetMessageReceptionConfig (ptp_ctrl_t *const p_api_ctrl, uint8_t ptp_channel, ptp_message_reception_t *p_ptp_message_reception)
 Gets PTP message reception synchronous configuration. Implements ptp_api_t::getMessageReceptionConfig. More...
 
ssp_err_t R_PTP_SetMessageReceptionConfig (ptp_ctrl_t *const p_api_ctrl, uint8_t ptp_channel, ptp_message_reception_t *p_ptp_message_reception)
 Sets PTP message reception synchronous configuration. Implements ptp_api_t::setMessageReceptionConfig. More...
 
ssp_err_t R_PTP_DisableTimer (ptp_ctrl_t *const p_api_ctrl, ptp_stca_timer_channel_t timer_channel)
 Disables the specified timer event interrupt. Implements ptp_api_t::disableTimer. More...
 
ssp_err_t R_PTP_IndicateEvent (ptp_ctrl_t *const p_api_ctrl, ptp_stca_timer_channel_t timer_channel, ptp_stca_timer_pulse_edge_t timer_pulse_edge, bool is_set)
 Set/clear interrupt indication to ELC output on generation of pulse produced by pulse output timer. Implements ptp_api_t::indicateEvent. More...
 
ssp_err_t R_PTP_AutoClearEvent (ptp_ctrl_t *const p_api_ctrl, ptp_stca_timer_channel_t timer_channel, ptp_stca_timer_pulse_edge_t timer_pulse_edge, bool is_set)
 Set/clear auto clear mode for enabling one time output of ELC event. Implements ptp_api_t::autoClearEvent. More...
 
ssp_err_t R_PTP_SetTimer (ptp_ctrl_t *const p_api_ctrl, uint8_t timer_channel, UInt64_t event_time, uint32_t cycle, uint32_t pulse_width)
 Sets start time, pulse period and pulse width for the pulse output timer. Implements ptp_api_t::setTimer. More...
 
ssp_err_t R_PTP_SetMINTevent (ptp_ctrl_t *const p_api_ctrl, ptp_event_t ptp_reg, uint32_t event, bool is_set)
 Sets MINT interrupt event to enable notification for change in state of modules Implements ptp_api_t::setMINTevent. More...
 
ssp_err_t R_PTP_EnableINFABTnotification (ptp_ctrl_t *const p_api_ctrl, uint8_t ptp_channel)
 Enables EPTPC INFABT notification of the specified PTP channel. Implements ptp_api_t::enableINFABTnotification. More...
 
ssp_err_t R_PTP_DisableINFABTnotification (ptp_ctrl_t *const p_api_ctrl, uint8_t ptp_channel)
 Disables EPTPC INFABT notification of the specified PTP channel. Implements ptp_api_t::disableINFABTnotification. More...
 
ssp_err_t R_PTP_CheckINFABTstatus (ptp_ctrl_t *const p_api_ctrl, uint8_t ptp_channel, uint8_t *p_status)
 Checks the status of INFABT flag of the specified PTP channel. Implements ptp_api_t::checkINFABTstatus. More...
 
ssp_err_t R_PTP_ClearINFABTstatus (ptp_ctrl_t *const p_api_ctrl, uint8_t ptp_channel)
 Clears INFABT interrupt occurrence flag of the specified PTP channel. Implements ptp_api_t::clearINFABTstatus. More...
 
ssp_err_t R_PTP_VersionGet (ssp_version_t *const p_version)
 Gets version information and stores it in the provided version struct. Implements ptp_api_t::versionGet. More...
 

Detailed Description

Driver for the Precision time protocol(PTP).

Summary

This module supports the PTP time synchronization functionality.

Extends PTP driver Interface.

Function Documentation

◆ R_PTP_AutoClearEvent()

ssp_err_t R_PTP_AutoClearEvent ( ptp_ctrl_t *const  p_api_ctrl,
ptp_stca_timer_channel_t  timer_channel,
ptp_stca_timer_pulse_edge_t  timer_pulse_edge,
bool  is_set 
)

Set/clear auto clear mode for enabling one time output of ELC event. Implements ptp_api_t::autoClearEvent.

Return values
SSP_SUCCESSELC interrupt auto clear mode set or clear is successful.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block is NULL.

Get IPLS Interrupt Permission Automatic clearing register status

If set, enable automatic clearing for specified pulse output timer channel

Set IPLS Interrupt Permission Automatic clearing register status

◆ R_PTP_CheckINFABTstatus()

ssp_err_t R_PTP_CheckINFABTstatus ( ptp_ctrl_t *const  p_api_ctrl,
uint8_t  ptp_channel,
uint8_t *  p_status 
)

Checks the status of INFABT flag of the specified PTP channel. Implements ptp_api_t::checkINFABTstatus.

Return values
SSP_SUCCESSINFABT flag status check is successful.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block is NULL.
SSP_ERR_INVALID_CHANNELInvalid EPTPC channel.

Gets the current status of INFABT notification flag of the specified PTP channel

◆ R_PTP_CheckWorst10Values()

ssp_err_t R_PTP_CheckWorst10Values ( ptp_ctrl_t *const  p_api_ctrl,
uint32_t  wait_option 
)

Checks if worst 10 values are acquired and set as gradient limits when configured as slave. Implements ptp_api_t::checkWorst10Values.

Return values
SSP_SUCCESSGradient values are set based on worst 10 values successfully.
SSP_ERR_TIMEOUTGradient values are not set before timeout.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block is NULL.

Wait till worst10 values are acquired by hardware and set as gradient limits

◆ R_PTP_ClearINFABTstatus()

ssp_err_t R_PTP_ClearINFABTstatus ( ptp_ctrl_t *const  p_api_ctrl,
uint8_t  ptp_channel 
)

Clears INFABT interrupt occurrence flag of the specified PTP channel. Implements ptp_api_t::clearINFABTstatus.

Return values
SSP_SUCCESSINFABT status flag clear is successful.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block is NULL.
SSP_ERR_INVALID_CHANNELInvalid EPTPC channel.

Clear the status of INFABT notification flag of the specified PTP channel

◆ R_PTP_Close()

ssp_err_t R_PTP_Close ( ptp_ctrl_t *const  p_api_ctrl)

Closes the PTP driver. Implements ptp_api_t::close.

Return values
SSP_SUCCESSThe PTP driver is successfully closed.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block is NULL.

Disable PTP MINT interrupt

Release hardware lock

Mark driver as closed

◆ R_PTP_Configure()

ssp_err_t R_PTP_Configure ( ptp_ctrl_t *const  p_api_ctrl,
uint32_t *  p_ip_address,
uint32_t *  p_physical_address_msw,
uint32_t *  p_physical_address_lsw 
)

Configures the PTP driver with IP and MAC address. Implements ptp_api_t::configure.

Return values
SSP_SUCCESSThe PTP driver is successfully configured with IP and MAC address.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block or passed argument is NULL.

Initialize Synchronization Frame Processing unit (SYNFP)

Initialize Packet Relation Controller (PRC-TC) and Statistical Time Correction Algorithm (STCA) units

◆ R_PTP_DisableINFABTnotification()

ssp_err_t R_PTP_DisableINFABTnotification ( ptp_ctrl_t *const  p_api_ctrl,
uint8_t  ptp_channel 
)

Disables EPTPC INFABT notification of the specified PTP channel. Implements ptp_api_t::disableINFABTnotification.

Return values
SSP_SUCCESSINFABT notification disable is successful.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block is NULL.
SSP_ERR_INVALID_CHANNELInvalid EPTPC channel.

Disable INFABT detection flag of the specified PTP channel

◆ R_PTP_DisableTimer()

ssp_err_t R_PTP_DisableTimer ( ptp_ctrl_t *const  p_api_ctrl,
ptp_stca_timer_channel_t  timer_channel 
)

Disables the specified timer event interrupt. Implements ptp_api_t::disableTimer.

Return values
SSP_SUCCESSTimer event interrupt disable is successful.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block is NULL.

Get MINT interrupt request status

Disable the timer event of specified pulse output channel

◆ R_PTP_EnableINFABTnotification()

ssp_err_t R_PTP_EnableINFABTnotification ( ptp_ctrl_t *const  p_api_ctrl,
uint8_t  ptp_channel 
)

Enables EPTPC INFABT notification of the specified PTP channel. Implements ptp_api_t::enableINFABTnotification.

Return values
SSP_SUCCESSINFABT notification enable is successful.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block is NULL.
SSP_ERR_INVALID_CHANNELInvalid EPTPC channel.

Initially clear the status of INFABT detection flag of the specified PTP channel

Enable generation of ETHER_MINT interrupt by SYNFP0 status flag

Enable generation of ETHER_MINT interrupt by SYNFP1 status flag

Enable the INFABT detection flag of specified PTP channel

◆ R_PTP_GetLocalClock()

ssp_err_t R_PTP_GetLocalClock ( ptp_ctrl_t *const  p_api_ctrl,
ptp_timestamp_t p_clock,
uint32_t  wait_option 
)

Gets the current local clock counter value in Timestamp format(UNIX time) when configured as slave. Implements ptp_api_t::getLocalClock.

Return values
SSP_SUCCESSLocal clock counter get is successful.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_TIMEOUTClock info is not acquired before timeout.
SSP_ERR_ASSERTIONPointer to the control block or p_clock parameter is NULL.

Request the current local clock counter information

Wait till local clock counter value is loaded with current local time

Save current local clock counter value

◆ R_PTP_GetMasterPortID()

ssp_err_t R_PTP_GetMasterPortID ( ptp_ctrl_t *const  p_api_ctrl,
uint8_t  ptp_channel,
uint32_t *  p_clock,
uint16_t *  p_port 
)

Gets master clock ID and master port number fields of the specified PTP channel. Note: If the argument (p_clock or p_port) is NULL pointer, the value will not be acquired. Implements ptp_api_t::getMasterPortID.

Return values
SSP_SUCCESSMaster port ID get is successful.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block, p_clock or p_port parameter is NULL.
SSP_ERR_INVALID_CHANNELInvalid EPTPC channel.

Get master clock ID high and low fields

Get master port number field

◆ R_PTP_GetMessageReceptionConfig()

ssp_err_t R_PTP_GetMessageReceptionConfig ( ptp_ctrl_t *const  p_api_ctrl,
uint8_t  ptp_channel,
ptp_message_reception_t p_ptp_message_reception 
)

Gets PTP message reception synchronous configuration. Implements ptp_api_t::getMessageReceptionConfig.

Return values
SSP_SUCCESSSynchronous configuration get is successful.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block is NULL.
SSP_ERR_INVALID_CHANNELInvalid EPTPC channel.

Get SYNFP Reception Filter Register 1

Get SYNFP Reception Filter Register 2

Get SYNFP Transmission Enable Register

Get SYNFP Operation Setting Register

◆ R_PTP_GetSyncInfo()

ssp_err_t R_PTP_GetSyncInfo ( ptp_ctrl_t *const  p_api_ctrl,
uint8_t  ptp_channel,
ptp_timeInterval_t *  p_master_offset,
ptp_timeInterval_t *  p_path_delay 
)

Gets the current offset from master and mean path delay of the specified PTP channel when configured as slave. Note: If the argument (p_master_offset or p_path_delay) is NULL pointer, the value will not be acquired. Implements ptp_api_t::getSyncInfo.

Return values
SSP_SUCCESSOffset from master and mean path delay get is successful.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block, p_master_offset or p_path_delay is NULL.
SSP_ERR_INVALID_CHANNELInvalid EPTPC channel.

Request offset from master from the specified PTP channel

Get the offset from master in nano-seconds format

Request mean path delay from the specified PTP channel

Get the mean path delay in nano-seconds format

◆ R_PTP_GetWorst10Values()

ssp_err_t R_PTP_GetWorst10Values ( ptp_ctrl_t *const  p_api_ctrl,
uint32_t *  p_positive_worst10,
uint32_t *  p_negative_worst10,
uint32_t  wait_option 
)

Gets positive and negative worst 10 values by software. Note: If the argument (p_positive_worst10 or p_negative_worst10) is NULL pointer, the value will not be acquired. Implements ptp_api_t::getWorst10Values.

Return values
SSP_SUCCESSPositive and negative worst 10 values get is successful.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block is NULL.

Request current worst10 values acquired

Wait till gradient worst10 values are acquired by software

Get positive gradient values

Get negative gradient values

◆ R_PTP_IndicateEvent()

ssp_err_t R_PTP_IndicateEvent ( ptp_ctrl_t *const  p_api_ctrl,
ptp_stca_timer_channel_t  timer_channel,
ptp_stca_timer_pulse_edge_t  timer_pulse_edge,
bool  is_set 
)

Set/clear interrupt indication to ELC output on generation of pulse produced by pulse output timer. Implements ptp_api_t::indicateEvent.

Return values
SSP_SUCCESSELC interrupt indication set or clear is successful.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block is NULL.

Get IPLS Interrupt Permission Register status

If set, enable output from pulse output timer channel

Set IPLS Interrupt Permission Register status

◆ R_PTP_Open()

ssp_err_t R_PTP_Open ( ptp_ctrl_t *const  p_api_ctrl,
ptp_cfg_t const *const  p_cfg 
)

Open the PTP driver, handles required initialization described in hardware manual. Implements ptp_api_t::open.

Return values
SSP_SUCCESSPTP driver has opened successfully and initialization was successful.
SSP_ERR_IN_USEThe channel specified has already been opened.
SSP_ERR_ASSERTIONThe p_ctrl or p_cfg parameter was NULL.
SSP_ERR_IRQ_BSP_DISABLEDA required interrupt does not exist in the vector table.
Returns
See Common Error Codes or functions called by this function for other possible return codes. This function calls:

Verify if this unit has not already been initialized

Make sure the peripheral exists

Lock EPTPC channel

Power on the PTP module.

Configure MINT interrupt

Reset PTP driver

Wait at least 64 cycles of PCLKA to reset the PTPEDMAC and EPTPC. PCLKA must be at least 12.5 MHz to use Ethernet, so wait at least 5.12 us.

Initialize the channel state information

Select synchronization frame processing unit (SYNFP0 or SYNFP1)

Initialize EPTPC MINT interrupt requests

Initialize SYNFP reception status

Enable MINT interrupt

Disable bypassing of EPTPC module

Mark driver as opened by initializing it to "PTP" in its ASCII equivalent for this unit

◆ R_PTP_SetExtPromiscuous()

ssp_err_t R_PTP_SetExtPromiscuous ( ptp_ctrl_t *const  p_api_ctrl,
uint8_t  ptp_channel,
bool  is_set 
)

Sets or clear the extended promiscuous mode of the specified PTP channel. Implements ptp_api_t::setExtPromiscuous.

Return values
SSP_SUCCESSExtended promiscuous mode is set/cleared successfully.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block is NULL.
SSP_ERR_INVALID_CHANNELInvalid EPTPC channel.

Set or clear extended promiscuous mode of the specified PTP channel

◆ R_PTP_SetGradientLimit()

ssp_err_t R_PTP_SetGradientLimit ( ptp_ctrl_t *const  p_api_ctrl,
uint32_t *  p_positive_limit,
uint32_t *  p_negative_limit 
)

Sets the gradient limits for positive and negative worst 10 values. Note: If the argument (p_positive_limit or p_negative_limit) is NULL pointer, the value will not be acquired. Implements ptp_api_t::setGradientLimit.

Return values
SSP_SUCCESSPositive and negative gradient values set is successful.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block is NULL.

Set positive gradient values

Set negative gradient values

◆ R_PTP_SetLocalClock()

ssp_err_t R_PTP_SetLocalClock ( ptp_ctrl_t *const  p_api_ctrl,
ptp_timestamp_t p_clock 
)

Sets local clock counter value with Timestamp (UNIX time). Master clock set the master time. Implements ptp_api_t::setLocalClock.

Return values
SSP_SUCCESSLocal clock counter set is successful.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block or p_clock parameter is NULL.

Set local clock counter value with the specified time information

◆ R_PTP_SetMasterPortID()

ssp_err_t R_PTP_SetMasterPortID ( ptp_ctrl_t *const  p_api_ctrl,
uint8_t  ptp_channel,
uint32_t *  p_clock,
uint16_t *  p_port 
)

Sets master clock ID and master port number fields of the specified PTP channel. Note: If the argument (p_clock or p_port) is NULL pointer, the value will not be updated. Implements ptp_api_t::setMasterPortID.

Return values
SSP_SUCCESSMaster port ID is updated successfully.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block, p_clock or p_port is NULL.
SSP_ERR_INVALID_CHANNELInvalid EPTPC channel.

Set master clock ID high and low fields

Set master port number field

◆ R_PTP_SetMessageReceptionConfig()

ssp_err_t R_PTP_SetMessageReceptionConfig ( ptp_ctrl_t *const  p_api_ctrl,
uint8_t  ptp_channel,
ptp_message_reception_t p_ptp_message_reception 
)

Sets PTP message reception synchronous configuration. Implements ptp_api_t::setMessageReceptionConfig.

Return values
SSP_SUCCESSSynchronous configuration set is successful.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block is NULL.
SSP_ERR_INVALID_CHANNELInvalid EPTPC channel.

Set SYNFP Reception Filter Register 1

Set SYNFP Reception Filter Register 2

Set SYNFP Transmission Enable Register

Set SYNFP Operation Setting Register

◆ R_PTP_SetMINTevent()

ssp_err_t R_PTP_SetMINTevent ( ptp_ctrl_t *const  p_api_ctrl,
ptp_event_t  ptp_reg,
uint32_t  event,
bool  is_set 
)

Sets MINT interrupt event to enable notification for change in state of modules Implements ptp_api_t::setMINTevent.

Return values
SSP_SUCCESSMINT interrupt event set is successful.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block is NULL.

Enable notification of STCA status

Enable notification of PRC-TC status

Enable notification of SYNFP0 status

Enable notification of SYNFP1 status

◆ R_PTP_SetTimer()

ssp_err_t R_PTP_SetTimer ( ptp_ctrl_t *const  p_api_ctrl,
uint8_t  timer_channel,
UInt64_t  event_time,
uint32_t  cycle,
uint32_t  pulse_width 
)

Sets start time, pulse period and pulse width for the pulse output timer. Implements ptp_api_t::setTimer.

Return values
SSP_SUCCESSTimer event set is successful.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block is NULL.

Set event time, PWM cycle interval and PWM pulse width to specified timer channel

Start the specified pulse output timer

◆ R_PTP_SetWorst10Values()

ssp_err_t R_PTP_SetWorst10Values ( ptp_ctrl_t *const  p_api_ctrl,
uint8_t  interval 
)

Sets the interval for collecting worst 10 values. Implements ptp_api_t::setWorst10Values.

Return values
SSP_SUCCESSWorst 10 values are recorded successfully.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block is NULL.

Sets interval to get worst 10 values

◆ R_PTP_Start()

ssp_err_t R_PTP_Start ( ptp_ctrl_t *const  p_api_ctrl,
uint32_t  wait_option 
)

Starts time synchronization. Implements ptp_api_t::start.

Return values
SSP_SUCCESSTime synchronization started successfully.
SSP_ERR_TIMEOUTTime synchronization did not start before timeout.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block is NULL.
SSP_ERR_INVALID_MODEInvalid PTP mode.

Starts time synchronization

◆ R_PTP_Stop()

ssp_err_t R_PTP_Stop ( ptp_ctrl_t *const  p_api_ctrl,
uint32_t  wait_option 
)

Stops time synchronization. Implements ptp_api_t::stop.

Return values
SSP_SUCCESSTime synchronization stopped successfully.
SSP_ERR_TIMEOUTTime synchronization did not stop before timeout.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block is NULL.
SSP_ERR_INVALID_MODEInvalid PTP mode.

Stops the time synchronization

◆ R_PTP_UpdateAnnounceFlags()

ssp_err_t R_PTP_UpdateAnnounceFlags ( ptp_ctrl_t *const  p_api_ctrl,
uint8_t  ptp_channel,
ptp_announce_flag_t p_flag 
)

Updates announce message's flag field. Implements ptp_api_t::updateAnnounceFlags.

Return values
SSP_SUCCESSAnnounce message flag field set is successful.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block is NULL.
SSP_ERR_INVALID_CHANNELInvalid EPTPC channel.

Update announce message's flag field

◆ R_PTP_UpdateAnnounceMsgs()

ssp_err_t R_PTP_UpdateAnnounceMsgs ( ptp_ctrl_t *const  p_api_ctrl,
uint8_t  ptp_channel,
ptp_announce_message_t p_message 
)

Updates announce message's message field. Implements ptp_api_t::updateAnnounceMsgs.

Return values
SSP_SUCCESSAnnounce message field set is successful.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block is NULL.
SSP_ERR_INVALID_CHANNELInvalid EPTPC channel.

Update grandmasterPriority1 and grandmasterPriority2 fields

Update grandmasterClockQuality fields

Update grandmasterIdentity fields of Announce messages

◆ R_PTP_UpdateClockID()

ssp_err_t R_PTP_UpdateClockID ( ptp_ctrl_t *const  p_api_ctrl,
uint8_t  ptp_channel,
int8_t *  p_clock_id 
)

Updates clock identity field. Implements ptp_api_t::updateClockID.

Return values
SSP_SUCCESSClock identity field set is successful.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block is NULL.
SSP_ERR_INVALID_CHANNELInvalid EPTPC channel.

Update local clockIdentity field of the specified EPTPC port

◆ R_PTP_UpdateDelayMsgInterval()

ssp_err_t R_PTP_UpdateDelayMsgInterval ( ptp_ctrl_t *const  p_api_ctrl,
uint8_t  ptp_channel,
int8_t *  p_interval,
uint32_t *  p_timeout 
)

Updates transmission interval, logMessageInterval and timeout values of Delay message. Note: If the argument (p_interval or p_timeout) is NULL pointer, the value will not be updated. Implements ptp_api_t::updateDelayMsgInterval.

Return values
SSP_SUCCESSTransmission interval, logMessage interval and timeout set is successful.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block is NULL.
SSP_ERR_INVALID_CHANNELInvalid EPTPC channel.

If clock state is master, update Delay_Response logMessageInterval value

If clock state is slave, update Delay_Request /Pdelay_Request transmission interval value

Update Delay_Response/Pdelay_Response receiving timeout value

◆ R_PTP_UpdateDomainNumber()

ssp_err_t R_PTP_UpdateDomainNumber ( ptp_ctrl_t *const  p_api_ctrl,
uint8_t  ptp_channel,
uint8_t  domain_num 
)

Updates domain number field in the message header. Implements ptp_api_t::updateDomainNumber.

Return values
SSP_SUCCESSDomain number field set is successful.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block is NULL.
SSP_ERR_INVALID_CHANNELInvalid EPTPC channel.

Update domainNumber field of the PTP message header

◆ R_PTP_UpdateSyncAnnounceMsgInterval()

ssp_err_t R_PTP_UpdateSyncAnnounceMsgInterval ( ptp_ctrl_t *const  p_api_ctrl,
uint8_t  ptp_channel,
int8_t *  p_sync_interval,
int8_t *  p_announce_interval 
)

Updates transmission interval and logMessageInterval of Sync and Announce messages. Note: If the argument (p_sync_interval or p_announce_interval) is NULL pointer, the value will not be acquired. Implements ptp_api_t::updateSyncAnnounceMsgInterval.

Return values
SSP_SUCCESSTransmission interval and logMessage interval set is successful.
SSP_ERR_NOT_OPENThe PTP driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block is NULL.
SSP_ERR_INVALID_CHANNELInvalid EPTPC channel.

Update SYNFP Sync message transmission interval

Update SYNFP announce message Transmission Interval

◆ R_PTP_VersionGet()

ssp_err_t R_PTP_VersionGet ( ssp_version_t *const  p_version)

Gets version information and stores it in the provided version struct. Implements ptp_api_t::versionGet.

Return values
SSP_SUCCESSVersion returned successfully.
SSP_ERR_ASSERTIONParameter p_version was NULL.

Return the version number