diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-09-28 17:41:58 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-09-28 17:41:58 +0000 |
commit | 6cdcf5a87d0490f4cc30bc604acb649b7fb49183 (patch) | |
tree | 30377fa240d9f918fa8a7da5b9e54597ee9cf4a1 /nuttx/configs/sim | |
parent | 68bcc1949029864b8fb701984f8b73d046631db3 (diff) | |
download | px4-nuttx-6cdcf5a87d0490f4cc30bc604acb649b7fb49183.tar.gz px4-nuttx-6cdcf5a87d0490f4cc30bc604acb649b7fb49183.tar.bz2 px4-nuttx-6cdcf5a87d0490f4cc30bc604acb649b7fb49183.zip |
Add a simulated touchscreen driver
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3989 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/sim')
-rw-r--r-- | nuttx/configs/sim/README.txt | 125 | ||||
-rw-r--r-- | nuttx/configs/sim/nx11/Make.defs | 110 | ||||
-rw-r--r-- | nuttx/configs/sim/nx11/appconfig | 39 | ||||
-rw-r--r-- | nuttx/configs/sim/nx11/defconfig (renamed from nuttx/configs/sim/nx/defconfig-x11) | 12 | ||||
-rwxr-xr-x | nuttx/configs/sim/nx11/setenv.sh | 45 |
5 files changed, 298 insertions, 33 deletions
diff --git a/nuttx/configs/sim/README.txt b/nuttx/configs/sim/README.txt index 9d16abc37..d2fb92ccd 100644 --- a/nuttx/configs/sim/README.txt +++ b/nuttx/configs/sim/README.txt @@ -68,7 +68,7 @@ X11 Issues ^^^^^^^^^^ There is an X11-based framebuffer driver that you can use exercise the NuttX graphics -subsystem on the simulator (see the sim/nx configuration below). This may require a +subsystem on the simulator (see the sim/nx11 configuration below). This may require a lot of tinkering to get working, depending upon where your X11 installation stores libraries and header files and how it names libraries. @@ -87,6 +87,9 @@ Configurations ^^^^^^^^^^^^^^ mount + + Description + ----------- Configures to use examples/mount. This configuration may be selected as follows: @@ -95,6 +98,8 @@ mount nettest + Description + ----------- Configures to use examples/nettest. This configuration enables networking using the network TAP device. It may be selected via: @@ -118,6 +123,9 @@ nettest select the IP address that you want to use. nsh + + Description + ----------- Configures to use the NuttShell at examples/nsh. This configuration may be selected as follows: @@ -125,59 +133,112 @@ nsh ./configure.sh sim/nsh nx + + Description + ----------- Configures to use examples/nx. This configuration may be selected as follows: cd <nuttx-directory>/tools ./configure.sh sim/nx + Special Framebuffer Configuration + --------------------------------- Special simulated framebuffer configuration options: - CONFIG_SIM_X11FB - Use X11 window for framebuffer - CONFIG_SIM_FBHEIGHT - Height of the framebuffer in pixels - CONFIG_SIM_FBWIDTH - Width of the framebuffer in pixels. - CONFIG_SIM_FBBPP - Pixel depth in bits + CONFIG_SIM_FBHEIGHT - Height of the framebuffer in pixels + CONFIG_SIM_FBWIDTH - Width of the framebuffer in pixels. + CONFIG_SIM_FBBPP - Pixel depth in bits + + No Display! + ----------- + This version has NO DISPLAY and is only useful for debugging NX + internals in environments where X11 is not supported. There is + and additonal configuration that may be added to include an X11- + based simulated framebuffer driver: + + CONFIG_SIM_X11FB - Use X11 window for framebuffer + + See the nx11 configuration below for more information. + + Multi- and Single-User Modes + ---------------------------- + The default is the single-user NX implementation. To select + the multi-user NX implementation: + + CONFG_NX_MULTIUSER=y + CONFIG_DISABLE_MQUEUE=n + +nx11 + + Description + ----------- + Configures to use examples/nx. This configuration is similar + to the nx configuration except that it addes support for an X11- + based framebuffer driver. Of course, this configuration can only + be used in environments that support X11! (And it may not even + be usable in all of those environments without some "tweaking"). + + This configuration may be selected as follows: - NOTES: - - If CONFIG_SIM_X11FB is selected then the following are - needed + cd <nuttx-directory>/tools + ./configure.sh sim/nx11 - CONFIG_SIM_FBBPP (must match the resolution of the display). - CONFIG_FB_CMAP=y + Special Framebuffer Configuration + --------------------------------- + This configuration uses the same special simulated framebuffer + configuration options as the nx configuration: - My system has 24-bit color, but packed into 32-bit words so - the correct seeting of CONFIG_SIM_FBBPP is 32. + CONFIG_SIM_X11FB - Use X11 window for framebuffer + CONFIG_SIM_FBHEIGHT - Height of the framebuffer in pixels + CONFIG_SIM_FBWIDTH - Width of the framebuffer in pixels. + CONFIG_SIM_FBBPP - Pixel depth in bits - - For whatever value of CONFIG_SIM_FBBPP is selected, then - the corresponidng CONFIG_NX_DISABLE_*BPP setting must - not be disabled. + X11 Configuration + ----------------- + But now, since CONFIG_SIM_X11FB is also selected the following + definitions are needed - - The default in defconfig is to use a generic memory buffer - for the framebuffer. defconfig-x11 is an example with X11 - support enabled. To use this configuration you have to - configure as follows: + CONFIG_SIM_FBBPP (must match the resolution of the display). + CONFIG_FB_CMAP=y - cd tools - ./configure.sh sim/nx - cd .. - cp configs/sim/nx/defconfig-x11 .config + My system has 24-bit color, but packed into 32-bit words so + the correct seeting of CONFIG_SIM_FBBPP is 32. + + For whatever value of CONFIG_SIM_FBBPP is selected, the + corresponidng CONFIG_NX_DISABLE_*BPP setting must not be + disabled. - - The default is the single-user NX implementation. To select - the multi-user NX implementation: + Touchscreen Support + ------------------- + A X11 mouse-based touchscreen simulation can also be enabled + by setting: - CONFG_NX_MULTIUSER=y - CONFIG_DISABLE_MQUEUE=n + CONFIG_INPUT=y + CONFIG_SIM_TOUCHSCREEN=y - - To get the system to compile under various X11 installations - you may have to modify a few things. For example, in order - to find libXext, I had to make the following change under - Ubuntu 9.09: + X11 Build Issues + ---------------- + To get the system to compile under various X11 installations + you may have to modify a few things. For example, in order + to find libXext, I had to make the following change under + Ubuntu 9.09: cd /usr/lib/ sudo ln -s libXext.so.6.4.0 libXext.so + Multi- and Single-User Modes + ---------------------------- + The default is the single-user NX implementation. To select + the multi-user NX implementation: + + CONFG_NX_MULTIUSER=y + CONFIG_DISABLE_MQUEUE=n + ostest + Description + ----------- The "standard" NuttX examples/ostest configuration. This configuration may be selected as follows: @@ -186,6 +247,8 @@ ostest pashello + Description + ----------- Configures to use examples/pashello. This configuration may by selected as follows: diff --git a/nuttx/configs/sim/nx11/Make.defs b/nuttx/configs/sim/nx11/Make.defs new file mode 100644 index 000000000..642dfbaf8 --- /dev/null +++ b/nuttx/configs/sim/nx11/Make.defs @@ -0,0 +1,110 @@ +############################################################################ +# configs/sim/nx11/Make.defs +# +# Copyright (C) 2008, 2011 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. +# +############################################################################ + +include ${TOPDIR}/.config + +HOSTOS = ${shell uname -o 2>/dev/null || echo "Other"} + +ifeq ($(CONFIG_DEBUG_SYMBOLS),y) + ARCHOPTIMIZATION = -g +else + ARCHOPTIMIZATION = -O2 +endif + +ARCHCPUFLAGS = -fno-builtin +ARCHPICFLAGS = -fpic +ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow +ARCHDEFINES = +ARCHINCLUDES = -I. -isystem $(TOPDIR)/include +ARCHSCRIPT = + +CROSSDEV = +CC = $(CROSSDEV)gcc +CPP = $(CROSSDEV)gcc -E +LD = $(CROSSDEV)ld +AR = $(CROSSDEV)ar rcs +NM = $(CROSSDEV)nm +OBJCOPY = $(CROSSDEV)objcopy +OBJDUMP = $(CROSSDEV)objdump + +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ + $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe +CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +AFLAGS = $(CFLAGS) -D__ASSEMBLY__ + +OBJEXT = .o +LIBEXT = .a + +ifeq ($(HOSTOS),Cygwin) + EXEEXT = .exe +else + EXEEXT = +endif + +ifeq ("${CONFIG_DEBUG_SYMBOLS}","y") + LDFLAGS += -g +endif + +define PREPROCESS + @echo "CPP: $1->$2" + @$(CPP) $(CPPFLAGS) $1 -o $2 +endef + +define COMPILE + @echo "CC: $1" + @$(CC) -c $(CFLAGS) $1 -o $2 +endef + +define ASSEMBLE + @echo "AS: $1" + @$(CC) -c $(AFLAGS) $1 -o $2 +endef + +define ARCHIVE + echo "AR: $2"; \ + $(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; } +endef + +define CLEAN + @rm -f *.o *.a +endef + +MKDEP = $(TOPDIR)/tools/mkdeps.sh + +HOSTCC = gcc +HOSTINCLUDES = -I. +HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ + $(ARCHCPUFLAGS) $(HOSTINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe +HOSTLDFLAGS = diff --git a/nuttx/configs/sim/nx11/appconfig b/nuttx/configs/sim/nx11/appconfig new file mode 100644 index 000000000..d99648abc --- /dev/null +++ b/nuttx/configs/sim/nx11/appconfig @@ -0,0 +1,39 @@ +############################################################################ +# configs/sim/nx11/appconfig +# +# Copyright (C) 2011 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. +# +############################################################################ + +# Path to example in apps/examples containing the user_start entry point + +CONFIGURED_APPS += examples/nx + diff --git a/nuttx/configs/sim/nx/defconfig-x11 b/nuttx/configs/sim/nx11/defconfig index 9228786df..420231d48 100644 --- a/nuttx/configs/sim/nx/defconfig-x11 +++ b/nuttx/configs/sim/nx11/defconfig @@ -1,7 +1,7 @@ ############################################################################ -# sim/nx/defconfig +# sim/nx11/defconfig # -# Copyright (C) 2008, 2010 Gregory Nutt. All rights reserved. +# Copyright (C) 2008, 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 @@ -51,12 +51,20 @@ CONFIG_ARCH_BOARD_SIM=y # # Simulated framebuffer configuration +# CONFIG_SIM_X11FB=y CONFIG_SIM_FBWIDTH=480 CONFIG_SIM_FBHEIGHT=240 CONFIG_SIM_FBBPP=32 # +# Simulated touchscreen configuration +# (Set both of the following to 'y' to enable) +# +CONFIG_INPUT=n +CONFIG_SIM_TOUCHSCREEN=n + +# # General OS setup # # CONFIG_APPS_DIR - Identifies the relative path to the directory diff --git a/nuttx/configs/sim/nx11/setenv.sh b/nuttx/configs/sim/nx11/setenv.sh new file mode 100755 index 000000000..dd51ecec2 --- /dev/null +++ b/nuttx/configs/sim/nx11/setenv.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# sim/nx11/setenv.sh +# +# Copyright (C) 2008, 2011 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. +# + +if [ "$(basename $0)" = "setenv.sh" ] ; then + echo "You must source this script, not run it!" 1>&2 + exit 1 +fi + +if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi + +#export NUTTX_BIN= +#export PATH=${NUTTX_BIN}:/sbin:/usr/sbin:${PATH_ORIG} + +echo "PATH : ${PATH}" |