RZ Flexible Software Package Documentation  Release v4.2.0

 
GPTP Interface

Detailed Description

Interface for gPTP timing.

Summary

The gPTP API provides a generic interface for gPTP timer operation.

Classes

struct  st_gptp_timer_value
 
struct  st_gptp_timer_cfg
 
struct  st_gptp_callback_args
 
struct  st_gptp_cfg
 
struct  st_gptp_api
 
struct  st_gptp_instance
 

Typedefs

typedef struct st_gptp_timer_value gptp_timer_value_t
 
typedef struct st_gptp_timer_cfg gptp_timer_cfg_t
 
typedef void gptp_ctrl_t
 
typedef struct st_gptp_callback_args gptp_callback_args_t
 
typedef struct st_gptp_cfg gptp_cfg_t
 
typedef struct st_gptp_api gptp_api_t
 
typedef struct st_gptp_instance gptp_instance_t
 

Class Documentation

◆ RZT::st_gptp_timer_value

struct RZT::st_gptp_timer_value

Timer value.

Class Members
uint16_t time_sec_upper Second(Upper 16 bit).
uint32_t time_sec_lower Second(Lower 32 bit).
uint32_t time_nsec Nanosecond.

◆ RZT::st_gptp_timer_cfg

struct RZT::st_gptp_timer_cfg

Configuration of gPTP timer.

Class Members
uint8_t clock_period Timer increment value.

◆ RZT::st_gptp_callback_args

struct RZT::st_gptp_callback_args

GPTP callback arguments definitions.

Class Members
void * p_context Placeholder for user data. Set in gptp_api_t::open function in gptp_cfg_t.

◆ RZT::st_gptp_cfg

struct RZT::st_gptp_cfg

Configuration parameters.

Public Attributes

void(* p_callback )(gptp_callback_args_t *p_args)
 Pointer to callback function.
 
void * p_context
 Placeholder for user data. Passed to the user callback in gptp_callback_args_t.
 
void const * p_extend
 Placeholder for user extension.
 

◆ RZT::st_gptp_api

struct RZT::st_gptp_api

Functions implemented at the HAL layer will follow this API.

Public Attributes

fsp_err_t(* open )(gptp_ctrl_t *const p_ctrl, gptp_cfg_t const *const p_cfg)
 
fsp_err_t(* close )(gptp_ctrl_t *const p_ctrl)
 
fsp_err_t(* timerCfg )(gptp_ctrl_t *const p_ctrl, uint8_t timer, gptp_timer_cfg_t const *const p_timer_cfg)
 
fsp_err_t(* start )(gptp_ctrl_t *const p_ctrl, uint8_t timer)
 
fsp_err_t(* stop )(gptp_ctrl_t *const p_ctrl, uint8_t timer)
 
fsp_err_t(* timerValueGet )(gptp_ctrl_t *const p_ctrl, uint8_t timer, gptp_timer_value_t *const p_timer_value)
 
fsp_err_t(* timerOffsetSet )(gptp_ctrl_t *const p_ctrl, uint8_t timer, int64_t offset)
 
fsp_err_t(* timerRateSet )(gptp_ctrl_t *const p_ctrl, uint8_t timer, uint32_t rate)
 
fsp_err_t(* callbackSet )(gptp_ctrl_t *const p_ctrl, void(*p_callback)(gptp_callback_args_t *), void *const p_context, gptp_callback_args_t *const p_callback_memory)
 

Member Data Documentation

◆ open

fsp_err_t(* open) (gptp_ctrl_t *const p_ctrl, gptp_cfg_t const *const p_cfg)

Open driver.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_cfgPointer to pin configuration structure.

◆ close

fsp_err_t(* close) (gptp_ctrl_t *const p_ctrl)

Close driver.

Parameters
[in]p_ctrlPointer to control structure.

◆ timerCfg

fsp_err_t(* timerCfg) (gptp_ctrl_t *const p_ctrl, uint8_t timer, gptp_timer_cfg_t const *const p_timer_cfg)

Configure gptp timer parameters.

Parameters
[in]p_ctrlPointer to control structure.
[in]timerTimer index.
[in]p_timer_cfgConfiguration of the timer.

◆ start

fsp_err_t(* start) (gptp_ctrl_t *const p_ctrl, uint8_t timer)

Start gptp timer.

Parameters
[in]p_ctrlPointer to control structure.
[in]timerTimer index.

◆ stop

fsp_err_t(* stop) (gptp_ctrl_t *const p_ctrl, uint8_t timer)

Stop gptp timer.

Parameters
[in]p_ctrlPointer to control structure.
[in]timerTimer index.

◆ timerValueGet

fsp_err_t(* timerValueGet) (gptp_ctrl_t *const p_ctrl, uint8_t timer, gptp_timer_value_t *const p_timer_value)

Get the current time value to gptp timer.

Parameters
[in]p_ctrlPointer to control structure.
[in]timerTimer index.
[out]p_timer_valuePointer to timer value structure.

◆ timerOffsetSet

fsp_err_t(* timerOffsetSet) (gptp_ctrl_t *const p_ctrl, uint8_t timer, int64_t offset)

Set time offset correction to gptp timer.

Parameters
[in]p_ctrlPointer to control structure.
[in]timerTimer index.
[in]offsetTime offset value.

◆ timerRateSet

fsp_err_t(* timerRateSet) (gptp_ctrl_t *const p_ctrl, uint8_t timer, uint32_t rate)

Set clock rate correction to gptp timer.

Parameters
[in]p_ctrlPointer to control structure.
[in]timerTimer index.
[in]rateClock rate value.

◆ callbackSet

fsp_err_t(* callbackSet) (gptp_ctrl_t *const p_ctrl, void(*p_callback)(gptp_callback_args_t *), void *const p_context, gptp_callback_args_t *const p_callback_memory)

Specify callback function and optional context pointer and working memory pointer.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_callbackCallback function.
[in]p_contextPointer to send to callback function.
[in]p_callback_memoryPointer to volatile memory where callback structure can be allocated. Callback arguments allocated here are only valid during the callback.

◆ RZT::st_gptp_instance

struct RZT::st_gptp_instance

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

Class Members
gptp_ctrl_t * p_ctrl Pointer to the control structure for this instance.
gptp_cfg_t const * p_cfg Pointer to the configuration structure for this instance.
gptp_api_t const * p_api Pointer to the API structure for this instance.

Typedef Documentation

◆ gptp_timer_value_t

Timer value. Please refer to the struct st_gptp_timer_value.

◆ gptp_timer_cfg_t

Configuration of gPTP timer. Please refer to the struct st_gptp_timer_cfg.

◆ gptp_ctrl_t

typedef void gptp_ctrl_t

Control block. Allocate an instance specific control block to pass into the API calls.

◆ gptp_callback_args_t

GPTP callback arguments definitions. Please refer to the struct st_gptp_callback_args.

◆ gptp_cfg_t

typedef struct st_gptp_cfg gptp_cfg_t

Configuration parameters. Please refer to the struct st_gptp_cfg.

◆ gptp_api_t

typedef struct st_gptp_api gptp_api_t

Functions implemented at the HAL layer will follow this API. Please refer to the struct st_gptp_api.

◆ gptp_instance_t

This structure encompasses everything that is needed to use an instance of this interface. Please refer to the struct st_gptp_instance.