Timer Structures - PalouseRobosub/SUBLIBinal GitHub Wiki
Timer Structures
This page contains information about the structures used when working with microcontroller timers. Please use the list to navigate to the structure you would like to read about
Structures:
Timer_Config
Definition:
typedef struct TIMER_CONFIG {
Timer_Type which_timer;
float frequency;
uint pbclk;
void (*callback);
boolean enabled;
}Timer_Config;
The Timer_Config
structure is made up of 5 different parameters and is used for defining the characteristics of a timer.
Parameters:
- Timer_Type which_timer: The
which_timer
parameter describes which timer the structure is to be associated with. - float frequency: The
frequency
parameter should specify the desired frequency that a timer should interrupt at - uint pbclk: the
pbclk
parameter contains the frequency of the peripheral bus clock. This is used to accurately determine timer frequency - void *callback: The
callback
parameter is the function callback for the timer interrupt service routine. For more information, please refer to the Callback Information - boolean enabled: This parameter specifies whether the timer should be enabled upon initialization. This can be either
TRUE
orFALSE