LUFA Library  130901
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages

Convenience macros for the management of interrupts globally within the device. More...

Macros

#define ISR(Name,...)   void Name (void) __attribute__((__interrupt__)) __VA_ARGS__; void Name (void)
 

Functions

static uint_reg_t GetGlobalInterruptMask (void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT
 
static void GlobalInterruptDisable (void) ATTR_ALWAYS_INLINE
 
static void GlobalInterruptEnable (void) ATTR_ALWAYS_INLINE
 
static void SetGlobalInterruptMask (const uint_reg_t GlobalIntState) ATTR_ALWAYS_INLINE
 

Detailed Description

Macros and functions to create and control global interrupts within the device.

Macro Definition Documentation

#define ISR (   Name,
  ... 
)    void Name (void) __attribute__((__interrupt__)) __VA_ARGS__; void Name (void)

Macro for the definition of interrupt service routines, so that the compiler can insert the required prologue and epilogue code to properly manage the interrupt routine without affecting the main thread's state with unintentional side-effects.

Interrupt handlers written using this macro may still need to be registered with the microcontroller's Interrupt Controller (if present) before they will properly handle incoming interrupt events.

Note
This macro is only supplied on some architectures, where the standard library does not include a valid definition. If an existing definition exists, the alternative definition here will be ignored.
Parameters
[in]NameUnique name of the interrupt service routine.

Function Documentation

static uint_reg_t GetGlobalInterruptMask ( void  )
inlinestatic

Retrieves a mask which contains the current state of the global interrupts for the device. This value can be stored before altering the global interrupt enable state, before restoring the flag(s) back to their previous values after a critical section using SetGlobalInterruptMask().

Returns
Mask containing the current Global Interrupt Enable Mask bit(s).
static void GlobalInterruptDisable ( void  )
inlinestatic

Disabled global interrupt handling for the device, preventing interrupts from being handled.

static void GlobalInterruptEnable ( void  )
inlinestatic

Enables global interrupt handling for the device, allowing interrupts to be handled.

static void SetGlobalInterruptMask ( const uint_reg_t  GlobalIntState)
inlinestatic

Sets the global interrupt enable state of the microcontroller to the mask passed into the function. This can be combined with GetGlobalInterruptMask() to save and restore the Global Interrupt Enable Mask bit(s) of the device after a critical section has completed.

Parameters
[in]GlobalIntStateGlobal Interrupt Enable Mask value to use