gpio_utils.h: add helpers for dt node -> port pin mask
This captures a common pattern. Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
parent
ac53a8788e
commit
46f47a63ba
1 changed files with 6 additions and 0 deletions
|
@ -14,6 +14,12 @@
|
|||
#define GPIO_PORT_PIN_MASK_FROM_NGPIOS(ngpios) \
|
||||
((gpio_port_pins_t)(((u64_t)1 << (ngpios)) - 1U))
|
||||
|
||||
#define GPIO_PORT_PIN_MASK_FROM_DT_NODE(node_id) \
|
||||
GPIO_PORT_PIN_MASK_FROM_NGPIOS(DT_PROP(node_id, ngpios))
|
||||
|
||||
#define GPIO_PORT_PIN_MASK_FROM_DT_INST(inst) \
|
||||
GPIO_PORT_PIN_MASK_FROM_NGPIOS(DT_INST_PROP(inst, ngpios))
|
||||
|
||||
/**
|
||||
* @brief Generic function to insert or remove a callback from a callback list
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue