![]() |
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) |
Timer API structure. General timer functions implemented at the HAL layer follow this API.
| ssp_err_t(* timer_api_t::close) (timer_ctrl_t *const p_ctrl) |
Allows driver to be reconfigured and may reduce power consumption.
| [in] | p_ctrl | Control block set in timer_api_t::open call for this timer. |
| 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.
| [in] | p_ctrl | Control block set in timer_api_t::open call for this timer. |
| [out] | p_value | Pointer to store current counter value. |
| 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.
| [in] | p_ctrl | Control block set in timer_api_t::open call for this timer. |
| [in] | duty_cycle | Time until duty cycle should expire. |
| [in] | duty_cycle_unit | Units of duty_cycle parameter. |
| [in] | pin | Which 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. |
| 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.
| [in] | p_ctrl | Control block set in timer_api_t::open call for this timer. |
| [out] | p_info | Collection of information for this timer. |
| ssp_err_t(* timer_api_t::open) (timer_ctrl_t *const p_ctrl, timer_cfg_t const *const p_cfg) |
Initial configuration.
| [in] | p_ctrl | Pointer to control block. Must be declared by user. Elements set here. |
| [in] | p_cfg | Pointer to configuration structure. All elements of this structure must be set by user. |
| 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.
| [in] | p_ctrl | Control block set in timer_api_t::open call for this timer. |
| [in] | period | Time until timer should expire. |
| [in] | unit | Units of period parameter. |
| ssp_err_t(* timer_api_t::reset) (timer_ctrl_t *const p_ctrl) |
Reset the counter to the initial value.
| [in] | p_ctrl | Control block set in timer_api_t::open call for this timer. |
| ssp_err_t(* timer_api_t::start) (timer_ctrl_t *const p_ctrl) |
Start the counter.
| [in] | p_ctrl | Control block set in timer_api_t::open call for this timer. |
| ssp_err_t(* timer_api_t::stop) (timer_ctrl_t *const p_ctrl) |
Stop the counter.
| [in] | p_ctrl | Control block set in timer_api_t::open call for this timer. |
| ssp_err_t(* timer_api_t::versionGet) (ssp_version_t *const p_version) |
Get version and store it in provided pointer p_version.
| [out] | p_version | Code and API version used. |