#include "asf.h"
#include "timer_hw.h"
#include "conf_timer.h"
Data Structures | |
struct | hw_timer_struct |
Functions | |
void | hw_timer_init (void) |
void | hw_timer_register_callback (hw_timer_callback_t cb_ptr) |
void | hw_timer_start (uint32_t timer_val_s) |
void | hw_timer_start_ms (uint32_t timer_val_ms) |
void | hw_timer_stop (void) |
void * | platform_create_hw_timer (platform_hw_timer_callback_t bus_tc_cb_ptr) |
void | platform_delete_bus_timer (void *timer_handle) |
void | platform_start_bus_timer (void *timer_handle, uint32_t ms) |
void | platform_stop_bus_timer (void *timer_handle) |
void | platform_stop_stack_timers (void) |
void | tc_cc0_cb (struct tc_module *const module_inst) |
void | tc_cc1_cb (struct tc_module *const module_inst) |
Variables | |
static struct hw_timer_struct | hw_timers [STACK_HW_TIMERS] |
platform_hw_timer_callback_t | platform_cc1_cb |
static uint32_t | tc_count_ms |
static uint32_t | timeout_count_ms |
hw_timer_callback_t | timer_callback |
uint32_t | timer_count_per_ms |
void hw_timer_init | ( | void | ) |
References tc_config::clock_prescaler, tc_config::clock_source, tc_16bit_config::compare_capture_channel, tc_config::counter_16_bit, tc_config::counter_8_bit, tc_config::counter_size, GCLK_GENERATOR_0, tc_8bit_config::period, TC_CALLBACK_CC_CHANNEL0, tc_cc0_cb(), TC_CLOCK_PRESCALER_DIV1024, TC_COUNTER_SIZE_16BIT, tc_enable(), tc_get_config_defaults(), tc_init(), tc_instance, and tc_register_callback().
void hw_timer_register_callback | ( | hw_timer_callback_t | cb_ptr | ) |
References timer_callback.
void hw_timer_start | ( | uint32_t | timer_val_s | ) |
References hw_timer_start_ms().
void hw_timer_start_ms | ( | uint32_t | timer_val_ms | ) |
References TC_CALLBACK_CC_CHANNEL0, tc_count_ms, tc_enable_callback(), tc_instance, tc_set_count_value(), and timeout_count_ms.
void hw_timer_stop | ( | void | ) |
References TC_CALLBACK_CC_CHANNEL0, tc_disable_callback(), and tc_instance.
void* platform_create_hw_timer | ( | platform_hw_timer_callback_t | bus_tc_cb_ptr | ) |
References tc_config::clock_prescaler, tc_config::clock_source, tc_config::count_direction, tc_config::counter_size, hw_timers, i, NULL, tc_config::oneshot, system_gclk_gen_get_hz(), TC_CALLBACK_OVERFLOW, TC_COUNT_DIRECTION_DOWN, TC_COUNTER_SIZE_32BIT, tc_enable(), tc_enable_callback(), tc_get_config_defaults(), tc_init(), tc_register_callback(), tc_set_count_value(), tc_start_counter(), tc_stop_counter(), hw_timer_struct::timer_frequency, and hw_timer_struct::timer_usage.
void platform_delete_bus_timer | ( | void * | timer_handle | ) |
References tc_reset(), tc_stop_counter(), hw_timer_struct::timer_instance, and hw_timer_struct::timer_usage.
void platform_start_bus_timer | ( | void * | timer_handle, |
uint32_t | ms | ||
) |
void platform_stop_bus_timer | ( | void * | timer_handle | ) |
References tc_stop_counter(), and hw_timer_struct::timer_instance.
void platform_stop_stack_timers | ( | void | ) |
References hw_timers, tc_stop_counter(), and hw_timer_struct::timer_instance.
void tc_cc0_cb | ( | struct tc_module *const | module_inst | ) |
void tc_cc1_cb | ( | struct tc_module *const | module_inst | ) |
|
static |
Referenced by platform_create_hw_timer(), and platform_stop_stack_timers().
platform_hw_timer_callback_t platform_cc1_cb |
|
static |
Referenced by hw_timer_start_ms().
|
static |
Referenced by hw_timer_start_ms().
hw_timer_callback_t timer_callback |
uint32_t timer_count_per_ms |