PebbleOS v4.48.0-75-g7416f78a1
Loading...
Searching...
No Matches
intc.h File Reference
#include <stdint.h>
#include <pbl/device.h>
#include <pbl/util/math.h>
#include <pbl/util/size.h>

Data Structures

struct  pbl_irq_spec
 An interrupt line, as used by a consumer. More...
 

Macros

#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.
 
int pbl_intc_set_wake (const struct pbl_irq_spec *spec, uint32_t type)
 Let a requested line wake the system from power-off, or stop it.
 
int pbl_intc_trigger (const struct pbl_irq_spec *spec)
 Raise a requested line by software, as if the device behind it had.