Microchip® Advanced Software Framework

tc.c File Reference

SAM TC - Timer Counter Driver.

Copyright (c) 2014-2020 Microchip Technology Inc. and its subsidiaries.

#include "tc.h"
#include "tc_interrupt.h"
#include <system_interrupt.h>

Functions

uint8_t _tc_get_inst_index (Tc *const hw)
 
uint32_t tc_get_capture_value (const struct tc_module *const module_inst, const enum tc_compare_capture_channel channel_index)
 Gets the TC module capture value. More...
 
uint32_t tc_get_count_value (const struct tc_module *const module_inst)
 Get TC module count value. More...
 
enum status_code tc_init (struct tc_module *const module_inst, Tc *const hw, const struct tc_config *const config)
 Initializes a hardware TC module instance. More...
 
enum status_code tc_reset (const struct tc_module *const module_inst)
 Resets the TC module. More...
 
enum status_code tc_set_compare_value (const struct tc_module *const module_inst, const enum tc_compare_capture_channel channel_index, const uint32_t compare)
 Sets a TC module compare value. More...
 
enum status_code tc_set_count_value (const struct tc_module *const module_inst, const uint32_t count)
 Sets TC module count value. More...
 
enum status_code tc_set_top_value (const struct tc_module *const module_inst, const uint32_t top_value)
 Set the timer TOP/period value. More...
 

uint8_t _tc_get_inst_index ( Tc *const  hw)

Find the index of given TC module instance.

Parameters
[in]TCmodule instance pointer
Returns
Index of the given TC module instance.

References Assert.

Referenced by init_xosc32k_fail_detector(), tc_enable_callback(), and tc_init().