Loading...
Searching...
No Matches
irq_arch.h File Reference

Implementation of the kernels irq interface. More...

Detailed Description

#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include "cpu.h"
+ Include dependency graph for irq_arch.h:

Go to the source code of this file.

#define AVR8_ISR(vector, function, ...)
 Define an AVR-8 ISR.
 
static unsigned int irq_disable (void)
 Disable all maskable interrupts.
 
static unsigned int irq_enable (void)
 Enable all maskable interrupts.
 
static void irq_restore (unsigned int _state)
 Restore the state of the IRQ flags.
 
static bool irq_is_in (void)
 See if the current context is inside an ISR.
 
static bool irq_is_enabled (void)
 Test if interrupts are currently enabled.
 

Macro Definition Documentation

◆ AVR8_ISR

#define AVR8_ISR (   vector,
  function,
  ... 
)
Value:
ISR(vector, ISR_BLOCK) \
{ \
avr8_enter_isr(); \
function(__VA_ARGS__); \
avr8_exit_isr(); \
}
#define ISR(a, b)
Macro for defining interrupt service routines.
Definition cpu.h:42

Define an AVR-8 ISR.

This macro hides all RIOT-OS port internal details from user implementation. The user should use this macro passing at least two parameters. The first is the interrupt vector and the second one is the function to be called. Zero or more optional parameters can be passed the function one by one using the variable length argument list.

It is recommended that user define a static inline void function to the implement the interrupt. The function can accept argument list based on implementation details.

Example:

static inline void _my_isr_handler(int index)
{
do_something(index);
}
AVR8_ISR(PERIPHERAL_INSTANCE_0_ISR, _my_isr_handler, 0);
#define AVR8_ISR(vector, function,...)
Define an AVR-8 ISR.
Definition irq_arch.h:148

Definition at line 148 of file irq_arch.h.

Function Documentation

◆ irq_disable()

static unsigned int irq_disable ( void  )
inlinestatic

Disable all maskable interrupts.

Definition at line 43 of file irq_arch.h.

◆ irq_enable()

static unsigned int irq_enable ( void  )
inlinestatic

Enable all maskable interrupts.

Definition at line 59 of file irq_arch.h.

◆ irq_is_enabled()

static bool irq_is_enabled ( void  )
inlinestatic

Test if interrupts are currently enabled.

Definition at line 113 of file irq_arch.h.

◆ irq_is_in()

static bool irq_is_in ( void  )
inlinestatic

See if the current context is inside an ISR.

Definition at line 101 of file irq_arch.h.

◆ irq_restore()

static void irq_restore ( unsigned int  _state)
inlinestatic

Restore the state of the IRQ flags.

Definition at line 75 of file irq_arch.h.