gpio: enable callback to specify pin in addition to pin_mask
There are GPIO controllers that can control more than 32 pins. The pin_mask is no longer adequate in this case. This wraps the pin_mask in a union together with a field named 'pin'. The driver is responsible for choosing whether to use pin_mask or pin. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
2f0282a239
commit
eb6ea28649
|
@ -90,13 +90,17 @@ struct gpio_callback {
|
|||
/** Actual callback function being called when relevant. */
|
||||
gpio_callback_handler_t handler;
|
||||
|
||||
/** A mask of pins the callback is interested in, if 0 the callback
|
||||
* will never be called. Such pin_mask can be modified whenever
|
||||
/** A mask of pins (pin_mask) or a specific pin (pin) the callback
|
||||
* is interested in, if 0 the callback will never be called.
|
||||
* The pin_mask or pin can be modified whenever
|
||||
* necessary by the owner, and thus will affect the handler being
|
||||
* called or not. The selected pins must be configured to trigger
|
||||
* an interrupt.
|
||||
*/
|
||||
union {
|
||||
u32_t pin_mask;
|
||||
u32_t pin;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue