no-OS
|
Implementation of External IRQ driver for ADuCM302x. More...
#include "no_os_irq.h"
#include "aducm3029_irq.h"
#include "no_os_error.h"
#include <stdlib.h>
#include "no_os_uart.h"
#include "aducm3029_uart.h"
#include "no_os_rtc.h"
#include "aducm3029_rtc.h"
#include "no_os_gpio.h"
#include <drivers/gpio/adi_gpio.h>
#include <drivers/tmr/adi_tmr.h>
#include "no_os_timer.h"
#include "aducm3029_timer.h"
#include "no_os_util.h"
#include "no_os_list.h"
#include "no_os_alloc.h"
Classes | |
struct | event_list |
Struct that stores all the actions for a specific event. More... | |
Macros | |
#define | BASE_XINT_NB (XINT_EVT0_IRQn) |
#define | NB_EXT_INTERRUPTS 4u |
#define | NB_INTERRUPT_CONTROLLERS 1u |
Functions | |
int32_t | irq_action_cmp (void *data1, void *data2) |
Action comparator function. More... | |
int32_t | aducm3029_irq_ctrl_init (struct no_os_irq_ctrl_desc **desc, const struct no_os_irq_init_param *param) |
Initialized the controller for the ADuCM3029 external interrupts. More... | |
int32_t | aducm3029_irq_ctrl_remove (struct no_os_irq_ctrl_desc *desc) |
Free the resources allocated by no_os_irq_ctrl_init() More... | |
int32_t | aducm3029_irq_register_callback (struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, struct no_os_callback_desc *callback_desc) |
Registers a IRQ callback function to irq controller. More... | |
int32_t | aducm3029_irq_unregister_callback (struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, struct no_os_callback_desc *cb) |
Unregister IRQ handling function for the specified irq_id. More... | |
int32_t | aducm3029_irq_global_enable (struct no_os_irq_ctrl_desc *desc) |
Enable all previously enabled interrupts by no_os_irq_enable(). More... | |
int32_t | aducm3029_irq_global_disable (struct no_os_irq_ctrl_desc *desc) |
Disable all external interrupts. More... | |
int32_t | aducm3029_irq_enable (struct no_os_irq_ctrl_desc *desc, uint32_t irq_id) |
Enable the interrupt. More... | |
int32_t | aducm3029_irq_disable (struct no_os_irq_ctrl_desc *desc, uint32_t irq_id) |
Disable the interrupt. More... | |
Variables | |
const struct no_os_irq_platform_ops | aducm_irq_ops |
Aducm3029 platform specific IRQ platform ops structure. More... | |
Implementation of External IRQ driver for ADuCM302x.
Copyright 2019(c) Analog Devices, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define BASE_XINT_NB (XINT_EVT0_IRQn) |
The number of the first external interrupt, used by NVIC
#define NB_EXT_INTERRUPTS 4u |
Number of available external interrupts
#define NB_INTERRUPT_CONTROLLERS 1u |
Number of interrupts controllers available
int32_t aducm3029_irq_ctrl_init | ( | struct no_os_irq_ctrl_desc ** | desc, |
const struct no_os_irq_init_param * | param | ||
) |
Initialized the controller for the ADuCM3029 external interrupts.
desc | - Pointer where the configured instance is stored |
param | - Configuration information for the instance |
int32_t aducm3029_irq_ctrl_remove | ( | struct no_os_irq_ctrl_desc * | desc | ) |
Free the resources allocated by no_os_irq_ctrl_init()
desc | - Interrupt controller descriptor. |
int32_t aducm3029_irq_disable | ( | struct no_os_irq_ctrl_desc * | desc, |
uint32_t | irq_id | ||
) |
Disable the interrupt.
desc | - Interrupt controller descriptor. |
irq_id | - Id of the interrupt |
int32_t aducm3029_irq_enable | ( | struct no_os_irq_ctrl_desc * | desc, |
uint32_t | irq_id | ||
) |
Enable the interrupt.
In order for the irq_id interrupt to be triggered the GPIO associated pin must be set as input.
The associated values are:
desc | - Interrupt controller descriptor. |
irq_id | - Id of the interrupt |
int32_t aducm3029_irq_global_disable | ( | struct no_os_irq_ctrl_desc * | desc | ) |
Disable all external interrupts.
desc | - Interrupt controller descriptor. |
int32_t aducm3029_irq_global_enable | ( | struct no_os_irq_ctrl_desc * | desc | ) |
Enable all previously enabled interrupts by no_os_irq_enable().
desc | - Interrupt controller descriptor. |
int32_t aducm3029_irq_register_callback | ( | struct no_os_irq_ctrl_desc * | desc, |
uint32_t | irq_id, | ||
struct no_os_callback_desc * | callback_desc | ||
) |
Registers a IRQ callback function to irq controller.
desc | - The IRQ controller descriptor. |
irq_id | - Interrupt identifier. |
callback_desc | - Descriptor of the callback. If it is NULL, the callback will be unregistered |
int32_t aducm3029_irq_unregister_callback | ( | struct no_os_irq_ctrl_desc * | desc, |
uint32_t | irq_id, | ||
struct no_os_callback_desc * | cb | ||
) |
Unregister IRQ handling function for the specified irq_id.
desc | - Interrupt controller descriptor. |
irq_id | - Id of the interrupt |
cb | - Callback descriptor. |
int32_t irq_action_cmp | ( | void * | data1, |
void * | data2 | ||
) |
Action comparator function.
irq_action compare function
data1 | - List element |
data2 | - Key |
const struct no_os_irq_platform_ops aducm_irq_ops |
Aducm3029 platform specific IRQ platform ops structure.
ADuCM3029 specific IRQ platform ops structure.