diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-10-18 13:52:21 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-10-18 13:52:21 +0000 |
commit | 0ee20483b0ff4150e09338821ef7e5a62eab2d47 (patch) | |
tree | 15c6069e637ef2c122e4a48db9e52dd4dde10bdd /nuttx/drivers | |
parent | 00a3fe0fd33b150ac10dd3e576fc4893abb61893 (diff) | |
download | px4-nuttx-0ee20483b0ff4150e09338821ef7e5a62eab2d47.tar.gz px4-nuttx-0ee20483b0ff4150e09338821ef7e5a62eab2d47.tar.bz2 px4-nuttx-0ee20483b0ff4150e09338821ef7e5a62eab2d47.zip |
Move some drivers to separate subdirectories
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2156 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers')
-rw-r--r-- | nuttx/drivers/Makefile | 23 | ||||
-rw-r--r-- | nuttx/drivers/README.txt | 56 | ||||
-rw-r--r-- | nuttx/drivers/pipes/Make.defs | 41 | ||||
-rw-r--r-- | nuttx/drivers/pipes/fifo.c (renamed from nuttx/drivers/fifo.c) | 4 | ||||
-rw-r--r-- | nuttx/drivers/pipes/pipe.c (renamed from nuttx/drivers/pipe.c) | 2 | ||||
-rw-r--r-- | nuttx/drivers/pipes/pipe_common.c (renamed from nuttx/drivers/pipe_common.c) | 2 | ||||
-rw-r--r-- | nuttx/drivers/pipes/pipe_common.h (renamed from nuttx/drivers/pipe_common.h) | 4 | ||||
-rw-r--r-- | nuttx/drivers/serial/Make.defs | 41 | ||||
-rw-r--r--[-rwxr-xr-x] | nuttx/drivers/serial/lowconsole.c (renamed from nuttx/drivers/lowconsole.c) | 2 | ||||
-rw-r--r-- | nuttx/drivers/serial/serial.c (renamed from nuttx/drivers/serial.c) | 2 | ||||
-rw-r--r-- | nuttx/drivers/serial/serialirq.c (renamed from nuttx/drivers/serialirq.c) | 2 |
11 files changed, 164 insertions, 15 deletions
diff --git a/nuttx/drivers/Makefile b/nuttx/drivers/Makefile index ad9dcaa0f..9155aedc1 100644 --- a/nuttx/drivers/Makefile +++ b/nuttx/drivers/Makefile @@ -39,12 +39,24 @@ ifeq ($(WINTOOL),y) INCDIROPT = -w endif +ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) +include serial/Make.defs +ROOTDEPPATH = --dep-path . +SERIALDEPPATH = --dep-path serial +endif + ifeq ($(CONFIG_NET),y) include net/Make.defs ROOTDEPPATH = --dep-path . NETDEPPATH = --dep-path net endif +ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) +include pipes/Make.defs +ROOTDEPPATH = --dep-path . +PIPEDEPPATH = --dep-path pipes +endif + ifeq ($(CONFIG_USBDEV),y) include usbdev/Make.defs ROOTDEPPATH = --dep-path . @@ -66,18 +78,17 @@ CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/driv endif endif -ASRCS = $(NET_ASRCS) $(USBDEV_ASRCS) $(MMCSD_ASRCS) $(BCH_ASRCS) +ASRCS = $(SERIAL_ASRCS) $(NET_ASRCS) $(PIPE_ASRCS) $(USBDEV_ASRCS) $(MMCSD_ASRCS) $(BCH_ASRCS) AOBJS = $(ASRCS:.S=$(OBJEXT)) CSRCS = ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) -CSRCS += dev_null.c dev_zero.c pipe.c fifo.c pipe_common.c \ - loop.c serial.c serialirq.c lowconsole.c can.c +CSRCS += dev_null.c dev_zero.c loop.c can.c ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y) CSRCS += ramdisk.c endif endif -CSRCS += $(NET_CSRCS) $(USBDEV_CSRCS) $(MMCSD_CSRCS) $(BCH_CSRCS) +CSRCS += $(SERIAL_CSRCS) $(NET_CSRCS) $(PIPE_CSRCS) $(USBDEV_CSRCS) $(MMCSD_CSRCS) $(BCH_CSRCS) COBJS = $(CSRCS:.c=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) @@ -85,7 +96,7 @@ OBJS = $(AOBJS) $(COBJS) BIN = libdrivers$(LIBEXT) -VPATH = net:usbdev:mmcsd:bch +VPATH = serial:net:pipes:usbdev:mmcsd:bch all: $(BIN) @@ -101,7 +112,7 @@ $(BIN): $(OBJS) done ; ) .depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) $(NETDEPPATH) $(USBDEVDEPPATH) $(MMCSDDEPPATH) $(BCHDEPPATH) \ + @$(MKDEP) $(ROOTDEPPATH) $(SERIALDEPPATH) $(NETDEPPATH) $(PIPEDEPPATH)$(USBDEVDEPPATH) $(MMCSDDEPPATH) $(BCHDEPPATH) \ $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep @touch $@ diff --git a/nuttx/drivers/README.txt b/nuttx/drivers/README.txt new file mode 100644 index 000000000..c7e42c9a7 --- /dev/null +++ b/nuttx/drivers/README.txt @@ -0,0 +1,56 @@ +README +^^^^^^ + +This directory contains various device drivers -- both block and +character drivers as well as other more specialized drivers. + +Files in this directory: +^^^^^^^^^^^^^^^^^^^^^^^ + +can.c + An unfinished CAN driver. + +dev_null.c and dev_zero.c + These files provide the standard /dev/null and /dev/zero devices. + See include/nuttx/fs.h for functions that should be called if you + want to register these devices (devnull_register() and + devzero_register()). + +loop.c + Supports the standard loop device that can be used to export a + file (or character device) as a block device. See losetup() and + loteardown() in include/nuttx/fs.h. + +ramdisk.c + Can be used to set up a block of memory or (read-only) FLASH as + a block driver that can be mounted as a files system. See + include/nuttx/ramdisk.h. + +Subdirectories of this directory: +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +bch/ + Contains logic that may be used to convert a block driver into + a character driver. This is the complementary conversion as that + performed by loop.c. See include/nuttx/fs.h for registration + information. + +mmcsd/ + Support for MMC/SD block drivers. At present, only SPI-based + MMC/SD is supported. See include/nuttx/mmcsd.h. + +net/ + Network interface drivers. See also include/nuttx/net.h + +pipes/ + FIFO and named pipe drivers. Standard interfaces are declared + in include/unistd.h + +serial/ + Front-ends character drivers for chip-specific UARTs. This provide + some TTY-like functionality and are commonly used (but not required for) + the NuttX system console. See include/nuttx/serial.h + +usbdev/ + USB device drivers. See include/nuttx/usb*.h + diff --git a/nuttx/drivers/pipes/Make.defs b/nuttx/drivers/pipes/Make.defs new file mode 100644 index 000000000..be16366bb --- /dev/null +++ b/nuttx/drivers/pipes/Make.defs @@ -0,0 +1,41 @@ +############################################################################ +# drivers/pipes/Make.defs +# +# Copyright (C) 2009 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt <spudmonkey@racsa.co.cr> +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name NuttX nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +PIPE_ASRCS = +ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) +PIPE_CSRCS = pipe.c fifo.c pipe_common.c +else +PIPE_CSRCS = +endif diff --git a/nuttx/drivers/fifo.c b/nuttx/drivers/pipes/fifo.c index 4e0bbf49c..bc9f629f5 100644 --- a/nuttx/drivers/fifo.c +++ b/nuttx/drivers/pipes/fifo.c @@ -1,7 +1,7 @@ /**************************************************************************** - * drivers/fifo.c + * drivers/pipes/fifo.c * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without diff --git a/nuttx/drivers/pipe.c b/nuttx/drivers/pipes/pipe.c index 4b052e40f..95049b354 100644 --- a/nuttx/drivers/pipe.c +++ b/nuttx/drivers/pipes/pipe.c @@ -1,5 +1,5 @@ /**************************************************************************** - * drivers/pipe.c + * drivers/pipes/pipe.c * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> diff --git a/nuttx/drivers/pipe_common.c b/nuttx/drivers/pipes/pipe_common.c index a0fd00b7a..60d028c00 100644 --- a/nuttx/drivers/pipe_common.c +++ b/nuttx/drivers/pipes/pipe_common.c @@ -1,5 +1,5 @@ /**************************************************************************** - * drivers/pipe_common.c + * drivers/pipes/pipe_common.c * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> diff --git a/nuttx/drivers/pipe_common.h b/nuttx/drivers/pipes/pipe_common.h index 56fa4865b..9e9f27fc1 100644 --- a/nuttx/drivers/pipe_common.h +++ b/nuttx/drivers/pipes/pipe_common.h @@ -1,7 +1,7 @@ /**************************************************************************** - * drivers/pipe_common.h + * drivers/pipe/pipe_common.h * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008i-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without diff --git a/nuttx/drivers/serial/Make.defs b/nuttx/drivers/serial/Make.defs new file mode 100644 index 000000000..089e797d4 --- /dev/null +++ b/nuttx/drivers/serial/Make.defs @@ -0,0 +1,41 @@ +############################################################################ +# drivers/serial/Make.defs +# +# Copyright (C) 2009 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt <spudmonkey@racsa.co.cr> +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name NuttX nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +SERIAL_ASRCS = +ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) +SERIAL_CSRCS = serial.c serialirq.c lowconsole.c +else +SERIAL_CSRCS = +endif diff --git a/nuttx/drivers/lowconsole.c b/nuttx/drivers/serial/lowconsole.c index 15f639391..1de76cc06 100755..100644 --- a/nuttx/drivers/lowconsole.c +++ b/nuttx/drivers/serial/lowconsole.c @@ -1,5 +1,5 @@ /**************************************************************************** - * drivers/lowconsole.c + * drivers/serial/lowconsole.c * * Copyright (C) 2008, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> diff --git a/nuttx/drivers/serial.c b/nuttx/drivers/serial/serial.c index a7cb42b20..df942a050 100644 --- a/nuttx/drivers/serial.c +++ b/nuttx/drivers/serial/serial.c @@ -1,5 +1,5 @@ /************************************************************************************ - * drivers/serial.c + * drivers/serial/serial.c * * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> diff --git a/nuttx/drivers/serialirq.c b/nuttx/drivers/serial/serialirq.c index d1a18b257..a4ce80944 100644 --- a/nuttx/drivers/serialirq.c +++ b/nuttx/drivers/serial/serialirq.c @@ -1,5 +1,5 @@ /************************************************************************************ - * drivers/serialirq.c + * drivers/serial/serialirq.c * * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> |