theCore C++ embedded framework
ecl::irq Namespace Reference

Typedefs

using handler_type = std::function< void()>
 

Functions

void init_storage ()
 Initializes storage for callbacks and setups default handler for every IRQ. More...
 
void subscribe (irq_num irqn, const irq::handler_type &handler)
 Subscribes to the given IRQ. More...
 
void unsubscribe (irq_num irqn)
 Unsubscribes from the given IRQ. More...
 
static void mask (irq_num irqn)
 Masks or disables the given IRQ. More...
 
static void unmask (irq_num irqn)
 Unmasks or enables the given IRQ. More...
 
static irq_num get_current_irqn ()
 Gets current IRQ number. More...
 
static bool in_isr ()
 Checks if a processor is in handler mode of execution at this time. More...
 
static void disable ()
 Disables interrupts globally. More...
 
static void enable ()
 Enables interrupts globally. More...
 
static void clear (irq_num irqn)
 Clears pending interrupt of the given IRQ. More...
 
static void mask (irq_num irqn)
 Masks or disables the given IRQ. More...
 
static void unmask (irq_num irqn)
 Unmasks or enables the given IRQ. More...
 
static irq_num get_current_irqn ()
 Gets current IRQ number. More...
 
static bool in_isr ()
 Checks if a processor is in handler mode of execution at this time. More...
 
static void disable ()
 Disables interrupts globally. More...
 
static void enable ()
 Enables interrupts globally. More...
 
static void clear (irq_num irqn)
 Clears pending interrupt of the given IRQ. More...
 
static void mask (irq_num irqn)
 Masks or disables the given IRQ. More...
 
static void unmask (irq_num irqn)
 Unmasks or enables the given IRQ. More...
 
static irq_num get_current_irqn ()
 Gets current IRQ number. More...
 
static bool in_isr ()
 Checks if a processor is in handler mode of execution at this time. More...
 
static void disable ()
 Disables interrupts globally. More...
 
static void enable ()
 Enables interrupts globally. More...
 
static void clear (irq_num irqn)
 Clears pending interrupt of the given IRQ. More...
 

Typedef Documentation

◆ handler_type

using ecl::irq::handler_type = typedef std::function<void()>

Function Documentation

◆ init_storage()

void ecl::irq::init_storage ( )

Initializes storage for callbacks and setups default handler for every IRQ.

Here is the call graph for this function:

◆ subscribe()

void ecl::irq::subscribe ( irq_num  irqn,
const irq::handler_type handler 
)

Subscribes to the given IRQ.

Parameters
[in]irqnValid IRQ number.
[in]handlerNew IRQ handler for given IRQ.
Here is the call graph for this function:

◆ unsubscribe()

void ecl::irq::unsubscribe ( irq_num  irqn)

Unsubscribes from the given IRQ.

Default handler will be used for given IRQ if this call succeed.

Parameters
[in]irqnValid IRQ number.
Here is the call graph for this function:

◆ mask()

static void ecl::irq::mask ( irq_num  irqn)
inlinestatic

Masks or disables the given IRQ.

Parameters
[in]irqnValid IRQ number.

◆ unmask()

static void ecl::irq::unmask ( irq_num  irqn)
inlinestatic

Unmasks or enables the given IRQ.

Parameters
[in]irqnValid IRQ number.

◆ get_current_irqn()

static irq_num ecl::irq::get_current_irqn ( )
inlinestatic

Gets current IRQ number.

Warning
Results are unspecified if called not within IRQ context.
Returns
Current IRQ number

◆ in_isr()

static bool ecl::irq::in_isr ( )
inlinestatic

Checks if a processor is in handler mode of execution at this time.

Return values
trueProcessor is in handler mode. I.e. servicing IRQ or exception.
falseProcessor is in thread mode.

◆ disable()

static void ecl::irq::disable ( )
inlinestatic

Disables interrupts globally.

◆ enable()

static void ecl::irq::enable ( )
inlinestatic

Enables interrupts globally.

◆ clear()

static void ecl::irq::clear ( irq_num  irqn)
inlinestatic

Clears pending interrupt of the given IRQ.

Parameters
[in]irqnValid IRQ number.