PebbleOS
Loading...
Searching...
No Matches
Macros | Typedefs | Functions
irq.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include <pbl_arch_irq.h>

Macros

#define PBL_IRQ_PRIO_KERNEL   CONFIG_KERNEL_IRQ_PRIO_KERNEL
 NVIC priority of the kernel's own interrupts (tick, context switch).
 
#define PBL_IRQ_PRIO_MAX_SYSCALL   CONFIG_KERNEL_IRQ_PRIO_MAX_SYSCALL
 Most urgent NVIC priority from which kernel calls are allowed.
 
#define PBL_IRQN(line)   ((pbl_irq_t)PBL_SOC_IRQN_##line)
 Number of a SoC interrupt line from soc_irqs.h.
 
#define PBL_IRQ_ZERO_LATENCY   (1U << 0)
 Flag for an ISR that runs above PBL_IRQ_PRIO_MAX_SYSCALL.
 
#define PBL_IRQ_CONNECT(line, prio, isr, arg, flags)    ARCH_IRQ_CONNECT(PBL_SOC_IRQN_##line, line##_IRQn, prio, isr, arg, flags)
 Bind a SoC interrupt line to a handler at build time.
 
#define PBL_IRQ_DIRECT(line, prio, flags)    ARCH_IRQ_DIRECT(PBL_SOC_IRQN_##line, line##_IRQn, prio, flags)
 Bind a SoC interrupt line to the handler body that follows the macro.
 

Typedefs

typedef uint16_t pbl_irq_t
 Line of the SoC interrupt controller.
 

Functions

void pbl_irq_lock (void)
 Mask interrupts up to PBL_IRQ_PRIO_MAX_SYSCALL.
 
void pbl_irq_unlock (void)
 Undo one pbl_irq_lock(), unmasking interrupts at the outermost one.
 
bool pbl_in_isr (void)
 Check whether the caller runs in interrupt context.
 
bool pbl_irq_is_locked (void)
 Check whether pbl_irq_lock() is in effect.
 
void pbl_irq_init (void)
 Install the vector table and program the priority of every bound line.
 
void pbl_irq_enable (pbl_irq_t irq)
 Enable an interrupt line.
 
void pbl_irq_disable (pbl_irq_t irq)
 Disable an interrupt line.
 
bool pbl_irq_is_enabled (pbl_irq_t irq)
 Check whether an interrupt line is enabled.
 
void pbl_irq_set_pending (pbl_irq_t irq)
 Mark an interrupt line pending, so its handler runs once enabled and unmasked.
 
void pbl_irq_clear_pending (pbl_irq_t irq)
 Clear the pending state of an interrupt line.