Microchip® Advanced Software Framework

timer_hw.c File Reference

Handler timer functionalities.

Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.

#include "asf.h"
#include "timer_hw.h"
#include "conf_timer.h"

Data Structures

struct  hw_timer_tag
 

Macros

#define MAX_TIMEOUT_MS   (65)
 
#define MAX_TIMEOUT_MS   (65)
 

Typedefs

typedef struct hw_timer_tag hw_timer_t
 

Functions

static void _start_timer (Tc *tc, uint32_t channel_id, uint32_t timeout_ms)
 
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 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 TC0_Handler (void)
 
void TC1_Handler (void)
 
void TC2_Handler (void)
 

Variables

platform_hw_timer_callback_t bus_timer_callback
 
static hw_timer_t hw_timers [STACK_HW_TIMERS]
 
static uint32_t tc_count_ms
 
static uint32_t timeout_count_ms
 
hw_timer_callback_t timer_callback
 

#define MAX_TIMEOUT_MS   (65)
#define MAX_TIMEOUT_MS   (65)

typedef struct hw_timer_tag hw_timer_t

static void _start_timer ( Tc *  tc,
uint32_t  channel_id,
uint32_t  timeout_ms 
)
inlinestatic
void hw_timer_init ( void  )
void hw_timer_register_callback ( hw_timer_callback_t  cb_ptr)

References timer_callback.

Referenced by main().

void hw_timer_start_ms ( uint32_t  timer_val_ms)
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  )

References tc_stop().

Referenced by main().

platform_hw_timer_callback_t bus_timer_callback
hw_timer_t hw_timers[STACK_HW_TIMERS]
static
Initial value:
= {
{
.instance = STACK_TIMER_0,
.tc_id = STACK_TIMER_0_ID,
.channel_id = STACK_TIMER_0_CHANNEL_ID,
.state = UNUSED,
.callback = NULL,
},
{
.instance = STACK_TIMER_1,
.tc_id = STACK_TIMER_1_ID,
.channel_id = STACK_TIMER_1_CHANNEL_ID,
.state = UNUSED,
.callback = NULL,
},
}
#define UNUSED(v)
Marking v as a unused parameter or value.
Definition: compiler.h:86
#define NULL
Definition: wilc/bsp/include/nm_bsp.h:70

Referenced by platform_create_hw_timer().

uint32_t tc_count_ms
static

Referenced by hw_timer_start_ms(), and TC0_Handler().

uint32_t timeout_count_ms
static

Referenced by hw_timer_start_ms(), and TC0_Handler().