diff --git a/drivers/ioexpander/gpio.c b/drivers/ioexpander/gpio.c index 9e806c3bee6..b20068eff20 100644 --- a/drivers/ioexpander/gpio.c +++ b/drivers/ioexpander/gpio.c @@ -92,7 +92,7 @@ static const struct file_operations g_gpio_drvrops = * Name: gpio_handler * * Description: - * Standard character driver open method. + * GPIO interrupt callback function. * ****************************************************************************/ @@ -273,6 +273,12 @@ static int gpio_ioctl(FAR struct file *filep, int cmd, unsigned long arg) * Description: * Register GPIO pin device driver. * + * - Input pin types will be registered at /dev/gpinN + * - Output pin types will be registered at /dev/gpoutN + * - Interrupt pin types will be registered at /dev/gpintN + * + * Where N is the provided minor number in the range of 0-99. + * ****************************************************************************/ int gpio_pin_register(FAR struct gpio_dev_s *dev, int minor) diff --git a/include/nuttx/ioexpander/gpio.h b/include/nuttx/ioexpander/gpio.h index 6cd73816068..c4c044e6a89 100644 --- a/include/nuttx/ioexpander/gpio.h +++ b/include/nuttx/ioexpander/gpio.h @@ -85,7 +85,15 @@ enum gpio_pintype_e typedef CODE int (*pin_interrupt_t)(FAR struct gpio_dev_s *dev); -/* Pin interface definition. */ +/* Pin interface vtable definition. Instances of this vtable are read-only + * and may reside in FLASH. + * + * - go_read. Required for all all pin types. + * - go_write. Required only for the GPIO_OUTPUT_PIN pin type. Unused + * for other pin types may be NULL. + * - go_attach and gp_eanble. Required only the GPIO_INTERRUPT_PIN pin + * type. Unused for other pin types may be NULL. + */ struct gpio_dev_s; struct gpio_operations_s @@ -99,7 +107,7 @@ struct gpio_operations_s CODE int (*go_enable)(FAR struct gpio_dev_s *dev, bool enable); }; -/* Pin interface definition. */ +/* Pin interface definition. Must lie in writable memory. */ struct gpio_dev_s { @@ -120,7 +128,7 @@ struct gpio_dev_s FAR const struct gpio_operations_s *gp_ops; - /* Device specific, lower-half information may follow */ + /* Device specific, lower-half information may follow. */ }; /**************************************************************************** @@ -141,6 +149,13 @@ extern "C" * Description: * Register GPIO pin device driver. * + * - Input pin types will be registered at /dev/gpinN + * - Output pin types will be registered at /dev/gpoutN + * - Interrupt pin types will be registered at /dev/gpintN + * + * Where N is the provided minor number in the range of 0-99. + * + * ****************************************************************************/ int gpio_pin_register(FAR struct gpio_dev_s *dev, int minor);