Synergy Software Package User's Manual

DMA controller for PTP driver. More...

Data Structures

struct  ptpedmac_instance_ctrl_t
 

Functions

ssp_err_t R_PTPEDMAC_Open (ptpedmac_ctrl_t *const p_api_ctrl, ptpedmac_cfg_t const *const p_cfg)
 Open the PTP host interface (PTPEDMAC), handles required initialization described in hardware manual. Implements ptpedmac_api_t::open. More...
 
ssp_err_t R_PTPEDMAC_LinkProcess (ptpedmac_ctrl_t *const p_api_ctrl)
 Sets PTP host interface to transfer PTP messages. Implements ptpedmac_api_t::linkProcess. More...
 
ssp_err_t R_PTPEDMAC_CheckLink (ptpedmac_ctrl_t *const p_api_ctrl)
 Checks PTP host interface communication link. Implements ptpedmac_api_t::checkLink. More...
 
ssp_err_t R_PTPEDMAC_Read (ptpedmac_ctrl_t *const p_api_ctrl, uint32_t *p_channel, void *p_buffer, int32_t *p_num_received)
 Receive PTP message. Implements ptpedmac_api_t::read. More...
 
ssp_err_t R_PTPEDMAC_Close (ptpedmac_ctrl_t *const p_api_ctrl)
 Disable PTP host interface. Implements ptpedmac_api_t::close. More...
 
ssp_err_t R_PTPEDMAC_VersionGet (ssp_version_t *const p_version)
 This function returns the API version. Implements ptpedmac_api_t::versionGet. More...
 

Detailed Description

DMA controller for PTP driver.

Summary

This module implements the following interface: PTPEDMAC driver Interface.

Function Documentation

◆ R_PTPEDMAC_CheckLink()

ssp_err_t R_PTPEDMAC_CheckLink ( ptpedmac_ctrl_t *const  p_api_ctrl)

Checks PTP host interface communication link. Implements ptpedmac_api_t::checkLink.

Return values
SSP_SUCCESSPTP host interface link status is verified successfully
SSP_ERR_ASSERTIONPointer to the control block is NULL.
SSP_ERR_NOT_OPENPTPEDMAC driver is not opened.
SSP_ERR_NOT_ENABLEDPTP host interface is not enabled

Check the current status of PTP message transfer

◆ R_PTPEDMAC_Close()

ssp_err_t R_PTPEDMAC_Close ( ptpedmac_ctrl_t *const  p_api_ctrl)

Disable PTP host interface. Implements ptpedmac_api_t::close.

Return values
SSP_SUCCESSPTP host interface is closed successfully
SSP_ERR_NOT_OPENPTPEDMAC driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block is NULL.

Clear PTPEDMAC interrupt

Set PTP Host interface transfer flag to disable

The device is now considered closed

◆ R_PTPEDMAC_LinkProcess()

ssp_err_t R_PTPEDMAC_LinkProcess ( ptpedmac_ctrl_t *const  p_api_ctrl)

Sets PTP host interface to transfer PTP messages. Implements ptpedmac_api_t::linkProcess.

Return values
SSP_SUCCESSPTP host interface has linked successfully to transfer PTP messages
SSP_ERR_ASSERTIONPointer to the control block is NULL.
SSP_ERR_NOT_OPENPTPEDMAC driver is not opened.

Initialize the receive descriptor

Initialize and configure PTPEDMAC

Set PTP Host interface transfer flag to enable

◆ R_PTPEDMAC_Open()

ssp_err_t R_PTPEDMAC_Open ( ptpedmac_ctrl_t *const  p_api_ctrl,
ptpedmac_cfg_t const *const  p_cfg 
)

Open the PTP host interface (PTPEDMAC), handles required initialization described in hardware manual. Implements ptpedmac_api_t::open.

Return values
SSP_SUCCESSPTP host interface has opened successfully and initialization was successful.
SSP_ERR_ASSERTIONPointer to the control block is 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:

Reset PTPEDMAC

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.

Make sure the peripheral exists.

Initialize the channel state information.

If interrupt is registered in the vector table, disable interrupts, set priority, and store control block in the vector information so it can be accessed from the callback.

Enable PINT interrupt

Initialize frame transfer status flag

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

◆ R_PTPEDMAC_Read()

ssp_err_t R_PTPEDMAC_Read ( ptpedmac_ctrl_t *const  p_api_ctrl,
uint32_t *  p_channel,
void *  p_buffer,
int32_t *  p_num_received 
)

Receive PTP message. Implements ptpedmac_api_t::read.

Return values
SSP_SUCCESSPTP message received successfully
SSP_ERR_TIMEOUTNo data received
SSP_ERR_NOT_OPENPTPEDMAC driver is not opened.
SSP_ERR_ASSERTIONPointer to the control block is NULL.
SSP_ERR_NOT_ENABLEDPTP host interface is not enabled

Set the allocated buffer pointer for received data

◆ R_PTPEDMAC_VersionGet()

ssp_err_t R_PTPEDMAC_VersionGet ( ssp_version_t *const  p_version)

This function returns the API version. Implements ptpedmac_api_t::versionGet.

Parameters
[in]p_versionPointer to the API version block
Return values
SSP_SUCCESSSuccessful close.
SSP_ERR_ASSERTIONThe parameter p_version is NULL.

Return the version number