Synergy Software Package User's Manual

#include <r_timer_api.h>

Data Fields

ssp_err_t(* open )(timer_ctrl_t *const p_ctrl, timer_cfg_t const *const p_cfg)
 
ssp_err_t(* stop )(timer_ctrl_t *const p_ctrl)
 
ssp_err_t(* start )(timer_ctrl_t *const p_ctrl)
 
ssp_err_t(* reset )(timer_ctrl_t *const p_ctrl)
 
ssp_err_t(* counterGet )(timer_ctrl_t *const p_ctrl, timer_size_t *const p_value)
 
ssp_err_t(* periodSet )(timer_ctrl_t *const p_ctrl, timer_size_t const period, timer_unit_t const unit)
 
ssp_err_t(* dutyCycleSet )(timer_ctrl_t *const p_ctrl, timer_size_t const duty_cycle, timer_pwm_unit_t const duty_cycle_unit, uint8_t const pin)
 
ssp_err_t(* infoGet )(timer_ctrl_t *const p_ctrl, timer_info_t *const p_info)
 
ssp_err_t(* close )(timer_ctrl_t *const p_ctrl)
 
ssp_err_t(* versionGet )(ssp_version_t *const p_version)
 

Detailed Description

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

Field Documentation

◆ close

ssp_err_t(* timer_api_t::close) (timer_ctrl_t *const p_ctrl)

Allows driver to be reconfigured and may reduce power consumption.

Implemented as
Parameters
[in]p_ctrlControl block set in timer_api_t::open call for this timer.

◆ counterGet

ssp_err_t(* timer_api_t::counterGet) (timer_ctrl_t *const p_ctrl, timer_size_t *const p_value)

Get current counter value and store it in provided pointer p_value.

Implemented as
Parameters
[in]p_ctrlControl block set in timer_api_t::open call for this timer.
[out]p_valuePointer to store current counter value.

◆ dutyCycleSet

ssp_err_t(* timer_api_t::dutyCycleSet) (timer_ctrl_t *const p_ctrl, timer_size_t const duty_cycle, timer_pwm_unit_t const duty_cycle_unit, uint8_t const pin)

Sets the time until the duty cycle expires.

Parameters
[in]p_ctrlControl block set in timer_api_t::open call for this timer.
[in]duty_cycleTime until duty cycle should expire.
[in]duty_cycle_unitUnits of duty_cycle parameter.
[in]pinWhich output pin to update. Enter the pin number or if pins are identified by letters, enter 0 for A, 1 for B, 2 for C, etc.

◆ infoGet

ssp_err_t(* timer_api_t::infoGet) (timer_ctrl_t *const p_ctrl, timer_info_t *const p_info)

Get the time until the timer expires in clock counts and store it in provided pointer p_period_counts.

Implemented as
Parameters
[in]p_ctrlControl block set in timer_api_t::open call for this timer.
[out]p_infoCollection of information for this timer.

◆ open

ssp_err_t(* timer_api_t::open) (timer_ctrl_t *const p_ctrl, timer_cfg_t const *const p_cfg)

Initial configuration.

Implemented as
Note
To reconfigure after calling this function, call timer_api_t::close first.
Parameters
[in]p_ctrlPointer to control block. Must be declared by user. Elements set here.
[in]p_cfgPointer to configuration structure. All elements of this structure must be set by user.

◆ periodSet

ssp_err_t(* timer_api_t::periodSet) (timer_ctrl_t *const p_ctrl, timer_size_t const period, timer_unit_t const unit)

Set the time until the timer expires.

Implemented as
Note
Timer expiration may or may not generate a CPU interrupt based on how the timer is configured in timer_api_t::open.
Parameters
[in]p_ctrlControl block set in timer_api_t::open call for this timer.
[in]periodTime until timer should expire.
[in]unitUnits of period parameter.

◆ reset

ssp_err_t(* timer_api_t::reset) (timer_ctrl_t *const p_ctrl)

Reset the counter to the initial value.

Implemented as
Parameters
[in]p_ctrlControl block set in timer_api_t::open call for this timer.

◆ start

ssp_err_t(* timer_api_t::start) (timer_ctrl_t *const p_ctrl)

Start the counter.

Implemented as
Note
The counter can also be started in the timer_api_t::open function if timer_cfg_t::autostart is true.
Parameters
[in]p_ctrlControl block set in timer_api_t::open call for this timer.

◆ stop

ssp_err_t(* timer_api_t::stop) (timer_ctrl_t *const p_ctrl)

Stop the counter.

Implemented as
Parameters
[in]p_ctrlControl block set in timer_api_t::open call for this timer.

◆ versionGet

ssp_err_t(* timer_api_t::versionGet) (ssp_version_t *const p_version)

Get version and store it in provided pointer p_version.

Implemented as
Parameters
[out]p_versionCode and API version used.

The documentation for this struct was generated from the following file: