arch/avr8/include/arch/interrupt.h File Reference

AVR-specific interrupt masking/unmasking. More...

#include <compiler.h>
#include <cpu/regs.h>
#include <types.h>

Go to the source code of this file.

Defines

#define cpu_irq_is_enabled()   cpu_irq_is_enabled_flags(cpu_read_reg8(SREG))
 Test if interrupts are enabled.

Typedefs

typedef uint8_t irqflags_t
 Type used for holding the current interrupt state.

Functions

static __always_inline irqflags_t cpu_irq_save (void)
 Save the current interrupt state and disable interrupts.
static __always_inline void cpu_irq_restore (irqflags_t flags)
 Restore saved interrupt state.
static __always_inline bool cpu_irq_is_enabled_flags (irqflags_t flags)
 Test if interrupts are enabled in flags.

Detailed Description

AVR-specific interrupt masking/unmasking.

Copyright (C) 2009 Atmel Corporation. All rights reserved.

Definition in file interrupt.h.


Define Documentation

 
#define cpu_irq_is_enabled (  )     cpu_irq_is_enabled_flags(cpu_read_reg8(SREG))

Test if interrupts are enabled.

Return values:
true If interrups are enabled
false If interrupts are disabled

Definition at line 91 of file interrupt.h.


Typedef Documentation

Type used for holding the current interrupt state.

Definition at line 48 of file interrupt.h.


Function Documentation

static __always_inline bool cpu_irq_is_enabled_flags ( irqflags_t  flags  )  [static]

Test if interrupts are enabled in flags.

Parameters:
flags Saved interrupt state
Return values:
true If flags indicates interrups are enabled
false If flags indicates interrupts are disabled

Definition at line 81 of file interrupt.h.

References CPUR_SREG_I.

static __always_inline void cpu_irq_restore ( irqflags_t  flags  )  [static]

Restore saved interrupt state.

Parameters:
flags A cookie returned by cpu_irq_save()

Definition at line 69 of file interrupt.h.

References barrier, and cpu_write_reg8.

Referenced by atomic_add(), atomic_clear_bit(), atomic_set_bit(), atomic_sub(), atomic_test_and_clear_bit(), atomic_test_and_set_bit(), and atomic_toggle_bit().

static __always_inline irqflags_t cpu_irq_save ( void   )  [static]

Save the current interrupt state and disable interrupts.

Returns:
A cookie indicating the interrupt state before interrupts were disabled.

Definition at line 55 of file interrupt.h.

References cpu_irq_disable, and cpu_read_reg8.

Referenced by atomic_add(), atomic_clear_bit(), atomic_set_bit(), atomic_sub(), atomic_test_and_clear_bit(), atomic_test_and_set_bit(), and atomic_toggle_bit().

Generated on Thu Apr 29 14:09:42 2010 for uart-loopback by  doxygen 1.6.3