avr-classes
Static Public Member Functions | List of all members
GlobalInterruptFlag Class Reference

#include <globalinterruptflag.h>

Static Public Member Functions

static void set (void)
 
static uint8_t clear (void)
 
static bool isSet (void)
 
static void restore (uint8_t sreg)
 

Detailed Description

Helper class for managing the global interrupt flag.

Member Function Documentation

◆ clear()

uint8_t GlobalInterruptFlag::clear ( void  )
static

Clears the global interrupt flag and returns the previous value of the SREG register.

Returns
Value of SREG before clearing the global interrupt flag.

◆ isSet()

bool GlobalInterruptFlag::isSet ( void  )
static

Returns true if global interrupt flag is set.

Returns
True if global interrupt flag is set, false otherwise.

◆ restore()

void GlobalInterruptFlag::restore ( uint8_t  sreg)
static

Restore old state of global interrupt flag using previously stored SREG value.

Parameters
sregSREG value to restore global interrupt flag from

◆ set()

void GlobalInterruptFlag::set ( void  )
static

Sets the global interrupt flag, independent from previous state.