SAM AC - Analog Comparator Callback Driver.
Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.
Functions | |
Callback Management | |
{@ | |
enum status_code | ac_register_callback (struct ac_module *const module, ac_callback_t callback_func, const enum ac_callback callback_type) |
Registers a callback. More... | |
enum status_code | ac_unregister_callback (struct ac_module *const module, const enum ac_callback callback_type) |
Unregisters a callback. More... | |
static void | ac_enable_callback (struct ac_module *const module, const enum ac_callback callback_type) |
Enables callback. More... | |
static void | ac_disable_callback (struct ac_module *const module, const enum ac_callback callback_type) |
Disables callback. More... | |
|
inlinestatic |
Disables callback.
Disables the callback function registered by the ac_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 AC software instance struct |
[in] | callback_type | Callback type given by an enum |
References AC_CALLBACK_COMPARATOR_0, AC_CALLBACK_COMPARATOR_1, AC_CALLBACK_WINDOW_0, and Assert.
Referenced by cleanup_ac_callback_mode_test().
|
inlinestatic |
Enables callback.
Enables the callback function registered by the ac_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 AC software instance struct |
[in] | callback_type | Callback type given by an enum |
References AC_CALLBACK_COMPARATOR_0, AC_CALLBACK_COMPARATOR_1, AC_CALLBACK_WINDOW_0, Assert, system_interrupt_enable(), and SYSTEM_INTERRUPT_MODULE_AC.
Referenced by configure_ac_callback(), and setup_ac_callback_mode_test().
enum status_code ac_register_callback | ( | struct ac_module *const | module, |
ac_callback_t | callback_func, | ||
const enum ac_callback | callback_type | ||
) |
Registers a callback.
Registers a callback function which is implemented by the user.
[in] | module | Pointer to software instance struct |
[in] | callback_func | Pointer to callback function |
[in] | callback_type | Callback type given by an enum |
STATUS_OK | The function exited successfully |
References Assert, and STATUS_OK.
Referenced by configure_ac_callback(), and setup_ac_callback_mode_test().
enum status_code ac_unregister_callback | ( | struct ac_module *const | module, |
const enum ac_callback | callback_type | ||
) |
Unregisters a callback.
Unregisters a callback function implemented by the user.
[in] | module | Pointer to AC software instance struct |
[in] | callback_type | Callback type given by an enum |
STATUS_OK | The function exited successfully |
References Assert, NULL, and STATUS_OK.
Referenced by cleanup_ac_callback_mode_test().