Altera HWLIB  16.0
The Altera HW Manager API Reference Manual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups
Mode Control

Description

This functional group handles setting and reading the operational mode of the general purpose timers. The module version ID read function is also located here.

Functions

ALT_STATUS_CODE alt_gpt_mode_set (ALT_GPT_TIMER_t tmr_id, ALT_GPT_RESTART_MODE_t mode)
 
int32_t alt_gpt_mode_get (ALT_GPT_TIMER_t tmr_id)
 

Function Documentation

ALT_STATUS_CODE alt_gpt_mode_set ( ALT_GPT_TIMER_t  tmr_id,
ALT_GPT_RESTART_MODE_t  mode 
)

Sets the mode of the specified timer, the behavior that occurs when either the general-purpose timer counts down to zero or when the the global timer reaches its comparator value.

Parameters
tmr_idThe timer identifier.
modeGPT_RESTART_MODE_ONESHOT - To select one-shot mode for the timer.
GPT_RESTART_MODE_PERIODIC - To select free-run mode for the timer.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGInvalid input argument.
int32_t alt_gpt_mode_get ( ALT_GPT_TIMER_t  tmr_id)

Reads the mode of the specified timer.

Parameters
tmr_idThe timer identifier.
Return values
GPT_RESTART_MODE_ONESHOTTimer is set to one-shot mode.
GPT_RESTART_MODE_PERIODICCounter value is set to a user-defined value.
ALT_E_BAD_ARGInvalid input argument.