no-OS
aducm3029_irq.h
Go to the documentation of this file.
1 /***************************************************************************/
40 #ifndef ADUCM3029_IRQ_H
41 # define ADUCM3029_IRQ_H
42 
43 /******************************************************************************/
44 /***************************** Include Files **********************************/
45 /******************************************************************************/
46 
47 #include <drivers/xint/adi_xint.h>
48 #include <stdbool.h>
49 #include <stdint.h>
50 #include "no_os_irq.h"
51 
52 /******************************************************************************/
53 /********************** Macros and Constants Definitions **********************/
54 /******************************************************************************/
55 
57 #define RTC_COUNT_INT ADI_RTC_COUNT_INT
58 #define RTC_COUNT_ROLLOVER_INT ADI_RTC_COUNT_ROLLOVER_INT
59 
60 /******************************************************************************/
61 /*************************** Types Declarations *******************************/
62 /******************************************************************************/
63 
68 enum irq_id {
77 };
78 
83 enum irq_mode {
85  IRQ_RISING_EDGE = ADI_XINT_IRQ_RISING_EDGE,
87  IRQ_FALLING_EDGE = ADI_XINT_IRQ_FALLING_EDGE,
89  IRQ_EITHER_EDGE = ADI_XINT_IRQ_EITHER_EDGE,
91  IRQ_HIGH_LEVEL = ADI_XINT_IRQ_HIGH_LEVEL,
93  IRQ_LOW_LEVEL = ADI_XINT_IRQ_LOW_LEVEL
94 };
95 
105 };
106 
112 
113 };
114 
118 extern const struct no_os_irq_platform_ops aducm_irq_ops;
119 
123 struct irq_action {
125  uint32_t irq_id;
127  void *handle;
129  void (*callback)(void *context);
131  void *ctx;
135 };
136 
138 int32_t irq_action_cmp(void *data1, void *data2);
139 
140 #endif // ADUCM3029_IRQ_H
NO_OS_UART_MAX_BYTES
#define NO_OS_UART_MAX_BYTES
Definition: aducm3029_uart.h:54
IRQ_EITHER_EDGE
@ IRQ_EITHER_EDGE
Definition: aducm3029_irq.h:89
aducm3029_irq_ctrl_init
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.
Definition: aducm3029_irq.c:210
no_os_list_read_last
int32_t no_os_list_read_last(struct no_os_list_desc *list_desc, void **data)
no_os_list_desc
Structure storing the list and function wrapper for usual list types.
Definition: no_os_list.h:234
no_os_aducm_uart_desc::read_desc
struct no_os_op_desc read_desc
Definition: aducm3029_uart.h:153
NB_INTERRUPTS
@ NB_INTERRUPTS
Definition: aducm3029_irq.h:76
aducm_rtc_desc
Structure holding ADuCM3029 specific RTC descriptor.
Definition: aducm3029_rtc.h:80
no_os_list_get_last
int32_t no_os_list_get_last(struct no_os_list_desc *list_desc, void **data)
aducm3029_uart.h
Header file of UART driver for ADuCM302x.
NO_OS_EVT_UART_RX_COMPLETE
@ NO_OS_EVT_UART_RX_COMPLETE
Definition: no_os_irq.h:70
no_os_callback_desc
Structure describing a callback to be registered.
Definition: no_os_irq.h:136
GPIO_GROUP_POSITIVE_EDGE
@ GPIO_GROUP_POSITIVE_EDGE
Definition: aducm3029_irq.h:104
irq_action_cmp
int32_t irq_action_cmp(void *data1, void *data2)
Action comparator function.
Definition: aducm3029_irq.c:79
irq_action::ctx
void * ctx
Definition: aducm3029_irq.h:131
no_os_irq.h
Header file of IRQ interface.
irq_mode
irq_mode
Trigger condition for the external interrupt.
Definition: aducm3029_irq.h:83
no_os_aducm_uart_desc::uart_handler
ADI_UART_HANDLE uart_handler
Definition: aducm3029_uart.h:135
no_os_op_desc::buff
uint8_t * buff
Definition: aducm3029_uart.h:123
no_os_irq_platform_ops::init
int32_t(* init)(struct no_os_irq_ctrl_desc **desc, const struct no_os_irq_init_param *param)
Definition: no_os_irq.h:166
aducm_timer_desc
It stores instance values specific for the ADuCM302x implementation.
Definition: aducm3029_timer.h:81
aducm3029_irq_ctrl_remove
int32_t aducm3029_irq_ctrl_remove(struct no_os_irq_ctrl_desc *desc)
Free the resources allocated by no_os_irq_ctrl_init()
Definition: aducm3029_irq.c:240
no_os_timer.h
Timer control module header.
ADUCM_UART_INT_ID
@ ADUCM_UART_INT_ID
Definition: aducm3029_irq.h:70
aducm_irq_ops
const struct no_os_irq_platform_ops aducm_irq_ops
ADuCM3029 specific IRQ platform ops structure.
Definition: aducm3029_irq.c:556
RTC_COUNT_ROLLOVER_INT
#define RTC_COUNT_ROLLOVER_INT
Definition: aducm3029_irq.h:58
no_os_op_desc::is_nonblocking
bool is_nonblocking
Definition: aducm3029_uart.h:121
ADUCM_RTC_INT_ID
@ ADUCM_RTC_INT_ID
Definition: aducm3029_irq.h:72
no_os_aducm_uart_desc::errors
enum UART_ERROR errors
Definition: aducm3029_uart.h:137
no_os_rtc_desc::extra
void * extra
Definition: no_os_rtc.h:65
IRQ_RISING_EDGE
@ IRQ_RISING_EDGE
Definition: aducm3029_irq.h:85
aducm3029_irq_enable
int32_t aducm3029_irq_enable(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
Enable the interrupt.
Definition: aducm3029_irq.c:457
NO_OS_EVT_UART_TX_COMPLETE
@ NO_OS_EVT_UART_TX_COMPLETE
Definition: no_os_irq.h:69
NO_OS_LIST_PRIORITY_LIST
@ NO_OS_LIST_PRIORITY_LIST
Definition: no_os_list.h:231
no_os_min
#define no_os_min(x, y)
Definition: no_os_util.h:63
no_os_error.h
Error codes definition.
IRQ_HIGH_LEVEL
@ IRQ_HIGH_LEVEL
Definition: aducm3029_irq.h:91
NO_OS_EVT_TIM_ELAPSED
@ NO_OS_EVT_TIM_ELAPSED
Definition: no_os_irq.h:74
aducm_irq_ops
const struct no_os_irq_platform_ops aducm_irq_ops
Aducm3029 platform specific IRQ platform ops structure.
Definition: aducm3029_irq.c:556
no_os_timer_desc::id
uint16_t id
Definition: no_os_timer.h:59
aducm3029_rtc.h
Header file of RTC driver for ADuCM302x.
no_os_callback_desc::ctx
void * ctx
Definition: no_os_irq.h:148
no_os_irq_unregister_callback
int32_t no_os_irq_unregister_callback(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, struct no_os_callback_desc *callback_desc)
Unregisters a generic IRQ handling function.
Definition: no_os_irq.c:96
GPIO_GROUP_NEGATIVE_EDGE
@ GPIO_GROUP_NEGATIVE_EDGE
Definition: aducm3029_irq.h:102
aducm_timer_desc::tmr_conf
ADI_TMR_CONFIG tmr_conf
Definition: aducm3029_timer.h:87
aducm3029_irq_unregister_callback
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.
Definition: aducm3029_irq.c:376
no_os_irq_trig_level
no_os_irq_trig_level
Definition: no_os_irq.h:77
no_os_irq_init_param::irq_ctrl_id
uint32_t irq_ctrl_id
Definition: no_os_irq.h:105
gpio_irq_mode
gpio_irq_mode
Interrupt conditions for GPIO group interrupts.
Definition: aducm3029_irq.h:100
irq_action::callback
void(* callback)(void *context)
Definition: aducm3029_irq.h:129
event_list::actions
struct no_os_list_desc * actions
Definition: aducm3029_irq.c:90
aducm3029_irq.h
Header file of IRQ driver for ADuCM302x.
irq_action_cmp
int32_t irq_action_cmp(void *data1, void *data2)
Action comparator function.
Definition: aducm3029_irq.c:79
NO_OS_EVT_RTC
@ NO_OS_EVT_RTC
Definition: no_os_irq.h:72
no_os_rtc_desc
Structure holding RTC descriptor.
Definition: no_os_rtc.h:57
no_os_callback_desc::handle
void * handle
Definition: no_os_irq.h:156
no_os_callback_desc::callback
void(* callback)(void *context)
Definition: no_os_irq.h:138
irq_action::handle
void * handle
Definition: aducm3029_irq.h:127
no_os_list_remove
int32_t no_os_list_remove(struct no_os_list_desc *list_desc)
no_os_rtc.h
Header of the RTC interface.
irq_action::irq_id
uint32_t irq_id
Definition: aducm3029_irq.h:125
irq_id
irq_id
Interrupts IDs supported by the irq driver.
Definition: aducm3029_irq.h:68
aducm3029_irq_global_disable
int32_t aducm3029_irq_global_disable(struct no_os_irq_ctrl_desc *desc)
Disable all external interrupts.
Definition: aducm3029_irq.c:430
no_os_op_desc::pending
uint32_t pending
Definition: aducm3029_uart.h:125
no_os_callback_desc::event
enum no_os_irq_event event
Definition: no_os_irq.h:152
aducm3029_irq_register_callback
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.
Definition: aducm3029_irq.c:262
event_list
Struct that stores all the actions for a specific event.
Definition: aducm3029_irq.c:88
no_os_aducm_uart_desc::write_desc
struct no_os_op_desc write_desc
Definition: aducm3029_uart.h:151
irq_action
Struct used to store a (peripheral, callback) pair.
Definition: aducm3029_irq.h:123
no_os_list.h
List library header.
event_list::hal_event
uint32_t hal_event
Definition: aducm3029_irq.c:91
event_list::event
enum no_os_irq_event event
Definition: aducm3029_irq.c:89
NULL
#define NULL
Definition: wrapper.h:64
NO_OS_EVT_GPIO
@ NO_OS_EVT_GPIO
Definition: no_os_irq.h:68
no_os_irq_init_param
Structure holding the initial parameters for Interrupt Request.
Definition: no_os_irq.h:103
no_os_timer_desc::extra
void * extra
Definition: no_os_timer.h:67
no_os_irq_event
no_os_irq_event
Definition: no_os_irq.h:67
IRQ_FALLING_EDGE
@ IRQ_FALLING_EDGE
Definition: aducm3029_irq.h:87
no_os_irq_enable
int32_t no_os_irq_enable(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
Enable specific interrupt.
Definition: no_os_irq.c:144
NO_OS_EVT_UART_ERROR
@ NO_OS_EVT_UART_ERROR
Definition: no_os_irq.h:71
no_os_gpio.h
Header file of GPIO Interface.
no_os_irq_platform_ops
Structure holding IRQ function pointers that point to the platform specific function.
Definition: no_os_irq.h:164
aducm3029_irq_disable
int32_t aducm3029_irq_disable(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
Disable the interrupt.
Definition: aducm3029_irq.c:499
aducm3029_timer.h
Header file of TIMER driver for ADuCM302x.
no_os_uart.h
Header file of UART interface.
IRQ_LOW_LEVEL
@ IRQ_LOW_LEVEL
Definition: aducm3029_irq.h:93
aducm_rtc_desc::instance
void * instance
Definition: aducm3029_rtc.h:82
no_os_list_add_last
int32_t no_os_list_add_last(struct no_os_list_desc *list_desc, void *data)
no_os_list_init
int32_t no_os_list_init(struct no_os_list_desc **list_desc, enum no_os_adapter_type type, f_cmp comparator)
aducm_irq_ctrl_desc
Stores specific platform parameters.
Definition: aducm3029_irq.h:111
no_os_timer_desc
Structure holding timer descriptor.
Definition: no_os_timer.h:57
no_os_util.h
Header file of utility functions.
no_os_irq_disable
int32_t no_os_irq_disable(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
Disable specific interrupt.
Definition: no_os_irq.c:155
aducm3029_irq_global_enable
int32_t aducm3029_irq_global_enable(struct no_os_irq_ctrl_desc *desc)
Enable all previously enabled interrupts by no_os_irq_enable().
Definition: aducm3029_irq.c:413
irq_action::trig_lv
enum no_os_irq_trig_level trig_lv
Definition: aducm3029_irq.h:134
no_os_irq_ctrl_desc
Definition: no_os_irq.h:119
no_os_aducm_uart_desc
Stores specific parameter needed by the UART driver for internal operations.
Definition: aducm3029_uart.h:133
RTC_COUNT_INT
#define RTC_COUNT_INT
Definition: aducm3029_irq.h:57
no_os_irq_ctrl_desc::extra
void * extra
Definition: no_os_irq.h:128
ADUCM_TIMER1_INT_ID
@ ADUCM_TIMER1_INT_ID
Definition: aducm3029_irq.h:74