SAM TC - Timer Counter Callback Driver.
Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.
#include "tc_interrupt.h"
Macros | |
#define | _TC_INTERRUPT_HANDLER(n, m) |
Functions | |
void | _tc_interrupt_handler (uint8_t instance) |
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... | |
Variables | |
void * | _tc_instances [TC_INST_NUM] |
#define _TC_INTERRUPT_HANDLER | ( | n, | |
m | |||
) |
ISR handler for TC
Auto-generate a set of interrupt handlers for each TC in the device.
void _tc_interrupt_handler | ( | uint8_t | instance | ) |
Interrupt Handler for TC module
Handles interrupts as they occur, it will run the callback functions that are registered and enabled.
[in] | instance | ID of the TC instance calling the interrupt handler |
References _tc_instances, TC_CALLBACK_CC_CHANNEL0, TC_CALLBACK_CC_CHANNEL1, TC_CALLBACK_ERROR, and TC_CALLBACK_OVERFLOW.
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.
Referenced by configure_tc_callbacks(), run_16bit_capture_and_compare_test(), and run_callback_test().
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.
void* _tc_instances[TC_INST_NUM] |
Referenced by _tc_interrupt_handler(), and tc_init().