no-OS
aducm3029_irq.h
Go to the documentation of this file.
1 /***************************************************************************/
34 #ifndef ADUCM3029_IRQ_H
35 # define ADUCM3029_IRQ_H
36 
37 /******************************************************************************/
38 /***************************** Include Files **********************************/
39 /******************************************************************************/
40 
41 #include <drivers/xint/adi_xint.h>
42 #include <stdbool.h>
43 #include <stdint.h>
44 #include "no_os_irq.h"
45 
46 /******************************************************************************/
47 /********************** Macros and Constants Definitions **********************/
48 /******************************************************************************/
49 
51 #define RTC_COUNT_INT ADI_RTC_COUNT_INT
52 #define RTC_COUNT_ROLLOVER_INT ADI_RTC_COUNT_ROLLOVER_INT
53 
54 /******************************************************************************/
55 /*************************** Types Declarations *******************************/
56 /******************************************************************************/
57 
62 enum irq_id {
71 };
72 
77 enum irq_mode {
79  IRQ_RISING_EDGE = ADI_XINT_IRQ_RISING_EDGE,
81  IRQ_FALLING_EDGE = ADI_XINT_IRQ_FALLING_EDGE,
83  IRQ_EITHER_EDGE = ADI_XINT_IRQ_EITHER_EDGE,
85  IRQ_HIGH_LEVEL = ADI_XINT_IRQ_HIGH_LEVEL,
87  IRQ_LOW_LEVEL = ADI_XINT_IRQ_LOW_LEVEL
88 };
89 
99 };
100 
106 
107 };
108 
112 extern const struct no_os_irq_platform_ops aducm_irq_ops;
113 
117 struct irq_action {
119  uint32_t irq_id;
121  void *handle;
123  void (*callback)(void *context);
125  void *ctx;
129 };
130 
132 int32_t irq_action_cmp(void *data1, void *data2);
133 
134 #endif // ADUCM3029_IRQ_H
NO_OS_UART_MAX_BYTES
#define NO_OS_UART_MAX_BYTES
Definition: aducm3029_uart.h:49
IRQ_EITHER_EDGE
@ IRQ_EITHER_EDGE
Definition: aducm3029_irq.h:83
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:205
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:228
no_os_aducm_uart_desc::read_desc
struct no_os_op_desc read_desc
Definition: aducm3029_uart.h:148
no_os_alloc.h
NB_INTERRUPTS
@ NB_INTERRUPTS
Definition: aducm3029_irq.h:70
aducm_rtc_desc
Structure holding ADuCM3029 specific RTC descriptor.
Definition: aducm3029_rtc.h:74
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:64
no_os_callback_desc
Structure describing a callback to be registered.
Definition: no_os_irq.h:142
GPIO_GROUP_POSITIVE_EDGE
@ GPIO_GROUP_POSITIVE_EDGE
Definition: aducm3029_irq.h:98
irq_action_cmp
int32_t irq_action_cmp(void *data1, void *data2)
Action comparator function.
Definition: aducm3029_irq.c:74
irq_action::ctx
void * ctx
Definition: aducm3029_irq.h:125
no_os_irq.h
Header file of IRQ interface.
irq_mode
irq_mode
Trigger condition for the external interrupt.
Definition: aducm3029_irq.h:77
no_os_aducm_uart_desc::uart_handler
ADI_UART_HANDLE uart_handler
Definition: aducm3029_uart.h:130
no_os_op_desc::buff
uint8_t * buff
Definition: aducm3029_uart.h:118
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:162
aducm_timer_desc
It stores instance values specific for the ADuCM302x implementation.
Definition: aducm3029_timer.h:75
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:235
no_os_timer.h
Timer control module header.
no_os_calloc
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:54
ADUCM_UART_INT_ID
@ ADUCM_UART_INT_ID
Definition: aducm3029_irq.h:64
aducm_irq_ops
const struct no_os_irq_platform_ops aducm_irq_ops
ADuCM3029 specific IRQ platform ops structure.
Definition: aducm3029_irq.c:551
RTC_COUNT_ROLLOVER_INT
#define RTC_COUNT_ROLLOVER_INT
Definition: aducm3029_irq.h:52
no_os_op_desc::is_nonblocking
bool is_nonblocking
Definition: aducm3029_uart.h:116
ADUCM_RTC_INT_ID
@ ADUCM_RTC_INT_ID
Definition: aducm3029_irq.h:66
no_os_aducm_uart_desc::errors
enum UART_ERROR errors
Definition: aducm3029_uart.h:132
no_os_rtc_desc::extra
void * extra
Definition: no_os_rtc.h:59
IRQ_RISING_EDGE
@ IRQ_RISING_EDGE
Definition: aducm3029_irq.h:79
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:452
NO_OS_EVT_UART_TX_COMPLETE
@ NO_OS_EVT_UART_TX_COMPLETE
Definition: no_os_irq.h:63
NO_OS_LIST_PRIORITY_LIST
@ NO_OS_LIST_PRIORITY_LIST
Definition: no_os_list.h:225
no_os_min
#define no_os_min(x, y)
Definition: no_os_util.h:59
no_os_error.h
Error codes definition.
IRQ_HIGH_LEVEL
@ IRQ_HIGH_LEVEL
Definition: aducm3029_irq.h:85
NO_OS_EVT_TIM_ELAPSED
@ NO_OS_EVT_TIM_ELAPSED
Definition: no_os_irq.h:68
aducm_irq_ops
const struct no_os_irq_platform_ops aducm_irq_ops
Aducm3029 platform specific IRQ platform ops structure.
Definition: aducm3029_irq.c:551
no_os_timer_desc::id
uint16_t id
Definition: no_os_timer.h:61
aducm3029_rtc.h
Header file of RTC driver for ADuCM302x.
no_os_callback_desc::ctx
void * ctx
Definition: no_os_irq.h:146
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:112
GPIO_GROUP_NEGATIVE_EDGE
@ GPIO_GROUP_NEGATIVE_EDGE
Definition: aducm3029_irq.h:96
aducm_timer_desc::tmr_conf
ADI_TMR_CONFIG tmr_conf
Definition: aducm3029_timer.h:81
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:371
no_os_irq_trig_level
no_os_irq_trig_level
Definition: no_os_irq.h:76
no_os_irq_init_param::irq_ctrl_id
uint32_t irq_ctrl_id
Definition: no_os_irq.h:109
gpio_irq_mode
gpio_irq_mode
Interrupt conditions for GPIO group interrupts.
Definition: aducm3029_irq.h:94
irq_action::callback
void(* callback)(void *context)
Definition: aducm3029_irq.h:123
event_list::actions
struct no_os_list_desc * actions
Definition: aducm3029_irq.c:85
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:74
NO_OS_EVT_RTC
@ NO_OS_EVT_RTC
Definition: no_os_irq.h:66
no_os_rtc_desc
Structure holding RTC descriptor.
Definition: no_os_rtc.h:51
no_os_callback_desc::handle
void * handle
Definition: no_os_irq.h:152
no_os_callback_desc::callback
void(* callback)(void *context)
Definition: no_os_irq.h:144
irq_action::handle
void * handle
Definition: aducm3029_irq.h:121
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:119
irq_id
irq_id
Interrupts IDs supported by the irq driver.
Definition: aducm3029_irq.h:62
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:425
no_os_op_desc::pending
uint32_t pending
Definition: aducm3029_uart.h:120
no_os_callback_desc::event
enum no_os_irq_event event
Definition: no_os_irq.h:148
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:257
event_list
Struct that stores all the actions for a specific event.
Definition: aducm3029_irq.c:83
no_os_aducm_uart_desc::write_desc
struct no_os_op_desc write_desc
Definition: aducm3029_uart.h:146
no_os_free
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
irq_action
Struct used to store a (peripheral, callback) pair.
Definition: aducm3029_irq.h:117
no_os_list.h
List library header.
event_list::hal_event
uint32_t hal_event
Definition: aducm3029_irq.c:86
event_list::event
enum no_os_irq_event event
Definition: aducm3029_irq.c:84
NULL
#define NULL
Definition: wrapper.h:64
NO_OS_EVT_GPIO
@ NO_OS_EVT_GPIO
Definition: no_os_irq.h:62
no_os_irq_init_param
Structure holding the initial parameters for Interrupt Request.
Definition: no_os_irq.h:107
no_os_timer_desc::extra
void * extra
Definition: no_os_timer.h:69
no_os_irq_event
no_os_irq_event
Definition: no_os_irq.h:61
IRQ_FALLING_EDGE
@ IRQ_FALLING_EDGE
Definition: aducm3029_irq.h:81
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:181
NO_OS_EVT_UART_ERROR
@ NO_OS_EVT_UART_ERROR
Definition: no_os_irq.h:65
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:160
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:494
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:87
aducm_rtc_desc::instance
void * instance
Definition: aducm3029_rtc.h:76
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:105
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:198
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:408
irq_action::trig_lv
enum no_os_irq_trig_level trig_lv
Definition: aducm3029_irq.h:128
no_os_irq_ctrl_desc
Definition: no_os_irq.h:123
no_os_aducm_uart_desc
Stores specific parameter needed by the UART driver for internal operations.
Definition: aducm3029_uart.h:128
RTC_COUNT_INT
#define RTC_COUNT_INT
Definition: aducm3029_irq.h:51
no_os_irq_ctrl_desc::extra
void * extra
Definition: no_os_irq.h:134
ADUCM_TIMER1_INT_ID
@ ADUCM_TIMER1_INT_ID
Definition: aducm3029_irq.h:68