devicetree: add DT_HAS_DRV_INST(instance_number)
Convenience macro for checking the existence of a node by instance number. Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
parent
93309317d0
commit
49f97f64dd
2 changed files with 17 additions and 0 deletions
|
@ -1281,6 +1281,16 @@
|
|||
*/
|
||||
#define DT_INST_BUS_LABEL(inst) DT_BUS_LABEL(DT_DRV_INST(inst))
|
||||
|
||||
/**
|
||||
* @brief Does the devicetree have a particular instance number?
|
||||
*
|
||||
* This is equivalent to DT_HAS_NODE(DT_DRV_INST(inst)).
|
||||
* @param inst instance number
|
||||
* @return 1 if the devicetree has that numbered instance,
|
||||
* 0 otherwise.
|
||||
*/
|
||||
#define DT_HAS_DRV_INST(inst) DT_HAS_NODE(DT_DRV_INST(inst))
|
||||
|
||||
/**
|
||||
* @brief Test if a DT_DRV_COMPAT's bus type is a given type
|
||||
* This is equivalent to DT_ON_BUS(DT_DRV_INST(inst), bus).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue