IRQ Handling

Provides an API to control interrupt processing. More...

Detailed Description

Provides an API to control interrupt processing.

Files

file  irq.h
 IRQ driver interface.
 

Functions

MAYBE_INLINE unsigned irq_disable (void)
 This function sets the IRQ disable bit in the status register. More...
 
MAYBE_INLINE unsigned irq_enable (void)
 This function clears the IRQ disable bit in the status register. More...
 
MAYBE_INLINE void irq_restore (unsigned state)
 This function restores the IRQ disable bit in the status register to the value contained within passed state. More...
 
MAYBE_INLINE int irq_is_enabled (void)
 Test if IRQs are currently enabled. More...
 
MAYBE_INLINE int irq_is_in (void)
 Check whether called from interrupt service routine. More...
 

Function Documentation

◆ irq_disable()

MAYBE_INLINE unsigned irq_disable ( void  )

This function sets the IRQ disable bit in the status register.

Returns
Previous value of status register. The return value should not be interpreted as a boolean value. The actual value is only significant for irq_restore().
See also
irq_restore

◆ irq_enable()

MAYBE_INLINE unsigned irq_enable ( void  )

This function clears the IRQ disable bit in the status register.

Returns
Previous value of status register. The return value should not be interpreted as a boolean value. The actual value is only significant for irq_restore().
See also
irq_restore

◆ irq_is_enabled()

MAYBE_INLINE int irq_is_enabled ( void  )

Test if IRQs are currently enabled.

Warning
Use this function from thread context only. When used in interrupt context the returned state may be incorrect.
Returns
0 (false) if IRQs are currently disabled
!= 0 (true) if IRQs are currently enabled

◆ irq_is_in()

MAYBE_INLINE int irq_is_in ( void  )

Check whether called from interrupt service routine.

Returns
true, if in interrupt service routine, false if not

◆ irq_restore()

MAYBE_INLINE void irq_restore ( unsigned  state)

This function restores the IRQ disable bit in the status register to the value contained within passed state.

Parameters
[in]statestate to restore
See also
irq_enable
irq_disable