device/irq.h header reference
[Devices support library module]

The source code of this header can be browsed online.

Description [link] 

Device interrupts graph

Members [link] 

Types [link] 

Functions [link] 

Macros [link] 

Members detail [link] 

#define DEV_IRQ_SINK_UPDATE(n) [link] 

This macro is declared in device/irq.h source file, line 122.

See also dev_irq_sink_update_t.

#define DEV_IRQ_SRC_PROCESS(n) [link] 

This macro is declared in device/irq.h source file, line 90.

See also dev_irq_src_process_t.

#define DEV_STATIC_RES_DEV_ICU(path_) [link] 

This macro is declared in device/irq.h source file, line 334.

This macro provides a DEV_RES_DEV_PARAM resource entry which specifies the interrupts controller device relevant for some DEV_RES_IRQ entries.

Preprocessor condition: defined( CONFIG_DEVICE_IRQ )

#define DEV_STATIC_RES_DEV_ICU(path_) [link] 

This macro is declared in device/irq.h source file, line 344.

Documentation from alternate declaration:

This macro provides a DEV_RES_DEV_PARAM resource entry which specifies the interrupts controller device relevant for some DEV_RES_IRQ entries.

Preprocessor condition: not defined( CONFIG_DEVICE_IRQ )

#define DEV_STATIC_RES_IRQ(src_id_, sink_id_, trig_mode_, irq_id_, route_mask_) [link] 

This macro is declared in device/irq.h source file, line 319.

This macro specifies an irq resource entry in a static device resources table declaration. .

Preprocessor condition: defined( CONFIG_DEVICE_IRQ )

See also device_res_add_irq, DEV_RES_IRQ and DEV_DECLARE_STATIC.

#define DEV_STATIC_RES_IRQ(src_id_, sink_id_, trig_mode_, irq_id_, route_mask_) [link] 

This macro is declared in device/irq.h source file, line 338.

Documentation from alternate declaration:

This macro specifies an irq resource entry in a static device resources table declaration. .

Preprocessor condition: not defined( CONFIG_DEVICE_IRQ )

See also device_res_add_irq, DEV_RES_IRQ and DEV_DECLARE_STATIC.

#define __DEVICE_IRQ_H__ [link] 

This macro is declared in device/irq.h source file, line 29.

struct dev_irq_ep_s [link] 

This struct is declared in device/class/icu.h source file, line 44.

Device irq endpoint object. Irq endpoints are linked together to make irqs topology graph

FieldDescription
struct device_s * dev;
union <anonymous> {
struct dev_irq_ep_s * single;Single link case
struct dev_irq_ep_s ** array;Multiple links case
} links;
uint8_t link_count;Number of links

typedef uint8_t dev_irq_id_t [link] 

This typedef is declared in device/irq.h source file, line 45.

typedef uint32_t dev_irq_route_t [link] 

This typedef is declared in device/irq.h source file, line 44.

Irq affinity mask

See also dev_icu_link_t.

enum dev_irq_sense_modes_e [link] 

This enum is declared in device/irq.h source file, line 48.

IdentifierDescription
DEV_IRQ_SENSE_NONEIRQ is disabled
DEV_IRQ_SENSE_ID_BUSIRQ number transmitted over a dedicated bus. When multiple logical interrupts are multiplexed on the same endpoint, the id parameter of the dev_irq_src_process_t function indicates the logocal id of the triggered interrupt.
DEV_IRQ_SENSE_HIGH_LEVELLevel triggered irq line, active on logic high.
DEV_IRQ_SENSE_LOW_LEVELLevel triggered irq line, active on logic low.
DEV_IRQ_SENSE_RISING_EDGERising edge triggered irq line, sampled on clock edge.
DEV_IRQ_SENSE_FALLING_EDGEFalling edge triggered irq line, sampled on clock edge.
DEV_IRQ_SENSE_ANY_EDGERising or falling edge triggered irq line, sampled on clock edge. The id parameter of the dev_irq_src_process_t function indicates the edge polarity.

struct dev_irq_sink_s [link] 

This struct is declared in device/irq.h source file, line 137.

Device irq sink endpoint. Sink endpoints are stored in interrupt controllers device private data and can be accessed by calling the dev_icu_get_sink_t function.

FieldDescription
struct dev_irq_ep_s base;
uint8_t sense_all;Mask of irq sense modes supported by the interrrupt controller hardware.
uint8_t sense_link;Mask of irq sense modes supported by both: the interrrupt controller and the linked interrupt source devices. This field is updated by the device_irq_source_link function.
uint8_t icu_pv;Interrupt controller private flags.
dev_irq_sink_update_t * update;

struct dev_irq_ep_s * dev_irq_sink_s_base(struct dev_irq_sink_s *x) [link] 

This function is declared in device/irq.h source file, line 155.

struct dev_irq_sink_s * dev_irq_sink_s_cast(struct dev_irq_ep_s *x) [link] 

This function is declared in device/irq.h source file, line 155.

typedef void (dev_irq_sink_update_t)(struct dev_irq_sink_s *sink, enum dev_irq_sense_modes_e sense, dev_irq_id_t irq_id) [link] 

This typedef is declared in device/irq.h source file, line 131.

This typedef updates the interrupt sense mode of a sink endpoint. It is implemented by the driver of the interrupt controller. This function should not be called directly. .

This declaration involves expansion of the DEV_IRQ_SINK_UPDATE macro.

See also device_irq_src_update, device_irq_src_enable and device_irq_src_disable.

typedef void (dev_irq_src_process_t)(struct dev_irq_src_s *ep, dev_irq_id_t id) [link] 

This typedef is declared in device/irq.h source file, line 102.

This typedef is the interrupt endpoint processing function. It is implemented by device drivers to handle interrupts. It is called from the device_irq_sink_process function in interrupt controller code.

The meaning of the id parameter depends on the sense mode specified by enum dev_irq_sense_modes_e.

This declaration involves expansion of the DEV_IRQ_SRC_PROCESS macro.

struct dev_irq_src_s [link] 

This struct is declared in device/irq.h source file, line 106.

Device irq source endpoint of device generating interrupts.

FieldDescription
struct dev_irq_ep_s base;
uint8_t trig_mode;Current irq trigger mode configured on linked sink endpoints.
dev_irq_id_t irq_id;Logical id of interrupt, valid when trig_mode is DEV_IRQ_SENSE_ID_BUS
dev_irq_src_process_t * process;Irq event handling function for source endpoint

struct dev_irq_ep_s * dev_irq_src_s_base(struct dev_irq_src_s *x) [link] 

This function is declared in device/irq.h source file, line 119.

struct dev_irq_src_s * dev_irq_src_s_cast(struct dev_irq_ep_s *x) [link] 

This function is declared in device/irq.h source file, line 119.

void device_irq_modes(struct dev_irq_src_s *src, enum dev_irq_sense_modes_e *cur, enum dev_irq_sense_modes_e *modes) [link] 

This function is declared in device/irq.h source file, line 228.

This function function returns the current trigger mode of the source endpoint and the sense modes supported by the linked sink endpoint. If the source-end point is not linked, 0 is returned in *modes. Either pointers may be NULL.

This is available when CONFIG_DEVICE_IRQ is defined.

void device_irq_sink_init(struct device_s *dev, struct dev_irq_sink_s *sinks, uint_fast8_t count, dev_irq_sink_update_t *update, enum dev_irq_sense_modes_e sense_mask) [link] 

This function is declared in device/irq.h source file, line 192.

This function initializes an array of device interrupt sink endpoints. This is called from the interrupt controller initialization function. The drivers must provide a function which is able to update the interrupt sense mode according to the value of sense_mask.

This is available when CONFIG_DEVICE_IRQ is defined.

void device_irq_sink_process(struct dev_irq_sink_s *sink, dev_irq_id_t id) [link] 

This function is declared in device/irq.h source file, line 240.

This function is called from the interrupt controller code to forward an irq to all source endpoints connected to one of the controller sink endpoint.

void device_irq_source_init(struct device_s *dev, struct dev_irq_src_s *sources, uint_fast8_t count, dev_irq_src_process_t *process) [link] 

This function is declared in device/irq.h source file, line 182.

This function initializes an array of interrupt source endpoints. This is called from the device driver initialization function. The device drivers must provide a function which implement the source endpoint irq handler.

This is available when CONFIG_DEVICE_IRQ is defined.

error_t device_irq_source_link(struct device_s *dev, struct dev_irq_src_s *sources, uint_fast8_t count, uint32_t enable_mask) [link] 

This function is declared in device/irq.h source file, line 219.

This function links device interrupt source endpoints to appropriate sink endpoints of interrupt controllers as described in device resources. This function is usually called from the device driver initialization function passing an array of source endpoints allocated in the private driver data for the device.

The enable mask specifies which source endpoint must have its sense mode updated. When an interrupt is shared, the interrupt may have been enabled previously. When calling this function, the device driver must be ready to handle interrupts.

If multiple trigger modes are specified in the device resource entry, a single mode is retained. The device_irq_src_enable and device_irq_src_disable function can be used provided that the interrupt is not shared.

If the DEV_IRQ_SENSE_NONE trigger mode is specified in the device resource entry, the sense mode can be updated later by calling the device_irq_src_update function.

In any case, the device driver can test the current mode of endpoint by calling the device_irq_modes function.

This is available when CONFIG_DEVICE_IRQ is defined.

void device_irq_source_unlink(struct device_s *dev, struct dev_irq_src_s *sources, uint_fast8_t count) [link] 

This function is declared in device/irq.h source file, line 234.

This function unlink device interrupt endpoints. This function is usually called from the device driver cleanup function, passing an array of source endpoints allocated in the private driver data.

This is available when CONFIG_DEVICE_IRQ is defined.

error_t device_irq_src_disable(struct dev_irq_src_s *src) [link] 

This function is declared in device/irq.h source file, line 172.

This function disables the IRQ sensing of all linked sink endpoints. The IRQ can not be shared.

error_t device_irq_src_enable(struct dev_irq_src_s *src) [link] 

This function is declared in device/irq.h source file, line 167.

This function enables the IRQ sensing of all linked sink endpoints. This can be used when at least one valid trigger mode has been specified for the source endpoint in the device resources. The IRQ can not be shared.

error_t device_irq_src_update(struct dev_irq_src_s *src, enum dev_irq_sense_modes_e trig_mode) [link] 

This function is declared in device/irq.h source file, line 161.

This function updates the sense mode of all sink endpoints linked to the given source endpoint. This can be used when the trigger mode of the source endpoint in the device resources has been declared as DEV_IRQ_SENSE_NONE. In this case the irq can not be shared.

error_t device_res_add_irq(struct device_s *dev, uint_fast8_t src_id, uint_fast8_t sink_id, enum dev_irq_sense_modes_e trig_mode, dev_irq_id_t irq_id, dev_irq_route_t route_mask) [link] 

This function is declared in device/irq.h source file, line 314.

This function adds an IRQ binding to the device resources list.

An interrupt controller device path must be specifed in a previous DEV_RES_DEV_PARAM resource named icu. The device path is relative to the device owning the resource entry.

This entry specifies how an output irq wire (source) of the device is connected to an input (sink) of the interrupt controller. This is used to connect software irq endpoints of the two device drivers.

A mask of irq trigger modes supported by the source is specified. When the linking occurs, a single mode will be selected based on what is supported by both the sink and the source endpoints. If zero is used here, no particular mode will be configured and the driver will be responsible for updating the sense mode of the sink.

When the trigger mode is DEV_IRQ_SENSE_ID_BUS, the logical irq number associated to the device on the irq bus must be given in irq_id_ . Zero is used if the hardware irq link is a single wire.

For interrupt controllers with multiple source endpoints, irq routing must be configured. A single output is used when the irq is triggered. Which source endpoint is actually selected may be choosen statically or dynamically by the implementation among allowed routes defined by the route mask parameter.

In order to have the same irq forwarded to multiple controllers simultaneously, the CONFIG_DEVICE_IRQ_MULTI_SINK token must be defined and multiple irq resource entries must be provided.

In order to connect multiple interrupts wires to the same controller input, the CONFIG_DEVICE_IRQ_SHARING token must be defined.

This is available when CONFIG_DEVICE_IRQ and CONFIG_DEVICE_RESOURCE_ALLOC are both defined.

See also DEV_RES_IRQ.

Valid XHTML 1.0 StrictGenerated by diaxen on Thu Aug 4 15:44:06 2022 using MkDoc