no-OS
irq_extra.h
Go to the documentation of this file.
1 /***************************************************************************/
40 #ifndef IRQ_EXTRA_H
41 # define IRQ_EXTRA_H
42 
43 /******************************************************************************/
44 /***************************** Include Files **********************************/
45 /******************************************************************************/
46 
47 #include <drivers/xint/adi_xint.h>
48 #include <stdbool.h>
49 #include "irq.h"
50 
51 /******************************************************************************/
52 /********************** Macros and Constants Definitions **********************/
53 /******************************************************************************/
54 
56 #define NB_INTERRUPTS 8u
57 
59 #define RTC_COUNT_INT ADI_RTC_COUNT_INT
60 #define RTC_COUNT_ROLLOVER_INT ADI_RTC_COUNT_ROLLOVER_INT
61 
62 /******************************************************************************/
63 /*************************** Types Declarations *******************************/
64 /******************************************************************************/
65 
70 enum irq_id {
87 };
88 
93 enum irq_mode {
95  IRQ_RISING_EDGE = ADI_XINT_IRQ_RISING_EDGE,
97  IRQ_FALLING_EDGE = ADI_XINT_IRQ_FALLING_EDGE,
99  IRQ_EITHER_EDGE = ADI_XINT_IRQ_EITHER_EDGE,
101  IRQ_HIGH_LEVEL = ADI_XINT_IRQ_HIGH_LEVEL,
103  IRQ_LOW_LEVEL = ADI_XINT_IRQ_LOW_LEVEL
104 };
105 
115 };
116 
126 };
127 
137 };
138 
143 union irq_config {
152 };
153 
164  uint8_t irq_memory[ADI_XINT_MEMORY_SIZE];
166  uint32_t enabled;
167 };
168 
169 #endif // IRQ_EXTRA_H_
IS_ERR_VALUE
#define IS_ERR_VALUE(x)
Definition: error.h:65
BIT
#define BIT(x)
Definition: util.h:51
BASE_XINT_NB
#define BASE_XINT_NB
Definition: irq.c:61
IRQ_FALLING_EDGE
@ IRQ_FALLING_EDGE
Definition: irq_extra.h:97
aducm_rtc_desc
Structure holding ADuCM3029 specific RTC descriptor.
Definition: rtc_extra.h:80
aducm_irq_ctrl_desc::enabled
uint32_t enabled
Definition: irq_extra.h:166
irq_unregister
int32_t irq_unregister(struct irq_ctrl_desc *desc, uint32_t irq_id)
Unregister IRQ handling function for the specified irq_id.
Definition: irq.c:255
ADUCM_EXTERNAL_INT2_ID
@ ADUCM_EXTERNAL_INT2_ID
Definition: irq_extra.h:76
irq_ctrl_desc
Definition: irq.h:88
irq_ctrl_desc::extra
void * extra
Definition: irq.h:92
irq_global_enable
int32_t irq_global_enable(struct irq_ctrl_desc *desc)
Enable all previously enabled interrupts by irq_enable().
Definition: irq.c:326
rtc_desc
Structure holding RTC descriptor.
Definition: rtc.h:57
irq_init_param::extra
void * extra
Definition: irq.h:81
IRQ_RISING_EDGE
@ IRQ_RISING_EDGE
Definition: irq_extra.h:95
irq_config::rtc_conf
struct rtc_irq_config * rtc_conf
Definition: irq_extra.h:149
irq_global_disable
int32_t irq_global_disable(struct irq_ctrl_desc *desc)
Disable all external interrupts.
Definition: irq.c:353
irq_register_callback
int32_t irq_register_callback(struct irq_ctrl_desc *desc, uint32_t irq_id, struct callback_desc *callback_desc)
Registers a IRQ callback function to irq controller.
Definition: irq.c:164
callback_desc::ctx
void * ctx
Definition: irq.h:108
irq_extra.h
rtc_extra.h
Header file of RTC driver for ADuCM302x.
xil_irq_desc
Xilinx platform specific IRQ descriptor.
Definition: irq_extra.h:76
rtc_desc::extra
void * extra
Definition: rtc.h:65
IRQ_LOW_LEVEL
@ IRQ_LOW_LEVEL
Definition: irq_extra.h:103
gpio_desc
struct gpio_desc gpio_desc
callback_desc::config
void * config
Definition: irq.h:110
aducm_irq_ctrl_desc::callback_configured
bool callback_configured[NB_INTERRUPTS]
Definition: irq_extra.h:162
IRQ_PL
@ IRQ_PL
Definition: irq_extra.h:57
irq_config::uart_conf
struct uart_desc * uart_conf
Definition: irq_extra.h:145
xil_irq_desc::type
enum xil_irq_type type
Definition: irq_extra.h:78
uart.h
Header file of UART interface.
aducm_irq_ctrl_desc::irq_memory
uint8_t irq_memory[ADI_XINT_MEMORY_SIZE]
Definition: irq_extra.h:164
ADUCM_GPIO_B_INT_ID
@ ADUCM_GPIO_B_INT_ID
Definition: irq_extra.h:86
gpio_desc::number
int32_t number
Definition: gpio.h:86
irq_disable
int32_t irq_disable(struct irq_ctrl_desc *desc, uint32_t irq_id)
Disable the interrupt.
Definition: irq.c:432
irq_config
Configuration for the callback.
Definition: irq_extra.h:143
irq_trig_level
irq_trig_level
Definition: irq.h:66
irq_enable
int32_t irq_enable(struct irq_ctrl_desc *desc, uint32_t irq_id)
Enable the interrupt.
Definition: irq.c:390
GPIO_GROUP_NEGATIVE_EDGE
@ GPIO_GROUP_NEGATIVE_EDGE
Definition: irq_extra.h:123
uart_extra.h
Header file of UART driver for ADuCM302x.
error.h
Error codes definition.
callback_desc
Structure describing a callback to be registered.
Definition: irq.h:99
IRQ_EITHER_EDGE
@ IRQ_EITHER_EDGE
Definition: irq_extra.h:99
irq_id
irq_id
Interrupts IDs supported by the irq driver.
Definition: irq_extra.h:70
ADUCM_RTC_INT_ID
@ ADUCM_RTC_INT_ID
Definition: irq_extra.h:82
irq_ctrl_desc::irq_ctrl_id
uint32_t irq_ctrl_id
Definition: irq.h:90
callback_desc::callback
void(* callback)(void *ctx, uint32_t event, void *extra)
Definition: irq.h:106
rtc_irq_config::rtc_handler
struct rtc_desc * rtc_handler
Definition: irq_extra.h:112
ADUCM_GPIO_A_INT_ID
@ ADUCM_GPIO_A_INT_ID
Definition: irq_extra.h:84
xil_irq_desc::instance
void * instance
Definition: irq_extra.h:80
gpio_desc
Structure holding the GPIO descriptor.
Definition: gpio.h:84
rtc_irq_config::active_interrupts
uint32_t active_interrupts
Definition: irq_extra.h:114
IRQ_PS
@ IRQ_PS
Definition: irq_extra.h:59
ADUCM_UART_INT_ID
@ ADUCM_UART_INT_ID
Definition: irq_extra.h:80
uart_desc::callback
void(* callback)(void *callback_ctx, uint32_t event, void *extra)
Definition: uart.h:126
rtc_irq_config
RTC interrupt configuration routine.
Definition: irq_extra.h:110
irq.h
Header file of IRQ interface.
uart_desc
Stucture holding the UART descriptor.
Definition: uart.h:120
gpio_irq_config
GPIO group interrupt configuration routine.
Definition: irq_extra.h:132
gpio.h
Header file of GPIO Interface.
ADUCM_EXTERNAL_INT1_ID
@ ADUCM_EXTERNAL_INT1_ID
Definition: irq_extra.h:74
NULL
#define NULL
Definition: wrapper.h:64
irq_mode
irq_mode
Trigger condition for the external interrupt.
Definition: irq_extra.h:93
SUCCESS
#define SUCCESS
Definition: error.h:52
NB_EXT_INTERRUPTS
#define NB_EXT_INTERRUPTS
Definition: irq.c:64
IRQ_HIGH_LEVEL
@ IRQ_HIGH_LEVEL
Definition: irq_extra.h:101
irq_init_param::irq_ctrl_id
uint32_t irq_ctrl_id
Definition: irq.h:79
irq_config::xint_conf
enum irq_mode xint_conf
Definition: irq_extra.h:147
ADUCM_EXTERNAL_INT0_ID
@ ADUCM_EXTERNAL_INT0_ID
Definition: irq_extra.h:72
irq_ctrl_init
int32_t irq_ctrl_init(struct irq_ctrl_desc **desc, const struct irq_init_param *param)
Initialized the controller for the ADuCM3029 external interrupts.
Definition: irq.c:101
NB_INTERRUPTS
#define NB_INTERRUPTS
Definition: irq_extra.h:56
gpio_irq_config::mode
enum gpio_irq_mode mode
Definition: irq_extra.h:136
rtc.h
Header of the RTC interface.
irq_config::gpio_conf
struct gpio_irq_config * gpio_conf
Definition: irq_extra.h:151
aducm_rtc_desc::instance
void * instance
Definition: rtc_extra.h:82
aducm_irq_ctrl_desc
Stores specific platform parameters.
Definition: irq_extra.h:158
gpio_irq_config::gpio_handler
struct gpio_desc * gpio_handler
Definition: irq_extra.h:134
GPIO_GROUP_POSITIVE_EDGE
@ GPIO_GROUP_POSITIVE_EDGE
Definition: irq_extra.h:125
util.h
Implementation of utility functions.
FAILURE
#define FAILURE
Definition: error.h:56
ADUCM_EXTERNAL_INT3_ID
@ ADUCM_EXTERNAL_INT3_ID
Definition: irq_extra.h:78
aducm_irq_ctrl_desc::conf
union irq_config conf[NB_INTERRUPTS]
Definition: irq_extra.h:160
xil_irq_init_param
Structure holding the initialization parameters for Xilinx platform specific IRQ parameters.
Definition: irq_extra.h:67
uart_desc::callback_ctx
void * callback_ctx
Definition: uart.h:129
irq_trigger_level_set
int32_t irq_trigger_level_set(struct irq_ctrl_desc *desc, uint32_t irq_id, enum irq_trig_level trig)
Set interrupt trigger level.
Definition: irq.c:291
gpio_irq_mode
gpio_irq_mode
Interrupt conditions for GPIO group interrupts.
Definition: irq_extra.h:121
irq_extra.h
Header file of IRQ driver for ADuCM302x.
irq_init_param
Structure holding the initial parameters for Interrupt Request.
Definition: irq.h:77
irq_ctrl_remove
int32_t irq_ctrl_remove(struct irq_ctrl_desc *desc)
Free the resources allocated by irq_ctrl_init()
Definition: irq.c:134