mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 01:05:54 +08:00
drivers/ioexpander: The IRQ subsystem now supports passing a void * parameter to IRQ handlers. Use that method to support multiple pc9555 devices, by passing a pointer to the device to the board defined irq handler. Now the CONFIG_ for multiple PCA devices just allocates device structures dynamically instead of statically when not enabled.
The same interrupt handler is entered with the device structure parameter in all situations, multiple or single PCA. One should still be careful if multiple PCA devices share the same IRQ.
This commit is contained in:
committed by
Gregory Nutt
parent
ee1330ed5e
commit
1182702b80
@@ -74,10 +74,6 @@ struct pca9555_config_s
|
||||
* be provided for each so that their interrupts can be distinguished.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_PCA9555_MULTIPLE
|
||||
int irq; /* IRQ number received by interrupt handler. */
|
||||
#endif
|
||||
|
||||
/* IRQ/GPIO access callbacks. These operations all hidden behind
|
||||
* callbacks to isolate the PCA9555 driver from differences in GPIO
|
||||
* interrupt handling by varying boards and MCUs.
|
||||
@@ -86,7 +82,8 @@ struct pca9555_config_s
|
||||
* enable - Enable or disable the GPIO interrupt
|
||||
*/
|
||||
|
||||
CODE int (*attach)(FAR struct pca9555_config_s *state, xcpt_t isr);
|
||||
CODE int (*attach)(FAR struct pca9555_config_s *state, xcpt_t isr,
|
||||
FAR void *arg);
|
||||
CODE void (*enable)(FAR struct pca9555_config_s *state, bool enable);
|
||||
#endif
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user