![]() |
RA Flexible Software Package Documentation
Release v6.1.0
|
|
Interface for gPTP timing.
The gPTP API provides a generic interface for gPTP timer operation.
Data Structures | |
struct | gptp_timer_value_t |
struct | gptp_timer_cfg_t |
struct | gptp_callback_args_t |
struct | gptp_cfg_t |
struct | gptp_api_t |
struct | gptp_instance_t |
Typedefs | |
typedef void | gptp_ctrl_t |
struct gptp_timer_value_t |
struct gptp_timer_cfg_t |
struct gptp_callback_args_t |
GPTP callback arguments definitions.
Data Fields | ||
---|---|---|
void * | p_context | Placeholder for user data. Set in gptp_api_t::open function in gptp_cfg_t. |
struct gptp_cfg_t |
Configuration parameters.
Data Fields | |
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. | |
struct gptp_api_t |
Functions implemented at the HAL layer will follow this API.
Data Fields | |
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) |
fsp_err_t(* gptp_api_t::open) (gptp_ctrl_t *const p_ctrl, gptp_cfg_t const *const p_cfg) |
Open driver.
[in] | p_ctrl | Pointer to control structure. |
[in] | p_cfg | Pointer to pin configuration structure. |
fsp_err_t(* gptp_api_t::close) (gptp_ctrl_t *const p_ctrl) |
Close driver.
[in] | p_ctrl | Pointer to control structure. |
fsp_err_t(* gptp_api_t::timerCfg) (gptp_ctrl_t *const p_ctrl, uint8_t timer, gptp_timer_cfg_t const *const p_timer_cfg) |
Configure gptp timer parameters.
[in] | p_ctrl | Pointer to control structure. |
[in] | timer | Timer index. |
[in] | p_timer_cfg | Configuration of the timer. |
fsp_err_t(* gptp_api_t::start) (gptp_ctrl_t *const p_ctrl, uint8_t timer) |
Start gptp timer.
[in] | p_ctrl | Pointer to control structure. |
[in] | timer | Timer index. |
fsp_err_t(* gptp_api_t::stop) (gptp_ctrl_t *const p_ctrl, uint8_t timer) |
Stop gptp timer.
[in] | p_ctrl | Pointer to control structure. |
[in] | timer | Timer index. |
fsp_err_t(* gptp_api_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.
[in] | p_ctrl | Pointer to control structure. |
[in] | timer | Timer index. |
[out] | p_timer_value | Pointer to timer value structure. |
fsp_err_t(* gptp_api_t::timerOffsetSet) (gptp_ctrl_t *const p_ctrl, uint8_t timer, int64_t offset) |
Set time offset correction to gptp timer.
[in] | p_ctrl | Pointer to control structure. |
[in] | timer | Timer index. |
[in] | offset | Time offset value. |
fsp_err_t(* gptp_api_t::timerRateSet) (gptp_ctrl_t *const p_ctrl, uint8_t timer, uint32_t rate) |
Set clock rate correction to gptp timer.
[in] | p_ctrl | Pointer to control structure. |
[in] | timer | Timer index. |
[in] | rate | Clock rate value. |
fsp_err_t(* gptp_api_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.
[in] | p_ctrl | Pointer to control structure. |
[in] | p_callback | Callback function. |
[in] | p_context | Pointer to send to callback function. |
[in] | p_callback_memory | Pointer to volatile memory where callback structure can be allocated. Callback arguments allocated here are only valid during the callback. |
struct gptp_instance_t |
This structure encompasses everything that is needed to use an instance of this interface.
Data Fields | ||
---|---|---|
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 void gptp_ctrl_t |
Control block. Allocate an instance specific control block to pass into the API calls.