52 #include <avr/interrupt.h> 54 typedef uint8_t irqflags_t;
56 static inline irqflags_t cpu_irq_save(
void)
58 irqflags_t flags = SREG;
63 static inline void cpu_irq_restore(irqflags_t flags)
69 static inline bool cpu_irq_is_enabled_flags(irqflags_t flags)
72 return flags & CPU_I_bm;
168 return PMIC.CTRL & level;
191 return PMIC.STATUS & level;
208 PMIC.CTRL &= ~PMIC_RREN_bm;
213 PMIC.CTRL |= PMIC_RREN_bm;
228 uint8_t ctrl = PMIC.CTRL;
234 ctrl &= ~PMIC_IVSEL_bm;
238 ctrl |= PMIC_IVSEL_bm;
static enum pmic_level pmic_get_enabled_levels(void)
Get currently enabled level(s)
pmic_schedule
Interrupt scheduling schemes.
static void pmic_init(void)
Initialize the PMIC.
Commonly used includes, types and macros.
#define Assert(expr)
This macro is used to test fatal errors.
static void pmic_set_vector_location(enum pmic_vector vector)
Set location of interrupt vectors.
Number of interrupt scheduling schemes.
static bool pmic_level_is_enabled(enum pmic_level level)
Check if specified interrupt level(s) is enabled.
Default, fixed priority scheduling.
static void pmic_set_scheduling(enum pmic_schedule schedule)
Set interrupt scheduling for low-level interrupts.
pmic_level
Interrupt level bitmasks.
static void pmic_disable_level(enum pmic_level level)
Disable interrupts with specified level(s).
#define barrier()
Memory barrier.
static void pmic_enable_level(enum pmic_level level)
Enable interrupts with specified level(s).
static bool pmic_level_is_executing(enum pmic_level level)
Check if an interrupt level(s) is currently executing.
pmic_vector
Interrupt vector locations.
Number of interrupt vector locations.