Synergy Software Package User's Manual

Interface for timer functions. More...

Data Structures

struct  timer_callback_args_t
 
struct  timer_info_t
 
struct  timer_cfg_t
 
struct  timer_api_t
 
struct  timer_instance_t
 

Typedefs

typedef uint32_t timer_size_t
 
typedef void timer_ctrl_t
 
typedef timer_size_t timer_period_t
 

Enumerations

enum  timer_event_t { TIMER_EVENT_EXPIRED }
 
enum  timer_variant_t { TIMER_VARIANT_32_BIT, TIMER_VARIANT_16_BIT }
 
enum  timer_status_t { TIMER_STATUS_COUNTING, TIMER_STATUS_STOPPED }
 
enum  timer_mode_t { TIMER_MODE_PERIODIC, TIMER_MODE_ONE_SHOT, TIMER_MODE_PWM }
 
enum  timer_unit_t {
  TIMER_UNIT_PERIOD_RAW_COUNTS, TIMER_UNIT_PERIOD_NSEC, TIMER_UNIT_PERIOD_USEC, TIMER_UNIT_PERIOD_MSEC,
  TIMER_UNIT_PERIOD_SEC, TIMER_UNIT_FREQUENCY_HZ, TIMER_UNIT_FREQUENCY_KHZ
}
 
enum  timer_pwm_unit_t { TIMER_PWM_UNIT_RAW_COUNTS, TIMER_PWM_UNIT_PERCENT, TIMER_PWM_UNIT_PERCENT_X_1000 }
 
enum  timer_direction_t { TIMER_DIRECTION_DOWN = 0, TIMER_DIRECTION_UP = 1 }
 

Detailed Description

Interface for timer functions.

Summary

The general timer interface provides standard timer functionality including periodic mode, one-shot mode, and free-running timer mode. After each timer cycle (overflow or underflow), an interrupt can be triggered.

If an instance supports output compare mode, it is provided in the extension configuration timer_on_<instance>_cfg_t defined in r_<instance>.h.

Implemented by:

See also: Input Capture Interface

Related SSP architecture topics:

Timer Interface description: Timer Driver on r_agt and Timer Driver on r_gpt

Typedef Documentation

◆ timer_ctrl_t

typedef void timer_ctrl_t

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

Implemented as

◆ timer_period_t

DEPRECATED: Recommend using timer_size_t for period.

◆ timer_size_t

typedef uint32_t timer_size_t

Largest supported timer size. Currently up to 32-bit timers are supported. If a 16-bit timer is used, only the bottom 16 bits of any timer_size_t parameter can be used. Passing in values larger than 16 bits would result in an error.

Enumeration Type Documentation

◆ timer_direction_t

Direction of timer count

Enumerator
TIMER_DIRECTION_DOWN 

Timer count goes up.

TIMER_DIRECTION_UP 

Timer count goes down.

◆ timer_event_t

Events that can trigger a callback function

Enumerator
TIMER_EVENT_EXPIRED 

Requested timer delay has expired or timer has wrapped around.

◆ timer_mode_t

Timer operational modes

Enumerator
TIMER_MODE_PERIODIC 

Timer will restart after delay periods.

TIMER_MODE_ONE_SHOT 

Timer will stop after delay periods.

TIMER_MODE_PWM 

Timer generate PWM output.

◆ timer_pwm_unit_t

Units of timer duty cycle value.

Enumerator
TIMER_PWM_UNIT_RAW_COUNTS 

Period in clock counts.

TIMER_PWM_UNIT_PERCENT 

Percent unit used for duty cycle.

TIMER_PWM_UNIT_PERCENT_X_1000 

Percent multiplied by 1000 for extra resolution.

◆ timer_status_t

Possible status values returned by timer_api_t::infoGet.

Enumerator
TIMER_STATUS_COUNTING 

Timer is running.

TIMER_STATUS_STOPPED 

Timer is stopped.

◆ timer_unit_t

Units of timer period value.

Enumerator
TIMER_UNIT_PERIOD_RAW_COUNTS 

Period in clock counts.

TIMER_UNIT_PERIOD_NSEC 

Period in nanoseconds.

TIMER_UNIT_PERIOD_USEC 

Period in microseconds.

TIMER_UNIT_PERIOD_MSEC 

Period in milliseconds.

TIMER_UNIT_PERIOD_SEC 

Period in seconds.

TIMER_UNIT_FREQUENCY_HZ 

Frequency in Hz.

TIMER_UNIT_FREQUENCY_KHZ 

Frequency in kHz.

◆ timer_variant_t

Timer variant types.

Enumerator
TIMER_VARIANT_32_BIT 

32-bit timer

TIMER_VARIANT_16_BIT 

16-bit timer