Zephyr API Documentation  3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
irq_multilevel.h File Reference

Public interface for multi-level interrupts. More...

Go to the source code of this file.

Macros

#define IRQ_TO_L2(irq)   ((irq + 1) << CONFIG_1ST_LEVEL_INTERRUPT_BITS)
 Preprocessor macro to convert irq from level 1 to level 2 format.
 
#define IRQ_TO_L3(irq)    ((irq + 1) << (CONFIG_1ST_LEVEL_INTERRUPT_BITS + CONFIG_2ND_LEVEL_INTERRUPT_BITS))
 Preprocessor macro to convert irq from level 1 to level 3 format.
 

Functions

static unsigned int irq_get_level (unsigned int irq)
 Return IRQ level This routine returns the interrupt level number of the provided interrupt.
 
static unsigned int irq_from_level_2 (unsigned int irq)
 Return the 2nd level interrupt number.
 
static unsigned int irq_to_level_2 (unsigned int irq)
 Converts irq from level 1 to level 2 format.
 
static unsigned int irq_parent_level_2 (unsigned int irq)
 Returns the parent IRQ of the level 2 raw IRQ number.
 
static unsigned int irq_from_level_3 (unsigned int irq)
 Return the 3rd level interrupt number.
 
static unsigned int irq_to_level_3 (unsigned int irq)
 Converts irq from level 1 to level 3 format.
 
static unsigned int irq_parent_level_3 (unsigned int irq)
 Returns the parent IRQ of the level 3 raw IRQ number.
 
static unsigned int irq_from_level (unsigned int irq, unsigned int level)
 Return the interrupt number for a given level.
 
static unsigned int irq_to_level (unsigned int irq, unsigned int level)
 Converts irq from level 1 to a given level.
 
static unsigned int irq_parent_level (unsigned int irq, unsigned int level)
 Returns the parent IRQ of the given level raw IRQ number.
 
static unsigned int irq_get_intc_irq (unsigned int irq)
 Returns the parent interrupt controller IRQ of the given IRQ number.
 

Detailed Description

Public interface for multi-level interrupts.

Macro Definition Documentation

◆ IRQ_TO_L2

#define IRQ_TO_L2 (   irq)    ((irq + 1) << CONFIG_1ST_LEVEL_INTERRUPT_BITS)

Preprocessor macro to convert irq from level 1 to level 2 format.

Parameters
irqIRQ number in its zephyr format
Returns
2nd level IRQ number

◆ IRQ_TO_L3

#define IRQ_TO_L3 (   irq)     ((irq + 1) << (CONFIG_1ST_LEVEL_INTERRUPT_BITS + CONFIG_2ND_LEVEL_INTERRUPT_BITS))

Preprocessor macro to convert irq from level 1 to level 3 format.

Parameters
irqIRQ number in its zephyr format
Returns
3rd level IRQ number

Function Documentation

◆ irq_from_level()

static unsigned int irq_from_level ( unsigned int  irq,
unsigned int  level 
)
inlinestatic

Return the interrupt number for a given level.

Parameters
irqIRQ number in its zephyr format
levelIRQ level
Returns
IRQ number in the level

◆ irq_from_level_2()

static unsigned int irq_from_level_2 ( unsigned int  irq)
inlinestatic

Return the 2nd level interrupt number.

This routine returns the second level irq number of the zephyr irq number passed in

Parameters
irqIRQ number in its zephyr format
Returns
2nd level IRQ number

◆ irq_from_level_3()

static unsigned int irq_from_level_3 ( unsigned int  irq)
inlinestatic

Return the 3rd level interrupt number.

This routine returns the third level irq number of the zephyr irq number passed in

Parameters
irqIRQ number in its zephyr format
Returns
3rd level IRQ number

◆ irq_get_intc_irq()

static unsigned int irq_get_intc_irq ( unsigned int  irq)
inlinestatic

Returns the parent interrupt controller IRQ of the given IRQ number.

Parameters
irqIRQ number in its zephyr format
Returns
IRQ of the interrupt controller

◆ irq_get_level()

static unsigned int irq_get_level ( unsigned int  irq)
inlinestatic

Return IRQ level This routine returns the interrupt level number of the provided interrupt.

Parameters
irqIRQ number in its zephyr format
Returns
1 if IRQ level 1, 2 if IRQ level 2, 3 if IRQ level 3

◆ irq_parent_level()

static unsigned int irq_parent_level ( unsigned int  irq,
unsigned int  level 
)
inlinestatic

Returns the parent IRQ of the given level raw IRQ number.

Parameters
irqIRQ number in its zephyr format
levelIRQ level
Returns
IRQ parent of the given level

◆ irq_parent_level_2()

static unsigned int irq_parent_level_2 ( unsigned int  irq)
inlinestatic

Returns the parent IRQ of the level 2 raw IRQ number.

The parent of a 2nd level interrupt is in the 1st byte

Parameters
irqIRQ number in its zephyr format
Returns
2nd level IRQ parent

◆ irq_parent_level_3()

static unsigned int irq_parent_level_3 ( unsigned int  irq)
inlinestatic

Returns the parent IRQ of the level 3 raw IRQ number.

The parent of a 3rd level interrupt is in the 2nd byte

Parameters
irqIRQ number in its zephyr format
Returns
3rd level IRQ parent

◆ irq_to_level()

static unsigned int irq_to_level ( unsigned int  irq,
unsigned int  level 
)
inlinestatic

Converts irq from level 1 to a given level.

Parameters
irqIRQ number in its zephyr format
levelIRQ level
Returns
Converted IRQ number in the level

◆ irq_to_level_2()

static unsigned int irq_to_level_2 ( unsigned int  irq)
inlinestatic

Converts irq from level 1 to level 2 format.

This routine converts the input into the level 2 irq number format

Note
Values >= 0xFF are invalid
Parameters
irqIRQ number in its zephyr format
Returns
2nd level IRQ number

◆ irq_to_level_3()

static unsigned int irq_to_level_3 ( unsigned int  irq)
inlinestatic

Converts irq from level 1 to level 3 format.

This routine converts the input into the level 3 irq number format

Note
Values >= 0xFF are invalid
Parameters
irqIRQ number in its zephyr format
Returns
3rd level IRQ number