diff --git a/ChangeLog b/ChangeLog index c897ce17118..0297310651d 100755 --- a/ChangeLog +++ b/ChangeLog @@ -11049,4 +11049,7 @@ * Many files: Standardize naming of the user LED interface functions. The new user LED interface functions are now prototyped in only in include/nuttx/board.h and have name like board_userled_* (2015-11-01). + * Rename ioexpander/ directories to discrete/. This expands the + namespace so that other discrete I/O drivers can reside there as + well (2015-11-01). diff --git a/drivers/Kconfig b/drivers/Kconfig index 263001d9cca..16fa26de7d0 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig @@ -292,16 +292,16 @@ if INPUT source drivers/input/Kconfig endif # INPUT -menuconfig IOEXPANDER - bool "IO Expanders Support" +menuconfig DISCRETE_IO + bool "Discrete I/O" default n ---help--- - This directory holds implementations of IO expander drivers. - See include/nuttx/ioexpander/ioexpander.h for registration information. + This directory holds implementations of IO expander and other + discrete I/O drivers. -if IOEXPANDER -source drivers/ioexpander/Kconfig -endif # IOEXPANDER +if DISCRETE_IO +source drivers/discrete/Kconfig +endif # DISCRETE_IO menuconfig LCD bool "LCD Driver Support" diff --git a/drivers/Makefile b/drivers/Makefile index 086cecb2ad1..80630ed5af9 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 ioexpander$(DELIM)Make.defs +include discrete$(DELIM)Make.defs include lcd$(DELIM)Make.defs include mmcsd$(DELIM)Make.defs include mtd$(DELIM)Make.defs diff --git a/drivers/ioexpander/Kconfig b/drivers/discrete/Kconfig similarity index 76% rename from drivers/ioexpander/Kconfig rename to drivers/discrete/Kconfig index 10560410637..afeaacb8347 100644 --- a/drivers/ioexpander/Kconfig +++ b/drivers/discrete/Kconfig @@ -3,6 +3,15 @@ # 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_MULTIPIN bool "Support multi-pin access routines" default n @@ -32,3 +41,4 @@ config PCA9555_INT_DISABLE Disable driver interrupt functionality endif # IOEXPANDER_PCA9555 +endif # IOEXPANDER diff --git a/drivers/ioexpander/Make.defs b/drivers/discrete/Make.defs similarity index 94% rename from drivers/ioexpander/Make.defs rename to drivers/discrete/Make.defs index 7e34efa8b0c..94ae462c7cc 100644 --- a/drivers/ioexpander/Make.defs +++ b/drivers/discrete/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# drivers/ioexpander/Make.defs +# drivers/discrete/Make.defs # # Copyright (C) 2015 Gregory Nutt. All rights reserved. # Author: Sebastien Lorquet @@ -45,8 +45,8 @@ endif # Include io expander device driver build support -DEPPATH += --dep-path ioexpander -VPATH += :ioexpander -CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)ioexpander} +DEPPATH += --dep-path discrete +VPATH += :discrete +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)discrete} endif diff --git a/drivers/ioexpander/pca9555.c b/drivers/discrete/pca9555.c similarity index 96% rename from drivers/ioexpander/pca9555.c rename to drivers/discrete/pca9555.c index 3bf2cf1923b..ae5c117d8a1 100644 --- a/drivers/ioexpander/pca9555.c +++ b/drivers/discrete/pca9555.c @@ -1,5 +1,5 @@ /**************************************************************************** - * drivers/ioexpander/pca9555.c + * drivers/discrete/pca9555.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Sebastien Lorquet @@ -48,7 +48,8 @@ #include #include -#include +#include +#include #include "pca9555.h" @@ -208,7 +209,7 @@ static int pca9555_getbit(FAR struct i2c_dev_s *i2c, uint8_t addr, * Name: pca9555_direction * * Description: - * See include/nuttx/ioexpander/ioexpander.h + * See include/nuttx/discrete/ioexpander.h * ****************************************************************************/ @@ -224,12 +225,12 @@ static int pca9555_direction(FAR struct ioexpander_dev_s *dev, uint8_t pin, * Name: pca9555_option * * Description: - * See include/nuttx/ioexpander/ioexpander.h + * See include/nuttx/discrete/ioexpander.h * ****************************************************************************/ static int pca9555_option(FAR struct ioexpander_dev_s *dev, uint8_t pin, - int opt, void *val) + int opt, FAR void *val) { FAR struct pca9555_dev_s *pca = (FAR struct pca9555_dev_s *)dev; int ival = (int)val; @@ -246,7 +247,7 @@ static int pca9555_option(FAR struct ioexpander_dev_s *dev, uint8_t pin, * Name: pca9555_write * * Description: - * See include/nuttx/ioexpander/ioexpander.h + * See include/nuttx/discrete/ioexpander.h * ****************************************************************************/ @@ -261,7 +262,7 @@ static int pca9555_write(FAR struct ioexpander_dev_s *dev, uint8_t pin, * Name: pca9555_readpin * * Description: - * See include/nuttx/ioexpander/ioexpander.h + * See include/nuttx/discrete/ioexpander.h * ****************************************************************************/ @@ -276,7 +277,7 @@ static int pca9555_readpin(FAR struct ioexpander_dev_s *dev, uint8_t pin, * Name: pca9555_readbuf * * Description: - * See include/nuttx/ioexpander/ioexpander.h + * See include/nuttx/discrete/ioexpander.h * ****************************************************************************/ @@ -340,7 +341,7 @@ static int pca9555_getmultibits(FAR struct i2c_dev_s *i2c, uint8_t addr, * Name: pca9555_multiwrite * * Description: - * See include/nuttx/ioexpander/ioexpander.h + * See include/nuttx/discrete/ioexpander.h * ****************************************************************************/ @@ -402,7 +403,7 @@ static int pca9555_multiwrite(FAR struct ioexpander_dev_s *dev, * Name: pca9555_multireadpin * * Description: - * See include/nuttx/ioexpander/ioexpander.h + * See include/nuttx/discrete/ioexpander.h * ****************************************************************************/ @@ -419,7 +420,7 @@ static int pca9555_multireadpin(FAR struct ioexpander_dev_s *dev, * Name: pca9555_multireadbuf * * Description: - * See include/nuttx/ioexpander/ioexpander.h + * See include/nuttx/discrete/ioexpander.h * ****************************************************************************/ @@ -440,7 +441,7 @@ static int pca9555_multireadbuf(FAR struct ioexpander_dev_s *dev, * Name: pca9555_gpioworker * * Description: - * See include/nuttx/ioexpander/ioexpander.h + * See include/nuttx/discrete/ioexpander.h * ****************************************************************************/ diff --git a/drivers/ioexpander/pca9555.h b/drivers/discrete/pca9555.h similarity index 95% rename from drivers/ioexpander/pca9555.h rename to drivers/discrete/pca9555.h index ef0495a9f4c..2586937c83c 100644 --- a/drivers/ioexpander/pca9555.h +++ b/drivers/discrete/pca9555.h @@ -1,5 +1,5 @@ /******************************************************************************************** - * drivers/ioexpander/pca9555.h + * drivers/discrete/pca9555.h * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Sebastien Lorquet @@ -37,8 +37,8 @@ * ********************************************************************************************/ -#ifndef __DRIVERS_IOEXPANDER_PCA9555_H -#define __DRIVERS_IOEXPANDER_PCA9555_H +#ifndef __DRIVERS_DISCRETE_PCA9555_H +#define __DRIVERS_DISCRETE_PCA9555_H /******************************************************************************************** * Included Files @@ -49,8 +49,8 @@ #include #include #include -#include -#include +#include +#include #include #include @@ -139,4 +139,4 @@ struct pca9555_dev_s }; #endif /* CONFIG_IOEXPANDER && CONFIG_IOEXPANDER_PCA9555 */ -#endif /* __DRIVERS_IOEXPANDER_PCA9555_H */ +#endif /* __DRIVERS_DISCRETE_PCA9555_H */ diff --git a/include/nuttx/ioexpander/ioexpander.h b/include/nuttx/discrete/ioexpander.h similarity index 98% rename from include/nuttx/ioexpander/ioexpander.h rename to include/nuttx/discrete/ioexpander.h index 96d4197a724..609961d8959 100644 --- a/include/nuttx/ioexpander/ioexpander.h +++ b/include/nuttx/discrete/ioexpander.h @@ -1,5 +1,5 @@ /**************************************************************************** - * include/nuttx/ioexpander/ioexpander.h + * include/nuttx/discrete/ioexpander.h * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Sebastien Lorquet @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __INCLUDE_NUTTX_IOEXPANDER_IOEXPANDER_H -#define __INCLUDE_NUTTX_IOEXPANDER_IOEXPANDER_H +#ifndef __INCLUDE_NUTTX_DISCRETE_IOEXPANDER_H +#define __INCLUDE_NUTTX_DISCRETE_IOEXPANDER_H /**************************************************************************** * Included Files @@ -252,5 +252,5 @@ struct ioexpander_dev_s }; #endif //CONFIG_IOEXPANDER -#endif //__INCLUDE_NUTTX_IOEXPANDER_IOEXPANDER_H +#endif //__INCLUDE_NUTTX_DISCRETE_IOEXPANDER_H diff --git a/include/nuttx/ioexpander/pca9555.h b/include/nuttx/discrete/pca9555.h similarity index 96% rename from include/nuttx/ioexpander/pca9555.h rename to include/nuttx/discrete/pca9555.h index b8c857a3e7e..fea1bdb3d44 100644 --- a/include/nuttx/ioexpander/pca9555.h +++ b/include/nuttx/discrete/pca9555.h @@ -1,5 +1,5 @@ /******************************************************************************************** - * include/nuttx/ioexpander/pca9555.h + * include/nuttx/discrete/pca9555.h * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Sebastien Lorquet @@ -37,8 +37,8 @@ * ********************************************************************************************/ -#ifndef __INCLUDE_NUTTX_IOEXPANDER_PCA9555_H -#define __INCLUDE_NUTTX_IOEXPANDER_PCA9555_H +#ifndef __INCLUDE_NUTTX_DISCRETE_PCA9555_H +#define __INCLUDE_NUTTX_DISCRETE_PCA9555_H #include @@ -120,4 +120,4 @@ FAR struct ioexpander_dev_s* pca9555_initialize(FAR struct i2c_dev_s *dev, } #endif -#endif /* __INCLUDE_NUTTX_IOEXPANDER_PCA9555_H */ +#endif /* __INCLUDE_NUTTX_DISCRETE_PCA9555_H */