SAM TC - Timer Counter Callback Driver.
Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.
Functions | |
Callback Management | |
{@ | |
enum status_code | tc_register_callback (struct tc_module *const module, tc_callback_t callback_func, const enum tc_callback callback_type) |
Registers a callback. More... | |
enum status_code | tc_unregister_callback (struct tc_module *const module, const enum tc_callback callback_type) |
Unregisters a callback. More... | |
static void | tc_enable_callback (struct tc_module *const module, const enum tc_callback callback_type) |
Enables callback. More... | |
static void | tc_disable_callback (struct tc_module *const module, const enum tc_callback callback_type) |
Disables callback. More... | |
|
inlinestatic |
Disables callback.
Disables the callback function registered by the tc_register_callback, and the callback will not be called from the interrupt routine. The function will also disable the appropriate interrupts.
[in] | module | Pointer to TC software instance struct |
[in] | callback_type | Callback type given by an enum |
References Assert, TC_CALLBACK_CC_CHANNEL0, and TC_CALLBACK_CC_CHANNEL1.
|
inlinestatic |
Enables callback.
Enables the callback function registered by the tc_register_callback. The callback function will be called from the interrupt handler when the conditions for the callback type are met. This function will also enable the appropriate interrupts.
[in] | module | Pointer to TC software instance struct |
[in] | callback_type | Callback type given by an enum |
References _tc_get_inst_index(), Assert, system_interrupt_enable(), TC_CALLBACK_CC_CHANNEL0, and TC_CALLBACK_CC_CHANNEL1.
enum status_code tc_register_callback | ( | struct tc_module *const | module, |
tc_callback_t | callback_func, | ||
const enum tc_callback | callback_type | ||
) |
Registers a callback.
Registers a callback function which is implemented by the user.
[in] | module | Pointer to TC software instance struct |
[in] | callback_func | Pointer to callback function |
[in] | callback_type | Callback type given by an enum |
References Assert, STATUS_OK, TC_CALLBACK_CC_CHANNEL0, and TC_CALLBACK_CC_CHANNEL1.
enum status_code tc_unregister_callback | ( | struct tc_module *const | module, |
const enum tc_callback | callback_type | ||
) |
Unregisters a callback.
Unregisters a callback function implemented by the user. The callback should be disabled before it is unregistered.
[in] | module | Pointer to TC software instance struct |
[in] | callback_type | Callback type given by an enum |
References Assert, NULL, STATUS_OK, TC_CALLBACK_CC_CHANNEL0, and TC_CALLBACK_CC_CHANNEL1.