no-OS
Classes | Enumerations | Functions
no_os_irq.h File Reference

Header file of IRQ interface. More...

#include <stdint.h>
Include dependency graph for no_os_irq.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  no_os_irq_init_param
 Structure holding the initial parameters for Interrupt Request. More...
 
struct  no_os_irq_ctrl_desc
 
struct  no_os_callback_desc
 Structure describing a callback to be registered. More...
 
struct  no_os_irq_platform_ops
 Structure holding IRQ function pointers that point to the platform specific function. More...
 

Enumerations

enum  no_os_irq_uart_event_e {
  NO_OS_IRQ_WRITE_DONE,
  NO_OS_IRQ_READ_DONE,
  NO_OS_IRQ_ERROR
}
 Possible events for uart interrupt. More...
 
enum  no_os_irq_event {
  NO_OS_EVT_GPIO,
  NO_OS_EVT_UART_TX_COMPLETE,
  NO_OS_EVT_UART_RX_COMPLETE,
  NO_OS_EVT_UART_ERROR,
  NO_OS_EVT_RTC,
  NO_OS_EVT_XINT,
  NO_OS_EVT_TIM_ELAPSED,
  NO_OS_EVT_TIM_PWM_PULSE_FINISHED,
  NO_OS_EVT_DMA_RX_COMPLETE,
  NO_OS_EVT_DMA_RX_HALF_COMPLETE,
  NO_OS_EVT_DMA_TX_COMPLETE,
  NO_OS_EVT_USB
}
 
enum  no_os_irq_trig_level {
  NO_OS_IRQ_LEVEL_LOW,
  NO_OS_IRQ_LEVEL_HIGH,
  NO_OS_IRQ_EDGE_FALLING,
  NO_OS_IRQ_EDGE_RISING,
  NO_OS_IRQ_EDGE_BOTH
}
 
enum  no_os_irq_peripheral {
  NO_OS_GPIO_IRQ,
  NO_OS_UART_IRQ,
  NO_OS_RTC_IRQ,
  NO_OS_TIM_IRQ,
  NO_OS_TDM_DMA_IRQ,
  NO_OS_TIM_DMA_IRQ,
  NO_OS_SPI_DMA_IRQ,
  NO_OS_DMA_IRQ,
  NO_OS_USB_IRQ
}
 

Functions

int32_t no_os_irq_ctrl_init (struct no_os_irq_ctrl_desc **desc, const struct no_os_irq_init_param *param)
 Initialize the IRQ interrupts. More...
 
int32_t no_os_irq_ctrl_remove (struct no_os_irq_ctrl_desc *desc)
 Free the resources allocated by no_os_irq_ctrl_init(). More...
 
int32_t no_os_irq_register_callback (struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, struct no_os_callback_desc *callback_desc)
 Register a callback to handle the irq events. More...
 
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. More...
 
int32_t no_os_irq_global_enable (struct no_os_irq_ctrl_desc *desc)
 Enable global interrupts. More...
 
int32_t no_os_irq_global_disable (struct no_os_irq_ctrl_desc *desc)
 Disable global interrupts. More...
 
int32_t no_os_irq_trigger_level_set (struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, enum no_os_irq_trig_level trig)
 Set interrupt trigger level. More...
 
int32_t no_os_irq_enable (struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
 Enable specific interrupt. More...
 
int32_t no_os_irq_disable (struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
 Disable specific interrupt. More...
 
int32_t no_os_irq_set_priority (struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, uint32_t priority_level)
 Set the priority for an interrupt. More...
 
int32_t no_os_irq_clear_pending (struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
 Clear the pending interrupt. More...
 

Detailed Description

Header file of IRQ interface.

Author
Cristian Pop (crist.nosp@m.ian..nosp@m.pop@a.nosp@m.nalo.nosp@m.g.com)

Copyright 2019(c) Analog Devices, Inc.

All rights reserved.

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 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, 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.

Enumeration Type Documentation

◆ no_os_irq_event

Enumerator
NO_OS_EVT_GPIO 
NO_OS_EVT_UART_TX_COMPLETE 
NO_OS_EVT_UART_RX_COMPLETE 
NO_OS_EVT_UART_ERROR 
NO_OS_EVT_RTC 
NO_OS_EVT_XINT 
NO_OS_EVT_TIM_ELAPSED 
NO_OS_EVT_TIM_PWM_PULSE_FINISHED 
NO_OS_EVT_DMA_RX_COMPLETE 
NO_OS_EVT_DMA_RX_HALF_COMPLETE 
NO_OS_EVT_DMA_TX_COMPLETE 
NO_OS_EVT_USB 

◆ no_os_irq_peripheral

Enumerator
NO_OS_GPIO_IRQ 
NO_OS_UART_IRQ 
NO_OS_RTC_IRQ 
NO_OS_TIM_IRQ 
NO_OS_TDM_DMA_IRQ 
NO_OS_TIM_DMA_IRQ 
NO_OS_SPI_DMA_IRQ 
NO_OS_DMA_IRQ 
NO_OS_USB_IRQ 

◆ no_os_irq_trig_level

Enumerator
NO_OS_IRQ_LEVEL_LOW 
NO_OS_IRQ_LEVEL_HIGH 
NO_OS_IRQ_EDGE_FALLING 
NO_OS_IRQ_EDGE_RISING 
NO_OS_IRQ_EDGE_BOTH 

◆ no_os_irq_uart_event_e

Possible events for uart interrupt.

Todo:
replace this with enum no_os_irq_event
Enumerator
NO_OS_IRQ_WRITE_DONE 

Write operation finalized

NO_OS_IRQ_READ_DONE 

Read operation finalized

NO_OS_IRQ_ERROR 

An error occurred

Function Documentation

◆ no_os_irq_clear_pending()

int32_t no_os_irq_clear_pending ( struct no_os_irq_ctrl_desc desc,
uint32_t  irq_id 
)

Clear the pending interrupt.

Parameters
desc- The IRQ controller descriptor.
irq_id- Interrupt identifier.
Returns
0 in case of success, negative errno error codes.

◆ no_os_irq_ctrl_init()

int32_t no_os_irq_ctrl_init ( struct no_os_irq_ctrl_desc **  desc,
const struct no_os_irq_init_param param 
)

Initialize the IRQ interrupts.

Parameters
desc- The IRQ descriptor.
param- The structure that contains the IRQ parameters.
Returns
0 in case of success, -1 otherwise.
Here is the caller graph for this function:

◆ no_os_irq_ctrl_remove()

int32_t no_os_irq_ctrl_remove ( struct no_os_irq_ctrl_desc desc)

Free the resources allocated by no_os_irq_ctrl_init().

Parameters
desc- The SPI descriptor.
Returns
0 in case of success, -1 otherwise.
Here is the caller graph for this function:

◆ no_os_irq_disable()

int32_t no_os_irq_disable ( struct no_os_irq_ctrl_desc desc,
uint32_t  irq_id 
)

Disable specific interrupt.

Parameters
desc- The IRQ controller descriptor.
irq_id- Interrupt identifier.
Returns
0 in case of success, -1 otherwise.
Here is the caller graph for this function:

◆ no_os_irq_enable()

int32_t no_os_irq_enable ( struct no_os_irq_ctrl_desc desc,
uint32_t  irq_id 
)

Enable specific interrupt.

Parameters
desc- The IRQ controller descriptor.
irq_id- Interrupt identifier.
Returns
0 in case of success, -1 otherwise.
Here is the caller graph for this function:

◆ no_os_irq_global_disable()

int32_t no_os_irq_global_disable ( struct no_os_irq_ctrl_desc desc)

Disable global interrupts.

Returns
0 in case of success, -1 otherwise.
Here is the caller graph for this function:

◆ no_os_irq_global_enable()

int32_t no_os_irq_global_enable ( struct no_os_irq_ctrl_desc desc)

Enable global interrupts.

Returns
0 in case of success, -1 otherwise.
Here is the caller graph for this function:

◆ no_os_irq_register_callback()

int32_t no_os_irq_register_callback ( struct no_os_irq_ctrl_desc desc,
uint32_t  irq_id,
struct no_os_callback_desc callback 
)

Register a callback to handle the irq events.

Parameters
desc- The IRQ controller descriptor.
irq_id- Interrupt identifier.
callback- Callback descriptor - platform specific type.
Returns
SUCCESS in case of success, FAILURE otherwise.
Here is the caller graph for this function:

◆ no_os_irq_set_priority()

int32_t no_os_irq_set_priority ( struct no_os_irq_ctrl_desc desc,
uint32_t  irq_id,
uint32_t  priority_level 
)

Set the priority for an interrupt.

Set the priority level for a specific interrupt

Parameters
desc- The IRQ controller descriptor.
irq_id- Interrupt identifier.
priority_level- The priority level of the interrupt.
Returns
0 in case of success, negative errno error codes.
Here is the caller graph for this function:

◆ no_os_irq_trigger_level_set()

int32_t no_os_irq_trigger_level_set ( struct no_os_irq_ctrl_desc desc,
uint32_t  irq_id,
enum no_os_irq_trig_level  trig 
)

Set interrupt trigger level.

Parameters
desc- The IRQ controller descriptor.
irq_id- Interrupt identifier.
trig- New trigger level for the interrupt.
Returns
0 in case of success, -1 otherwise.
Here is the caller graph for this function:

◆ 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 
)

Unregisters a generic IRQ handling function.

Parameters
desc- The IRQ controller descriptor.
irq_id- Interrupt identifier.
callback- Callback descriptor - platform specific type.
Returns
SUCCESS in case of success, FAILURE otherwise.
Here is the caller graph for this function: