#include <stdint.h>
Data Structures | |
struct | tc_control_reg |
TC Configuration structure. More... | |
Typedefs | |
typedef enum tc_cc_channel_t | TC_CC_CHANNEL_t |
typedef enum TC_CLKSEL_enum | TC_CLKSEL_t |
typedef enum tc_co_mode_enum | TC_CO_MODE_t |
typedef enum TC_MODE_enum | TC_WG_MODE_t |
Enumerations | |
enum | tc_co_mode_enum { CO_NORMAL = 0X00, CO_TOGGLE = 0X01, CO_CLEAR = 0X02, CO_SET = 0X03 } |
Timer Modes of operation. More... | |
Functions | |
static void | tc_clear_cc (volatile void *tc, enum tc_cc_channel_t channel_index, uint16_t value) |
Write Compare register with timer Value. More... | |
static void | tc_clear_ic (volatile void *tc, enum tc_cc_channel_t channel_index, uint16_t value) |
Write Compare register with timer Value. More... | |
void | tc_disable_compare_int (volatile void *p_tc, enum tc_cc_channel_t channel_index) |
Disable Compare Interrupt in channel C. More... | |
void | tc_disable_overflow_int (volatile void *p_tc, enum tc_cc_channel_t channel_index) |
Disable Overflow Interrupt. More... | |
void | tc_initc (volatile void *p_tc, TC_CC_CHANNEL_t channel_index, struct tc_control_reg *p_control_reg) |
Configure TC for timer, waveform generation or capture. More... | |
static void | tc_set_clk_source (volatile void *tc, TC_CC_CHANNEL_t channel_index, TC_CLKSEL_t mode) |
Sets a timer in a particular mode of operation. More... | |
static void | tc_set_co_mode (volatile void *tc, TC_CC_CHANNEL_t channel_index, TC_CO_MODE_t mode) |
Sets a timer in a particular mode of operation. More... | |
static void | tc_set_wg_mode (volatile void *tc, TC_CC_CHANNEL_t channel_index, TC_WG_MODE_t mode) |
Sets a timer in a particular mode of operation. More... | |
void | tc_start (volatile void *p_tc, struct tc_control_reg *p_control_reg) |
to start the running timer More... | |
void | tc_stop (volatile void *p_tc) |
to stop the running timer More... | |
static void | tc_write_ic (volatile void *tc, enum tc_cc_channel_t channel_index, uint16_t value) |
Write Compare register with timer Value. More... | |
typedef enum tc_cc_channel_t TC_CC_CHANNEL_t |
typedef enum TC_CLKSEL_enum TC_CLKSEL_t |
typedef enum tc_co_mode_enum TC_CO_MODE_t |
typedef enum TC_MODE_enum TC_WG_MODE_t |
enum tc_co_mode_enum |
|
inlinestatic |
Write Compare register with timer Value.
tc | Timer Address |
channel_index | Compare Channel to be used |
value | Compare value to be written |
Referenced by PWM_start_toggle().
|
inlinestatic |
Write Compare register with timer Value.
tc | Timer Address |
channel_index | Compare Channel to be used |
value | Compare value to be written |
Referenced by PWM_start_toggle().
void tc_disable_compare_int | ( | volatile void * | p_tc, |
enum tc_cc_channel_t | channel_index | ||
) |
Disable Compare Interrupt in channel C.
tc | Timer Address |
References clear_compa_flag(), clear_compb_flag(), clear_compc_flag(), TC_COMPA, TC_COMPB, TC_COMPC, tc_disable_compa_int(), tc_disable_compb_int(), and tc_disable_compc_int().
Referenced by tc_initc(), and tc_stop().
void tc_disable_overflow_int | ( | volatile void * | p_tc, |
enum tc_cc_channel_t | channel_index | ||
) |
Disable Overflow Interrupt.
tc | Timer Address |
References clear_ovf_flag(), TC_COMPA, TC_COMPB, TC_COMPC, and tc_disable_ovf_int().
Referenced by tc_initc().
void tc_initc | ( | volatile void * | p_tc, |
TC_CC_CHANNEL_t | channel_index, | ||
struct tc_control_reg * | p_control_reg | ||
) |
Configure TC for timer, waveform generation or capture.
p_tc | Pointer to a TC instance. |
ul_channel | Channel to configure. |
ul_mode | Control mode register value to set. |
References tc_control_reg::co_mode, tc_disable_compare_int(), tc_disable_overflow_int(), tc_set_co_mode(), tc_set_wg_mode(), and tc_control_reg::wg_mode.
Referenced by initialize_EPD_timer(), and PWM_start_toggle().
|
inlinestatic |
Sets a timer in a particular mode of operation.
tc | Timer Address |
mode | Enum value of the selected mode |
References TCCRB_OFFSET.
Referenced by tc_start(), and tc_stop().
|
inlinestatic |
|
inlinestatic |
Sets a timer in a particular mode of operation.
tc | Timer Address |
mode | Enum value of the selected mode |
References CO_NORMAL, CTC_Mode1, CTC_Mode2, PWM_Mode1, PWM_Mode10, PWM_Mode11, PWM_Mode12, PWM_Mode2, PWM_Mode3, PWM_Mode4, PWM_Mode5, PWM_Mode6, PWM_Mode7, PWM_Mode8, PWM_Mode9, and TCCRB_OFFSET.
Referenced by tc_initc().
void tc_start | ( | volatile void * | p_tc, |
struct tc_control_reg * | p_control_reg | ||
) |
to start the running timer
References tc_control_reg::cs_select, and tc_set_clk_source().
Referenced by initialize_EPD_timer(), and PWM_start_toggle().
void tc_stop | ( | volatile void * | p_tc | ) |
to stop the running timer
References TC_CLKSEL_OFF_gc, TC_COMPA, TC_COMPB, TC_COMPC, tc_disable(), tc_disable_compare_int(), tc_disable_ovf_int(), and tc_set_clk_source().
Referenced by PWM_stop_toggle(), and stop_EPD_timer().
|
inlinestatic |
Write Compare register with timer Value.
tc | Timer Address |
channel_index | Compare Channel to be used |
value | Compare value to be written |
Referenced by PWM_start_toggle().