PebbleOS
Loading...
Searching...
No Matches
intc.h File Reference
#include <stdint.h>
#include <pbl/device.h>
#include <pbl/util/size.h>

Data Structures

struct  pbl_intc_ops
 Interrupt controller driver operations, called with interrupts locked. More...
 
struct  pbl_intc_line
 Runtime state of a line. More...
 
struct  pbl_intc
 An interrupt controller. More...
 
struct  pbl_irq_spec
 An interrupt line, as used by a consumer. More...
 

Macros

#define PBL_INTC_STATE_DEFINE(sym, _num_irqs)
 Define the class state of interrupt controller sym, for the driver's define macro.
 
#define PBL_INTC_INIT(sym, _name, _init, _parent, _ops)
 Initializer for the struct pbl_intc of controller sym.
 
#define PBL_IRQ_SPEC(_intc, _hwirq, _type)   {.intc = (_intc), .hwirq = (_hwirq), .type = (_type)}
 Initializer for a struct pbl_irq_spec.
 
Trigger types

Physical trigger of a line, as wired on the board.

#define PBL_IRQ_TYPE_EDGE_RISING   1U
 Rising edge.
 
#define PBL_IRQ_TYPE_EDGE_FALLING   2U
 Falling edge.
 
#define PBL_IRQ_TYPE_EDGE_BOTH   (PBL_IRQ_TYPE_EDGE_RISING | PBL_IRQ_TYPE_EDGE_FALLING)
 Both edges.
 
#define PBL_IRQ_TYPE_LEVEL_HIGH   4U
 High level.
 
#define PBL_IRQ_TYPE_LEVEL_LOW   8U
 Low level.
 

Typedefs

typedef void(* pbl_intc_handler_t) (void *arg)
 Line handler, called in ISR context.
 

Functions

static bool pbl_irq_spec_is_connected (const struct pbl_irq_spec *spec)
 Check whether an interrupt line is connected.
 
int pbl_intc_request (const struct pbl_irq_spec *spec, pbl_intc_handler_t handler, void *arg)
 Install the handler of a line and set its trigger type.
 
int pbl_intc_free (const struct pbl_irq_spec *spec)
 Disable a line and remove its handler.
 
int pbl_intc_enable (const struct pbl_irq_spec *spec)
 Enable a requested line.
 
int pbl_intc_disable (const struct pbl_irq_spec *spec)
 Disable a requested line.
 
void pbl_intc_dispatch (const struct pbl_intc *intc, uint32_t hwirq)
 Run the handler of a pending line, for the controller driver.
 

Variables

const struct pbl_device_class pbl_intc_class
 Class of the interrupt controllers.