From 8ab93fdf980db8a0261ecefbb57e30552939169e Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 15 Dec 2015 08:40:34 -0600 Subject: [PATCH] Change name of drivers/discrete back to drivers/ioexpander --- drivers/Kconfig | 14 +++++----- drivers/Makefile | 2 +- drivers/{discrete => ioexpander}/Kconfig | 11 -------- drivers/{discrete => ioexpander}/Make.defs | 19 ++++--------- drivers/{discrete => ioexpander}/pca9555.c | 28 +++++++++++-------- drivers/{discrete => ioexpander}/pca9555.h | 12 ++++---- .../{discrete => ioexpander}/ioexpander.h | 8 +++--- .../nuttx/{discrete => ioexpander}/pca9555.h | 8 +++--- 8 files changed, 44 insertions(+), 58 deletions(-) rename drivers/{discrete => ioexpander}/Kconfig (79%) rename drivers/{discrete => ioexpander}/Make.defs (81%) rename drivers/{discrete => ioexpander}/pca9555.c (96%) rename drivers/{discrete => ioexpander}/pca9555.h (95%) rename include/nuttx/{discrete => ioexpander}/ioexpander.h (98%) rename include/nuttx/{discrete => ioexpander}/pca9555.h (96%) diff --git a/drivers/Kconfig b/drivers/Kconfig index ca64c11fd2..7c51e486cd 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig @@ -378,16 +378,16 @@ if INPUT source drivers/input/Kconfig endif # INPUT -menuconfig DISCRETE_IO - bool "Discrete I/O" +menuconfig IOEXPANDER + bool "IO Expander Support" default n ---help--- - This directory holds implementations of IO expander and other - discrete I/O drivers. + This directory holds implementations of IO expander drivers. + See include/nuttx/discrete/ioexpander.h for registration information. -if DISCRETE_IO -source drivers/discrete/Kconfig -endif # DISCRETE_IO +if IOEXPANDER +source drivers/ioexpander/Kconfig +endif # IOEXPANDER menuconfig LCD bool "LCD Driver Support" diff --git a/drivers/Makefile b/drivers/Makefile index 5616cf3e2f..c508b353dd 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -53,7 +53,7 @@ include analog$(DELIM)Make.defs include audio$(DELIM)Make.defs include bch$(DELIM)Make.defs include input$(DELIM)Make.defs -include discrete$(DELIM)Make.defs +include ioexpander$(DELIM)Make.defs include lcd$(DELIM)Make.defs include leds$(DELIM)Make.defs include loop$(DELIM)Make.defs diff --git a/drivers/discrete/Kconfig b/drivers/ioexpander/Kconfig similarity index 79% rename from drivers/discrete/Kconfig rename to drivers/ioexpander/Kconfig index 360689f314..f4b1694e97 100644 --- a/drivers/discrete/Kconfig +++ b/drivers/ioexpander/Kconfig @@ -3,15 +3,6 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -menuconfig IOEXPANDER - bool "IO Expander Support" - default n - ---help--- - This directory holds implementations of IO expander drivers. - See include/nuttx/discrete/ioexpander.h for registration information. - -if IOEXPANDER - config IOEXPANDER_PCA9555 bool "PCA9555 I2C IO expander" default n @@ -48,5 +39,3 @@ config IOEXPANDER_MULTIPIN ---help--- This settings enable the definition of routines for optimized simultaneous access to multiple pins. - -endif # IOEXPANDER diff --git a/drivers/discrete/Make.defs b/drivers/ioexpander/Make.defs similarity index 81% rename from drivers/discrete/Make.defs rename to drivers/ioexpander/Make.defs index 26b17d15dc..aea59aea51 100644 --- a/drivers/discrete/Make.defs +++ b/drivers/ioexpander/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# drivers/discrete/Make.defs +# drivers/ioexpander/Make.defs # # Copyright (C) 2015 Gregory Nutt. All rights reserved. # Author: Sebastien Lorquet @@ -33,14 +33,6 @@ # ############################################################################ -# Don't build anything if there is no support for discrete devices - -ifeq ($(CONFIG_DISCRETE_IO),y) - -# Include buttion driver -# Although it makes sense for button drivers to be in the discrete driver -# directory, the button drivers current reside in the input dirver directory. - # Check if I/O expander support is enabled ifeq ($(CONFIG_IOEXPANDER),y) @@ -50,12 +42,11 @@ ifeq ($(CONFIG_IOEXPANDER),y) ifeq ($(CONFIG_IOEXPANDER_PCA9555),y) CSRCS += pca9555.c endif -endif -# Include discrete I/O device driver build support +# Include ioexpander I/O device driver build support -DEPPATH += --dep-path discrete -VPATH += :discrete -CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)discrete} +DEPPATH += --dep-path ioexpander +VPATH += :ioexpander +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)ioexpander} endif diff --git a/drivers/discrete/pca9555.c b/drivers/ioexpander/pca9555.c similarity index 96% rename from drivers/discrete/pca9555.c rename to drivers/ioexpander/pca9555.c index 106942b69d..cc11416662 100644 --- a/drivers/discrete/pca9555.c +++ b/drivers/ioexpander/pca9555.c @@ -1,5 +1,5 @@ /**************************************************************************** - * drivers/discrete/pca9555.c + * drivers/ioexpander/pca9555.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Sebastien Lorquet @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include "pca9555.h" @@ -210,7 +210,7 @@ static int pca9555_getbit(FAR struct i2c_dev_s *i2c, uint8_t addr, * Name: pca9555_direction * * Description: - * See include/nuttx/discrete/ioexpander.h + * See include/nuttx/ioexpander/ioexpander.h * ****************************************************************************/ @@ -226,7 +226,7 @@ static int pca9555_direction(FAR struct ioexpander_dev_s *dev, uint8_t pin, * Name: pca9555_option * * Description: - * See include/nuttx/discrete/ioexpander.h + * See include/nuttx/ioexpander/ioexpander.h * ****************************************************************************/ @@ -248,7 +248,7 @@ static int pca9555_option(FAR struct ioexpander_dev_s *dev, uint8_t pin, * Name: pca9555_write * * Description: - * See include/nuttx/discrete/ioexpander.h + * See include/nuttx/ioexpander/ioexpander.h * ****************************************************************************/ @@ -263,7 +263,7 @@ static int pca9555_write(FAR struct ioexpander_dev_s *dev, uint8_t pin, * Name: pca9555_readpin * * Description: - * See include/nuttx/discrete/ioexpander.h + * See include/nuttx/ioexpander/ioexpander.h * ****************************************************************************/ @@ -278,7 +278,7 @@ static int pca9555_readpin(FAR struct ioexpander_dev_s *dev, uint8_t pin, * Name: pca9555_readbuf * * Description: - * See include/nuttx/discrete/ioexpander.h + * See include/nuttx/ioexpander/ioexpander.h * ****************************************************************************/ @@ -342,7 +342,7 @@ static int pca9555_getmultibits(FAR struct i2c_dev_s *i2c, uint8_t addr, * Name: pca9555_multiwrite * * Description: - * See include/nuttx/discrete/ioexpander.h + * See include/nuttx/ioexpander/ioexpander.h * ****************************************************************************/ @@ -404,7 +404,7 @@ static int pca9555_multiwrite(FAR struct ioexpander_dev_s *dev, * Name: pca9555_multireadpin * * Description: - * See include/nuttx/discrete/ioexpander.h + * See include/nuttx/ioexpander/ioexpander.h * ****************************************************************************/ @@ -421,7 +421,7 @@ static int pca9555_multireadpin(FAR struct ioexpander_dev_s *dev, * Name: pca9555_multireadbuf * * Description: - * See include/nuttx/discrete/ioexpander.h + * See include/nuttx/ioexpander/ioexpander.h * ****************************************************************************/ @@ -499,10 +499,16 @@ static void pca9555_irqworker(void *arg) static int pca9555_interrupt(int irq, FAR void *context) { +#ifdef CONFIG_PCA9555_MULTIPLE /* To support multiple devices, - * retrieve the priv structure using the irq number */ + * retrieve the priv structure using the irq number. + */ +# warning Missing logic + +#else register FAR struct pca9555_dev_s *pca = &g_pca9555; +#endif /* In complex environments, we cannot do I2C transfers from the interrupt * handler because semaphores are probably used to lock the I2C bus. In diff --git a/drivers/discrete/pca9555.h b/drivers/ioexpander/pca9555.h similarity index 95% rename from drivers/discrete/pca9555.h rename to drivers/ioexpander/pca9555.h index 638180e291..5a8e1b69df 100644 --- a/drivers/discrete/pca9555.h +++ b/drivers/ioexpander/pca9555.h @@ -1,5 +1,5 @@ /******************************************************************************************** - * drivers/discrete/pca9555.h + * drivers/ioexpander/pca9555.h * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Sebastien Lorquet @@ -37,8 +37,8 @@ * ********************************************************************************************/ -#ifndef __DRIVERS_DISCRETE_PCA9555_H -#define __DRIVERS_DISCRETE_PCA9555_H +#ifndef __DRIVERS_IOEXPANDER_PCA9555_H +#define __DRIVERS_IOEXPANDER_PCA9555_H /******************************************************************************************** * Included Files @@ -48,8 +48,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -128,4 +128,4 @@ struct pca9555_dev_s }; #endif /* CONFIG_IOEXPANDER && CONFIG_IOEXPANDER_PCA9555 */ -#endif /* __DRIVERS_DISCRETE_PCA9555_H */ +#endif /* __DRIVERS_IOEXPANDER_PCA9555_H */ diff --git a/include/nuttx/discrete/ioexpander.h b/include/nuttx/ioexpander/ioexpander.h similarity index 98% rename from include/nuttx/discrete/ioexpander.h rename to include/nuttx/ioexpander/ioexpander.h index 9adbb065d3..72df8b5f37 100644 --- a/include/nuttx/discrete/ioexpander.h +++ b/include/nuttx/ioexpander/ioexpander.h @@ -1,5 +1,5 @@ /**************************************************************************** - * include/nuttx/discrete/ioexpander.h + * include/nuttx/ioexpander/ioexpander.h * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Sebastien Lorquet @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __INCLUDE_NUTTX_DISCRETE_IOEXPANDER_H -#define __INCLUDE_NUTTX_DISCRETE_IOEXPANDER_H +#ifndef __INCLUDE_NUTTX_IOEXPANDER_IOEXPANDER_H +#define __INCLUDE_NUTTX_IOEXPANDER_IOEXPANDER_H /**************************************************************************** * Included Files @@ -264,5 +264,5 @@ struct ioexpander_dev_s }; #endif //CONFIG_IOEXPANDER -#endif //__INCLUDE_NUTTX_DISCRETE_IOEXPANDER_H +#endif //__INCLUDE_NUTTX_IOEXPANDER_IOEXPANDER_H diff --git a/include/nuttx/discrete/pca9555.h b/include/nuttx/ioexpander/pca9555.h similarity index 96% rename from include/nuttx/discrete/pca9555.h rename to include/nuttx/ioexpander/pca9555.h index 5f71c02dbd..581528c531 100644 --- a/include/nuttx/discrete/pca9555.h +++ b/include/nuttx/ioexpander/pca9555.h @@ -1,5 +1,5 @@ /******************************************************************************************** - * include/nuttx/discrete/pca9555.h + * include/nuttx/ioexpander/pca9555.h * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Sebastien Lorquet @@ -37,8 +37,8 @@ * ********************************************************************************************/ -#ifndef __INCLUDE_NUTTX_DISCRETE_PCA9555_H -#define __INCLUDE_NUTTX_DISCRETE_PCA9555_H +#ifndef __INCLUDE_NUTTX_IOEXPANDER_PCA9555_H +#define __INCLUDE_NUTTX_IOEXPANDER_PCA9555_H #include @@ -117,4 +117,4 @@ FAR struct ioexpander_dev_s* pca9555_initialize(FAR struct i2c_dev_s *dev, } #endif -#endif /* __INCLUDE_NUTTX_DISCRETE_PCA9555_H */ +#endif /* __INCLUDE_NUTTX_IOEXPANDER_PCA9555_H */