Zephyr API Documentation
2.7.0-rc2
A Scalable Open Source RTOS
|
Macros | |
#define | DT_NUM_IRQS(node_id) DT_CAT(node_id, _IRQ_NUM) |
Get the number of interrupt sources for the node. More... | |
#define | DT_IRQ_HAS_IDX(node_id, idx) IS_ENABLED(DT_CAT(node_id, _IRQ_IDX_##idx##_EXISTS)) |
Is "idx" a valid interrupt index? More... | |
#define | DT_IRQ_HAS_CELL_AT_IDX(node_id, idx, cell) IS_ENABLED(DT_CAT(node_id, _IRQ_IDX_##idx##_VAL_##cell##_EXISTS)) |
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. More... | |
#define | DT_IRQ_HAS_CELL(node_id, cell) DT_IRQ_HAS_CELL_AT_IDX(node_id, 0, cell) |
Equivalent to DT_IRQ_HAS_CELL_AT_IDX(node_id, 0, cell) More... | |
#define | DT_IRQ_HAS_NAME(node_id, name) IS_ENABLED(DT_CAT(node_id, _IRQ_NAME_##name##_VAL_irq_EXISTS)) |
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. More... | |
#define | DT_IRQ_BY_IDX(node_id, idx, cell) DT_CAT(node_id, _IRQ_IDX_##idx##_VAL_##cell) |
Get a value within an interrupt specifier at an index. More... | |
#define | DT_IRQ_BY_NAME(node_id, name, cell) DT_CAT(node_id, _IRQ_NAME_##name##_VAL_##cell) |
Get a value within an interrupt specifier by name. More... | |
#define | DT_IRQ(node_id, cell) DT_IRQ_BY_IDX(node_id, 0, cell) |
Get an interrupt specifier's value Equivalent to DT_IRQ_BY_IDX(node_id, 0, cell). More... | |
#define | DT_IRQN(node_id) DT_IRQ(node_id, irq) |
Get a node's (only) irq number. More... | |
#define DT_IRQ | ( | node_id, | |
cell | |||
) | DT_IRQ_BY_IDX(node_id, 0, cell) |
#include <include/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 | |||
) | DT_CAT(node_id, _IRQ_IDX_##idx##_VAL_##cell) |
#include <include/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:
my-serial: serial@... { interrupts = < 33 0 >, < 34 1 >; };
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 | |||
) | DT_CAT(node_id, _IRQ_NAME_##name##_VAL_##cell) |
#include <include/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 | |||
) | DT_IRQ_HAS_CELL_AT_IDX(node_id, 0, cell) |
#include <include/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 | |||
) | IS_ENABLED(DT_CAT(node_id, _IRQ_IDX_##idx##_VAL_##cell##_EXISTS)) |
#include <include/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 | |||
) | IS_ENABLED(DT_CAT(node_id, _IRQ_IDX_##idx##_EXISTS)) |
#include <include/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 | |||
) | IS_ENABLED(DT_CAT(node_id, _IRQ_NAME_##name##_VAL_irq_EXISTS)) |
#include <include/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_IRQN | ( | node_id | ) | DT_IRQ(node_id, irq) |
#include <include/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_NUM_IRQS | ( | node_id | ) | DT_CAT(node_id, _IRQ_NUM) |
#include <include/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 |