Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
|
Macros | |
#define | DT_NUM_IRQS(node_id) |
Get the number of interrupt sources for the node. | |
#define | DT_NUM_NODELABELS(node_id) |
Get the number of node labels that a node has. | |
#define | DT_IRQ_LEVEL(node_id) |
Get the interrupt level for the node. | |
#define | DT_IRQ_HAS_IDX(node_id, idx) |
Is idx a valid interrupt index? | |
#define | DT_IRQ_HAS_CELL_AT_IDX(node_id, idx, cell) |
Does an interrupts property have a named cell specifier at an index? If this returns 1, then DT_IRQ_BY_IDX(node_id, idx, cell) is valid. | |
#define | DT_IRQ_HAS_CELL(node_id, cell) |
Equivalent to DT_IRQ_HAS_CELL_AT_IDX(node_id, 0, cell) | |
#define | DT_IRQ_HAS_NAME(node_id, name) |
Does an interrupts property have a named specifier value at an index? If this returns 1, then DT_IRQ_BY_NAME(node_id, name, cell) is valid. | |
#define | DT_IRQ_BY_IDX(node_id, idx, cell) |
Get a value within an interrupt specifier at an index. | |
#define | DT_IRQ_BY_NAME(node_id, name, cell) |
Get a value within an interrupt specifier by name. | |
#define | DT_IRQ(node_id, cell) |
Get an interrupt specifier's value Equivalent to DT_IRQ_BY_IDX(node_id, 0, cell). | |
#define | DT_IRQ_INTC_BY_IDX(node_id, idx) |
Get an interrupt specifier's interrupt controller by index. | |
#define | DT_IRQ_INTC_BY_NAME(node_id, name) |
Get an interrupt specifier's interrupt controller by name. | |
#define | DT_IRQ_INTC(node_id) |
Get an interrupt specifier's interrupt controller. | |
#define | DT_IRQN_BY_IDX(node_id, idx) |
Get the node's Zephyr interrupt number at index If. | |
#define | DT_IRQN(node_id) |
Get a node's (only) irq number. | |
#define DT_IRQ | ( | node_id, | |
cell ) |
#include <zephyr/devicetree.h>
Get an interrupt specifier's value Equivalent to DT_IRQ_BY_IDX(node_id, 0, cell).
node_id | node identifier |
cell | cell name specifier |
#define DT_IRQ_BY_IDX | ( | node_id, | |
idx, | |||
cell ) |
#include <zephyr/devicetree.h>
Get a value within an interrupt specifier at an index.
It might help to read the argument order as being similar to "node->interrupts[index].cell".
This can be used to get information about an individual interrupt when a device generates more than one.
Example devicetree fragment:
Assuming the node's interrupt domain has "#interrupt-cells = <2>;" and the individual cells in each interrupt specifier are named "irq" and "priority" by the node's binding, here are some examples:
#define SERIAL DT_NODELABEL(my_serial) Example usage Value ------------- ----- DT_IRQ_BY_IDX(SERIAL, 0, irq) 33 DT_IRQ_BY_IDX(SERIAL, 0, priority) 0 DT_IRQ_BY_IDX(SERIAL, 1, irq, 34 DT_IRQ_BY_IDX(SERIAL, 1, priority) 1
node_id | node identifier |
idx | logical index into the interrupt specifier array |
cell | cell name specifier |
#define DT_IRQ_BY_NAME | ( | node_id, | |
name, | |||
cell ) |
#include <zephyr/devicetree.h>
Get a value within an interrupt specifier by name.
It might help to read the argument order as being similar to node->interrupts.name.cell
.
This can be used to get information about an individual interrupt when a device generates more than one, if the bindings give each interrupt specifier a name.
node_id | node identifier |
name | lowercase-and-underscores interrupt specifier name |
cell | cell name specifier |
#define DT_IRQ_HAS_CELL | ( | node_id, | |
cell ) |
#include <zephyr/devicetree.h>
Equivalent to DT_IRQ_HAS_CELL_AT_IDX(node_id, 0, cell)
node_id | node identifier |
cell | named cell value whose existence to check |
#define DT_IRQ_HAS_CELL_AT_IDX | ( | node_id, | |
idx, | |||
cell ) |
#include <zephyr/devicetree.h>
Does an interrupts property have a named cell specifier at an index? If this returns 1, then DT_IRQ_BY_IDX(node_id, idx, cell) is valid.
If it returns 0, it is an error to use that macro.
node_id | node identifier |
idx | index to check |
cell | named cell value whose existence to check |
#define DT_IRQ_HAS_IDX | ( | node_id, | |
idx ) |
#include <zephyr/devicetree.h>
Is idx
a valid interrupt index?
If this returns 1, then DT_IRQ_BY_IDX(node_id, idx) is valid. If it returns 0, it is an error to use that macro with this index.
node_id | node identifier |
idx | index to check |
#define DT_IRQ_HAS_NAME | ( | node_id, | |
name ) |
#include <zephyr/devicetree.h>
Does an interrupts property have a named specifier value at an index? If this returns 1, then DT_IRQ_BY_NAME(node_id, name, cell) is valid.
If it returns 0, it is an error to use that macro.
node_id | node identifier |
name | lowercase-and-underscores interrupt specifier name |
#define DT_IRQ_INTC | ( | node_id | ) |
#include <zephyr/devicetree.h>
Get an interrupt specifier's interrupt controller.
Example usage:
DT_IRQ_INTC(DT_NODELABEL(foo)) // &gpio0 DT_IRQ_INTC(DT_NODELABEL(bar)) // &gpio0 DT_IRQ_INTC(DT_NODELABEL(qux)) // &pic0
node_id | node identifier |
#define DT_IRQ_INTC_BY_IDX | ( | node_id, | |
idx ) |
#include <zephyr/devicetree.h>
Get an interrupt specifier's interrupt controller by index.
Example usage:
DT_IRQ_INTC_BY_IDX(DT_NODELABEL(foo), 0) // &gpio0 DT_IRQ_INTC_BY_IDX(DT_NODELABEL(foo), 1) // &gpio0 DT_IRQ_INTC_BY_IDX(DT_NODELABEL(bar), 0) // &gpio0 DT_IRQ_INTC_BY_IDX(DT_NODELABEL(bar), 1) // &pic0 DT_IRQ_INTC_BY_IDX(DT_NODELABEL(qux), 0) // &pic0 DT_IRQ_INTC_BY_IDX(DT_NODELABEL(qux), 1) // &pic0
node_id | node identifier |
idx | interrupt specifier's index |
#define DT_IRQ_INTC_BY_NAME | ( | node_id, | |
name ) |
#include <zephyr/devicetree.h>
Get an interrupt specifier's interrupt controller by name.
Example usage:
DT_IRQ_INTC_BY_NAME(DT_NODELABEL(foo), int1) // &gpio0 DT_IRQ_INTC_BY_NAME(DT_NODELABEL(foo), int2) // &gpio0 DT_IRQ_INTC_BY_NAME(DT_NODELABEL(bar), int1) // &gpio0 DT_IRQ_INTC_BY_NAME(DT_NODELABEL(bar), int2) // &pic0 DT_IRQ_INTC_BY_NAME(DT_NODELABEL(qux), int1) // &pic0 DT_IRQ_INTC_BY_NAME(DT_NODELABEL(qux), int2) // &pic0
node_id | node identifier |
name | interrupt specifier's name |
#define DT_IRQ_LEVEL | ( | node_id | ) |
#include <zephyr/devicetree.h>
Get the interrupt level for the node.
node_id | node identifier |
#define DT_IRQN | ( | node_id | ) |
#include <zephyr/devicetree.h>
Get a node's (only) irq number.
Equivalent to DT_IRQ(node_id, irq). This is provided as a convenience for the common case where a node generates exactly one interrupt, and the IRQ number is in a cell named irq
.
node_id | node identifier |
#define DT_IRQN_BY_IDX | ( | node_id, | |
idx ) |
#include <zephyr/devicetree.h>
Get the node's Zephyr interrupt number at index If.
CONFIG_MULTI_LEVEL_INTERRUPTS
is enabled, the interrupt number at index will be multi-level encoded
node_id | node identifier |
idx | logical index into the interrupt specifier array |
#define DT_NUM_IRQS | ( | node_id | ) |
#include <zephyr/devicetree.h>
Get the number of interrupt sources for the node.
Use this instead of DT_PROP_LEN(node_id, interrupts).
node_id | node identifier |
#define DT_NUM_NODELABELS | ( | node_id | ) |
#include <zephyr/devicetree.h>
Get the number of node labels that a node has.
Example devicetree fragment:
Example usage:
node_id | node identifier |