From 8d2d65205e68aa0fcd5cb7ed8140117e690b2703 Mon Sep 17 00:00:00 2001
From: patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>
Date: Tue, 19 Apr 2011 18:51:02 +0000
Subject: [PATCH] Rename i2c directories to sensors

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3525 42af7a65-404d-4744-a932-0658087f49c3
---
 arch/arm/src/lpc313x/lpc313x_i2c.c           |  4 +-
 arch/arm/src/stm32/stm32_i2c.c               |  2 +-
 arch/arm/src/stm32/stm32_i2c.h               |  2 +-
 arch/z80/src/ez80/ez80_i2c.c                 |  2 +-
 arch/z80/src/z8/z8_i2c.c                     |  2 +-
 configs/vsn/src/sif.c                        |  4 +-
 drivers/Makefile                             | 68 ++++++++++----------
 drivers/{i2c => sensors}/Make.defs           | 10 +--
 drivers/{i2c => sensors}/st_lis331dl.c       |  4 +-
 graphics/nxfonts/nxfonts_convert.c           |  5 +-
 include/nuttx/{i2c => }/i2c.h                |  8 +--
 include/nuttx/nxfonts.h                      |  4 ++
 include/nuttx/{i2c => sensors}/st_lis331dl.h | 11 ++--
 13 files changed, 63 insertions(+), 63 deletions(-)
 rename drivers/{i2c => sensors}/Make.defs (93%)
 rename drivers/{i2c => sensors}/st_lis331dl.c (99%)
 rename include/nuttx/{i2c => }/i2c.h (98%)
 rename include/nuttx/{i2c => sensors}/st_lis331dl.h (97%)

diff --git a/arch/arm/src/lpc313x/lpc313x_i2c.c b/arch/arm/src/lpc313x/lpc313x_i2c.c
index dc2e454b9d..3477b9e537 100644
--- a/arch/arm/src/lpc313x/lpc313x_i2c.c
+++ b/arch/arm/src/lpc313x/lpc313x_i2c.c
@@ -3,7 +3,7 @@
  *
  *   Author: David Hewson
  *
- *   Copyright (C) 2010 Gregory Nutt. All rights reserved.
+ *   Copyright (C) 2010-2011 Gregory Nutt. All rights reserved.
  *   Author: Gregory Nutt <spudmonkey@racsa.co.cr>
  *
  * Redistribution and use in source and binary forms, with or without
@@ -50,7 +50,7 @@
 #include <debug.h>
 
 #include <nuttx/arch.h>
-#include <nuttx/i2c/i2c.h>
+#include <nuttx/i2c.h>
 
 #include <arch/irq.h>
 #include <arch/board/board.h>
diff --git a/arch/arm/src/stm32/stm32_i2c.c b/arch/arm/src/stm32/stm32_i2c.c
index f19a1909cc..84f099ba1f 100644
--- a/arch/arm/src/stm32/stm32_i2c.c
+++ b/arch/arm/src/stm32/stm32_i2c.c
@@ -65,7 +65,7 @@
 #include <nuttx/config.h>
 #include <nuttx/arch.h>
 #include <nuttx/irq.h>
-#include <nuttx/i2c/i2c.h>
+#include <nuttx/i2c.h>
 #include <nuttx/kmalloc.h>
 #include <arch/board/board.h>
 
diff --git a/arch/arm/src/stm32/stm32_i2c.h b/arch/arm/src/stm32/stm32_i2c.h
index 9bb17521a8..23a06bc051 100755
--- a/arch/arm/src/stm32/stm32_i2c.h
+++ b/arch/arm/src/stm32/stm32_i2c.h
@@ -41,7 +41,7 @@
  ************************************************************************************/
 
 #include <nuttx/config.h>
-#include <nuttx/i2c/i2c.h>
+#include <nuttx/i2c.h>
 
 #include "chip.h"
 #include "chip/stm32_i2c.h"
diff --git a/arch/z80/src/ez80/ez80_i2c.c b/arch/z80/src/ez80/ez80_i2c.c
index 74dc899191..609ab22bd5 100644
--- a/arch/z80/src/ez80/ez80_i2c.c
+++ b/arch/z80/src/ez80/ez80_i2c.c
@@ -47,7 +47,7 @@
 #include <assert.h>
 #include <debug.h>
 
-#include <nuttx/i2c/i2c.h>
+#include <nuttx/i2c.h>
 #include <arch/io.h>
 #include <arch/board/board.h>
 
diff --git a/arch/z80/src/z8/z8_i2c.c b/arch/z80/src/z8/z8_i2c.c
index 11825ac596..be4a94eb02 100755
--- a/arch/z80/src/z8/z8_i2c.c
+++ b/arch/z80/src/z8/z8_i2c.c
@@ -47,7 +47,7 @@
 #include <assert.h>
 #include <debug.h>
 
-#include <nuttx/i2c/i2c.h>
+#include <nuttx/i2c.h>
 #include <arch/board/board.h>
 
 #include <eZ8.h>  /* eZ8 Register definitions */
diff --git a/configs/vsn/src/sif.c b/configs/vsn/src/sif.c
index 7a510da242..2d5351e87b 100644
--- a/configs/vsn/src/sif.c
+++ b/configs/vsn/src/sif.c
@@ -75,8 +75,8 @@
 #include <nuttx/time.h>
 #include <nuttx/rtc.h>
 
-#include <nuttx/i2c/i2c.h>
-#include <nuttx/i2c/st_lis331dl.h>
+#include <nuttx/i2c.h>
+#include <nuttx/sensors/st_lis331dl.h>
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/drivers/Makefile b/drivers/Makefile
index 68f3427548..45dbe761a7 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -36,74 +36,72 @@
 -include $(TOPDIR)/Make.defs
 
 ifeq ($(WINTOOL),y)
-INCDIROPT	= -w
+INCDIROPT = -w
 endif
 
 ifneq ($(CONFIG_NFILE_DESCRIPTORS),0)
 include serial/Make.defs
-ROOTDEPPATH	= --dep-path .
-SERIALDEPPATH	= --dep-path serial
+ROOTDEPPATH = --dep-path .
+SERIALDEPPATH = --dep-path serial
 endif
 
 ifeq ($(CONFIG_NET),y)
 include net/Make.defs
-ROOTDEPPATH	= --dep-path .
-NETDEPPATH	= --dep-path net
+ROOTDEPPATH = --dep-path .
+NETDEPPATH = --dep-path net
 endif
 
 ifneq ($(CONFIG_NFILE_DESCRIPTORS),0)
 include pipes/Make.defs
-ROOTDEPPATH	= --dep-path .
-PIPEDEPPATH	= --dep-path pipes
+ROOTDEPPATH = --dep-path .
+PIPEDEPPATH = --dep-path pipes
 endif
 
 ifeq ($(CONFIG_USBDEV),y)
 include usbdev/Make.defs
-ROOTDEPPATH	= --dep-path .
-USBDEVDEPPATH	= --dep-path usbdev
-CFLAGS		+= ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/usbdev}
+ROOTDEPPATH = --dep-path .
+USBDEVDEPPATH = --dep-path usbdev
+CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/usbdev}
 endif
 
 ifeq ($(CONFIG_USBHOST),y)
 include usbhost/Make.defs
-ROOTDEPPATH	= --dep-path .
-USBHOSTDEPPATH	= --dep-path usbhost
-CFLAGS		+= ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/usbhost}
+ROOTDEPPATH = --dep-path .
+USBHOSTDEPPATH = --dep-path usbhost
+CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/usbhost}
 endif
 
 include mmcsd/Make.defs
-ROOTDEPPATH	= --dep-path .
-MMCSDDEPPATH	= --dep-path mmcsd
-CFLAGS		+= ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/mmcsd}
+ROOTDEPPATH = --dep-path .
+MMCSDDEPPATH = --dep-path mmcsd
+CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/mmcsd}
 
 include lcd/Make.defs
-ROOTDEPPATH	= --dep-path .
-LCDDEPPATH	= --dep-path lcd
-CFLAGS		+= ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/lcd}
+ROOTDEPPATH = --dep-path .
+LCDDEPPATH = --dep-path lcd
+CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/lcd}
 
 ifneq ($(CONFIG_NFILE_DESCRIPTORS),0)
 ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y)
 include bch/Make.defs
-ROOTDEPPATH	= --dep-path .
-BCHDEPPATH	= --dep-path bch
-CFLAGS		+= ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/bch}
+ROOTDEPPATH = --dep-path .
+BCHDEPPATH = --dep-path bch
+CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/bch}
 endif
 endif
 
 include mtd/Make.defs
-ROOTDEPPATH	= --dep-path .
-MTDDEPPATH	= --dep-path mtd
-
-ifeq ($(CONFIG_I2C),y)
-include i2c/Make.defs
-ROOTDEPPATH	= --dep-path .
-I2CDEPPATH	= --dep-path i2c
-CFLAGS		+= ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/i2c}
-endif
+ROOTDEPPATH = --dep-path .
+MTDDEPPATH = --dep-path mtd
+
+include sensors/Make.defs
+ROOTDEPPATH = --dep-path .
+SENSORDEPPATH = --dep-path sensors
+CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/sensors}
 
 ASRCS		= $(SERIAL_ASRCS) $(NET_ASRCS) $(PIPE_ASRCS) $(USBDEV_ASRCS) \
 			  $(USBHOST_ASRCS) $(MMCSD_ASRCS) $(LCD_ASRCS) $(BCH_ASRCS) \
-			  $(MTD_ASRCS)
+			  $(MTD_ASRCS) $(SENSOR_ASRCS)
 AOBJS		= $(ASRCS:.S=$(OBJEXT))
 
 CSRCS		=
@@ -115,7 +113,7 @@ endif
 endif
 CSRCS		+= $(SERIAL_CSRCS) $(NET_CSRCS) $(PIPE_CSRCS) $(USBDEV_CSRCS) \
 			   $(USBHOST_CSRCS) $(MMCSD_CSRCS) $(LCD_CSRCS) $(BCH_CSRCS) \
-			   $(MTD_CSRCS) $(I2C_CSRCS)
+			   $(MTD_CSRCS) $(SENSOR_CSRCS)
 COBJS		= $(CSRCS:.c=$(OBJEXT))
 
 SRCS		= $(ASRCS) $(CSRCS)
@@ -123,7 +121,7 @@ OBJS		= $(AOBJS) $(COBJS)
 
 BIN			= libdrivers$(LIBEXT)
 
-VPATH		= serial:net:pipes:usbdev:usbhost:mmcsd:lcd:bch:mtd:i2c
+VPATH		= serial:net:pipes:usbdev:usbhost:mmcsd:lcd:bch:mtd:sensors
 
 all:	$(BIN)
 
@@ -141,7 +139,7 @@ $(BIN):	$(OBJS)
 .depend: Makefile $(SRCS)
 	@$(MKDEP) $(ROOTDEPPATH) $(SERIALDEPPATH) $(NETDEPPATH) $(PIPEDEPPATH) \
 	  $(USBDEVDEPPATH) $(USBHOSTDEPPATH) $(MMCSDDEPPATH) $(LCDDEPPATH) \
-	  $(BCHDEPPATH) $(MTDDEPPATH) $(I2CDEPPATH)\
+	  $(BCHDEPPATH) $(MTDDEPPATH) $(SENSORDEPPATH) \
 	  $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
 	@touch $@
 
diff --git a/drivers/i2c/Make.defs b/drivers/sensors/Make.defs
similarity index 93%
rename from drivers/i2c/Make.defs
rename to drivers/sensors/Make.defs
index 2358d533b9..61badadc27 100644
--- a/drivers/i2c/Make.defs
+++ b/drivers/sensors/Make.defs
@@ -1,5 +1,5 @@
 ############################################################################
-# drivers/i2c/Make.defs
+# drivers/sensors/Make.defs
 #
 #   Copyright (C) 2011 Gregory Nutt. All rights reserved.
 #   Author: Gregory Nutt <spudmonkey@racsa.co.cr>
@@ -33,10 +33,12 @@
 #
 ############################################################################
 
-I2C_ASRCS  =
-I2C_CSRCS  = 
+SENSOR_ASRCS  =
+SENSOR_CSRCS = 
+
+# These drivers depend on I2C support
 
 ifeq ($(CONFIG_I2C),y)
-I2C_CSRCS  += st_lis331dl.c
+SENSOR_CSRCS += st_lis331dl.c
 endif
 
diff --git a/drivers/i2c/st_lis331dl.c b/drivers/sensors/st_lis331dl.c
similarity index 99%
rename from drivers/i2c/st_lis331dl.c
rename to drivers/sensors/st_lis331dl.c
index 7d5cdc4a23..19f7dd7552 100644
--- a/drivers/i2c/st_lis331dl.c
+++ b/drivers/sensors/st_lis331dl.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * drivers/i2c/st_lis331dl.c
+ * drivers/sensors/st_lis331dl.c
  *
  *   Copyright (C) 2011 Uros Platise. All rights reserved.
  *
@@ -47,7 +47,7 @@
 #include <stdio.h>
 
 #include <nuttx/kmalloc.h>
-#include <nuttx/i2c/st_lis331dl.h>
+#include <nuttx/sensors/st_lis331dl.h>
  
 /************************************************************************************
  * Private Data Types
diff --git a/graphics/nxfonts/nxfonts_convert.c b/graphics/nxfonts/nxfonts_convert.c
index c5afb759e8..429518cf02 100644
--- a/graphics/nxfonts/nxfonts_convert.c
+++ b/graphics/nxfonts/nxfonts_convert.c
@@ -65,10 +65,7 @@
 #  define NXF_PIXELMASK           0x01
 #  define NXF_SCALEX(x)           ((x) >> 3)
 #  define NXF_PIXEL_T             uint8_t
-#  define NXF_MULTIPIXEL(p)       ((uint8_t)(p) << 7 | (uint8_t)(p) << 6 | \
-                                   (uint8_t)(p) << 5 | (uint8_t)(p) << 4 | \
-                                   (uint8_t)(p) << 3 | (uint8_t)(p) << 2 | \
-                                   (uint8_t)(p) << 1 | (p))
+#  define NXF_MULTIPIXEL(p)       ((p) ? 0xff : 0x00)
 
 #elif NXFONTS_BITSPERPIXEL == 2
 
diff --git a/include/nuttx/i2c/i2c.h b/include/nuttx/i2c.h
similarity index 98%
rename from include/nuttx/i2c/i2c.h
rename to include/nuttx/i2c.h
index 571c3c4016..748b7cc607 100644
--- a/include/nuttx/i2c/i2c.h
+++ b/include/nuttx/i2c.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * include/nuttx/i2c/i2c.h
+ * include/nuttx/i2c.h
  *
  *   Copyright(C) 2009-2011 Gregory Nutt. All rights reserved.
  *   Author: Gregory Nutt <spudmonkey@racsa.co.cr>
@@ -33,8 +33,8 @@
  *
  ****************************************************************************/
 
-#ifndef __INCLUDE_NUTTX_I2C_I2C_H
-#define __INCLUDE_NUTTX_I2C_I2C_H
+#ifndef __INCLUDE_NUTTX_I2C_H
+#define __INCLUDE_NUTTX_I2C_H
 
 /****************************************************************************
  * Included Files
@@ -330,4 +330,4 @@ EXTERN int up_i2cuninitialize(FAR struct i2c_dev_s * dev);
 #if defined(__cplusplus)
 }
 #endif
-#endif /* __INCLUDE_NUTTX_I2C_I2C_H */
+#endif /* __INCLUDE_NUTTX_I2C_H */
diff --git a/include/nuttx/nxfonts.h b/include/nuttx/nxfonts.h
index 9a8603964f..e9c17362a4 100644
--- a/include/nuttx/nxfonts.h
+++ b/include/nuttx/nxfonts.h
@@ -161,6 +161,10 @@ EXTERN FAR const struct nx_fontbitmap_s *nxf_getbitmap(uint16_t ch);
  *
  ****************************************************************************/
 
+EXTERN int nxf_convert_1bpp(FAR uint8_t *dest, uint16_t height,
+                            uint16_t width, uint16_t stride,
+                            FAR const struct nx_fontbitmap_s *bm,
+                            nxgl_mxpixel_t color);
 EXTERN int nxf_convert_2bpp(FAR uint8_t *dest, uint16_t height,
                             uint16_t width, uint16_t stride,
                             FAR const struct nx_fontbitmap_s *bm,
diff --git a/include/nuttx/i2c/st_lis331dl.h b/include/nuttx/sensors/st_lis331dl.h
similarity index 97%
rename from include/nuttx/i2c/st_lis331dl.h
rename to include/nuttx/sensors/st_lis331dl.h
index 31092ae79a..679ba81ec3 100644
--- a/include/nuttx/i2c/st_lis331dl.h
+++ b/include/nuttx/sensors/st_lis331dl.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * include/nuttx/i2c/st_lis331dl.h
+ * include/nuttx/sensors/st_lis331dl.h
  *
  *   Copyright (C) 2011 Uros Platise. All rights reserved.
  *
@@ -39,13 +39,12 @@
  *  \brief ST LIS331DL I2C Device Driver
  **/ 
 
-#ifndef __INCLUDE_NUTTX_I2C_ST_LIS331DL_H
-#define __INCLUDE_NUTTX_I2C_ST_LIS331DL_H
+#ifndef __INCLUDE_NUTTX_SENSORS_ST_LIS331DL_H
+#define __INCLUDE_NUTTX_SENSORS_ST_LIS331DL_H
 
-#include <nuttx/i2c/i2c.h>
+#include <nuttx/i2c.h>
 #include <stdbool.h>
 
-
 /************************************************************************************
  * Pre-Processor Declarations
  ************************************************************************************/
@@ -176,5 +175,5 @@ EXTERN const struct st_lis331dl_vector_s * st_lis331dl_getreadings(struct st_lis
 #endif
 
 #endif /* __ASSEMBLY__ */
-#endif /* __INCLUDE_NUTTX_I2C_ST_LIS331DL_H */
+#endif /* __INCLUDE_NUTTX_SENSORS_ST_LIS331DL_H */
 
-- 
GitLab