summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-09-25 22:04:51 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-09-25 22:04:51 +0000
commit98a7ce4560f7698e748e7e5461b9b26e4b45370d (patch)
tree494141ff73cb23e5f14ead9d76629034e8683519
parent367c0f77ee3e82d47676931a8eea0c96de6f57a7 (diff)
downloadnuttx-98a7ce4560f7698e748e7e5461b9b26e4b45370d.tar.gz
nuttx-98a7ce4560f7698e748e7e5461b9b26e4b45370d.tar.bz2
nuttx-98a7ce4560f7698e748e7e5461b9b26e4b45370d.zip
Hook in NxWidgets configuration logic; Add a untested ADS7843E touchscreen support for the Shenzhou board; Complete the Shenzhou NxWM configuration (also untested).
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5190 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--NxWidgets/Kconfig24
-rw-r--r--NxWidgets/README.txt6
-rw-r--r--NxWidgets/libnxwidgets/include/nxconfig.hxx12
-rw-r--r--apps/ChangeLog.txt5
-rw-r--r--apps/Kconfig4
-rw-r--r--apps/NxWidgets/Kconfig575
-rw-r--r--apps/NxWidgets/README.txt11
-rw-r--r--nuttx/ChangeLog7
-rw-r--r--nuttx/configs/shenzhou/nxwm/defconfig1196
-rw-r--r--nuttx/configs/shenzhou/src/Makefile4
-rw-r--r--nuttx/configs/shenzhou/src/up_touchscreen.c292
11 files changed, 2121 insertions, 15 deletions
diff --git a/NxWidgets/Kconfig b/NxWidgets/Kconfig
index c89b4936f..1d7852507 100644
--- a/NxWidgets/Kconfig
+++ b/NxWidgets/Kconfig
@@ -3,14 +3,14 @@
# see misc/tools/kconfig-language.txt.
#
-menuconfig NxWIDGETS
+menuconfig NXWIDGETS
bool "Enable NxWidgets"
default n
depends on NX && HAVE_CXX
---help---
Enable support for NxWidgets
-if NxWIDGETS
+if NXWIDGETS
comment "NX Server/Device Configuration"
config NXWIDGETS_DEVNO
@@ -88,7 +88,7 @@ config NXWIDGETS_BPP
BPP configuration supported by NX.
config NXWIDGETS_SIZEOFCHAR
- int "Size of a character (1 or 2 bytes)
+ int "Size of a character (1 or 2 bytes)"
range 1 2
---help---
Size of character {1 or 2 bytes}. Default Determined by
@@ -116,12 +116,12 @@ config NXWIDGETS_TNXARRAY_SIZEINCREMENT
config NXWIDGETS_DEFAULT_BACKGROUNDCOLOR
hex "Normal Background Color"
---help---
- Normal background color. Default: RGB(160,160,160)
+ Normal background color. Default: RGB(148,189,215)
config NXWIDGETS_DEFAULT_SELECTEDBACKGROUNDCOLOR
hex "Selected Background Color"
---help---
- Default selected background color. Default: RGB(120,192,192)
+ Default selected background color. Default: RGB(206,227,241)
config NXWIDGETS_DEFAULT_SHINEEDGECOLOR
hex "Shiny Edge Color"
@@ -131,7 +131,7 @@ config NXWIDGETS_DEFAULT_SHINEEDGECOLOR
config NXWIDGETS_DEFAULT_SHADOWEDGECOLOR
hex "Shadow Edge Color"
---help---
- Shadowed side border color. Default: RGB(0,0,0)
+ Shadowed side border color. Default: RGB(35,58,73)
config NXWIDGETS_DEFAULT_HIGHLIGHTCOLOR
hex "Highlight Color"
@@ -203,14 +203,14 @@ config NXWIDGETS_CURSORCONTROL_SIZE
endif
-menuconfig NxWM
+menuconfig NXWM
bool "Enable NxWM"
default n
- depends on NxWIDGETS && NX_MULTIUSER
+ depends on NXWIDGETS && NX_MULTIUSER
---help---
Enable support for the NuttX Tiny Window Manager (NxWM)
-if NxWM
+if NXWM
comment "General settings"
config NXWM_DEFAULT_FONTID
@@ -218,6 +218,12 @@ config NXWM_DEFAULT_FONTID
---help---
The NxWM default font ID. Default: NXFONT_DEFAULT
+config NXWM_UNITTEST
+ bool "NxWM Unit Test"
+ default n
+ ---help---
+ Enable Hooks for the NxWM Unit Test
+
comment "Color configuration"
config NXWM_DEFAULT_BACKGROUNDCOLOR
diff --git a/NxWidgets/README.txt b/NxWidgets/README.txt
index 7bb16820c..81f100d3d 100644
--- a/NxWidgets/README.txt
+++ b/NxWidgets/README.txt
@@ -53,6 +53,12 @@ license. See the COPYING file for details.
Directory Structure
===================
+Kconfig
+
+ This is a Kconfig file that should be provided at apps/NxWidgets/Kconfig.
+ When copied to that location, it will be used by the NuttX configuration
+ systems to configure settings for NxWidgets and NxWM
+
libnxwidgets
The source code, header files, and build environment for NxWidgets is
diff --git a/NxWidgets/libnxwidgets/include/nxconfig.hxx b/NxWidgets/libnxwidgets/include/nxconfig.hxx
index 67d359622..cd51229c2 100644
--- a/NxWidgets/libnxwidgets/include/nxconfig.hxx
+++ b/NxWidgets/libnxwidgets/include/nxconfig.hxx
@@ -104,13 +104,13 @@
* Default dynamic array parameters. Default: 16, 8
*
* CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR - Normal background color. Default:
- * MKRGB(160,160,160)
+ * MKRGB(148,189,215)
* CONFIG_NXWIDGETS_DEFAULT_SELECTEDBACKGROUNDCOLOR - Default selected background
- * color. Default: MKRGB(120,192,192)
+ * color. Default: MKRGB(206,227,241)
* CONFIG_NXWIDGETS_DEFAULT_SHINEEDGECOLOR - Shiny side boarder color. Default
* MKRGB(248,248,248)
* CONFIG_NXWIDGETS_DEFAULT_SHADOWEDGECOLOR - Shadowed side border color.
- * Default: MKRGB(0,0,0)
+ * Default: MKRGB(35,58,73)
* CONFIG_NXWIDGETS_DEFAULT_HIGHLIGHTCOLOR - Highlight color. Default:
* MKRGB(192,192,192)
* CONFIG_NXWIDGETS_DEFAULT_DISABLEDTEXTCOLOR - Text color on a disabled widget:
@@ -362,7 +362,7 @@
*/
#ifndef CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR
-# define CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR MKRGB(160,160,160)
+# define CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR MKRGB(148,189,215)
#endif
/**
@@ -370,7 +370,7 @@
*/
#ifndef CONFIG_NXWIDGETS_DEFAULT_SELECTEDBACKGROUNDCOLOR
-# define CONFIG_NXWIDGETS_DEFAULT_SELECTEDBACKGROUNDCOLOR MKRGB(120,192,192)
+# define CONFIG_NXWIDGETS_DEFAULT_SELECTEDBACKGROUNDCOLOR MKRGB(206,227,241)
#endif
/**
@@ -386,7 +386,7 @@
*/
#ifndef CONFIG_NXWIDGETS_DEFAULT_SHADOWEDGECOLOR
-# define CONFIG_NXWIDGETS_DEFAULT_SHADOWEDGECOLOR MKRGB(0,0,0)
+# define CONFIG_NXWIDGETS_DEFAULT_SHADOWEDGECOLOR MKRGB(35,58,73)
#endif
/**
diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt
index 46ccccc7f..d24494f54 100644
--- a/apps/ChangeLog.txt
+++ b/apps/ChangeLog.txt
@@ -340,3 +340,8 @@
Kate.
* apps/netutils/webserver/httpd.c: Add support for Keep-alive connections
(from Kate).
+ * apps/NxWidget/Kconfig: This is a kludge. I created this NxWidgets
+ directory that ONLY contains Kconfig. NxWidgets does not like in
+ either the nuttx/ or the apps/ source trees. This kludge makes it
+ possible to configure NxWidgets/NxWM without too much trouble (with
+ the tradeoff being a kind ugly structure and some maintenance issues).
diff --git a/apps/Kconfig b/apps/Kconfig
index 1f38c58ba..5543ba72d 100644
--- a/apps/Kconfig
+++ b/apps/Kconfig
@@ -27,6 +27,10 @@ menu "NSH Library"
source "$APPSDIR/nshlib/Kconfig"
endmenu
+menu "NxWidgets/NxWM"
+source "$APPSDIR/NxWidgets/Kconfig"
+endmenu
+
menu "System NSH Add-Ons"
source "$APPSDIR/system/Kconfig"
endmenu
diff --git a/apps/NxWidgets/Kconfig b/apps/NxWidgets/Kconfig
new file mode 100644
index 000000000..1d7852507
--- /dev/null
+++ b/apps/NxWidgets/Kconfig
@@ -0,0 +1,575 @@
+#
+# For a description of the syntax of this configuration file,
+# see misc/tools/kconfig-language.txt.
+#
+
+menuconfig NXWIDGETS
+ bool "Enable NxWidgets"
+ default n
+ depends on NX && HAVE_CXX
+ ---help---
+ Enable support for NxWidgets
+
+if NXWIDGETS
+comment "NX Server/Device Configuration"
+
+config NXWIDGETS_DEVNO
+ int "LCD Device Number"
+ default 0
+ ---help---
+ LCD device number (in case there are more than one LCDs connected).
+ Default: 0
+
+config NXWIDGETS_VPLANE
+ int "Plane Number"
+ default 0
+ ---help---
+ Only a single video plane is supported. Default: 0
+
+config NXWIDGETS_SERVERPRIO
+ int "NX Server priority"
+ default 51
+ ---help---
+ Priority of the NX server. This applies only if NX is configured in
+ multi-user mode (NX_MULTIUSER=y). Default: 51.
+
+ NOTE: Of the three priority definitions here, NXWIDGETS_SERVERPRIO
+ should have the highest priority to avoid data overrun race conditions.
+ Such errors would most likely appear as duplicated rows of data on the
+ display.
+
+config NXWIDGETS_SERVERSTACK
+ int "NX Server Stack Size"
+ default 2048
+ ---help---
+ NX server thread stack size (in multi-user mode). Default 2048
+
+config NXWIDGETS_CLIENTPRIO
+ int "NX Client Priority"
+ default 50
+ ---help---
+ The thread that calls CNxServer::connect() will be re-prioritized to
+ this priority. This applies only if NX is configured in multi-user
+ mode (NX_MULTIUSER=y). Default: 50
+
+config NXWIDGETS_LISTENERPRIO
+ int "NX Listener Priority"
+ default 50
+ ---help---
+ Priority of the NX event listener thread. This applies only if NX
+ is configured in multi-user mode (NX_MULTIUSER=y). Default: 50
+
+config NXWIDGETS_LISTENERSTACK
+ int "NX Listener Stack Size"
+ default 2048
+ ---help---
+ NX listener thread stack size (in multi-user mode). Default 2048
+
+config NXWIDGETS_EXTERNINIT
+ bool "Extern LCD Initialization"
+ ---help---
+ Define to support external display initialization.
+
+config NXWIDGET_EVENTWAIT
+ bool "Event Waiting"
+ default n
+ ---help---
+ Build in support for external window event, modal loop management
+ logic. This includes methods to wait for windows events to occur
+ so that looping logic can sleep until something interesting happens
+ with the window.
+
+comment "NXWidget Configuration"
+
+config NXWIDGETS_BPP
+ int "BPP"
+ ---help---
+ Supported bits-per-pixel {8, 16, 24, 32}. Default: The smallest
+ BPP configuration supported by NX.
+
+config NXWIDGETS_SIZEOFCHAR
+ int "Size of a character (1 or 2 bytes)"
+ range 1 2
+ ---help---
+ Size of character {1 or 2 bytes}. Default Determined by
+ NXWIDGETS_SIZEOFCHAR
+
+comment "NXWidget Default Values"
+
+config NXWIDGETS_DEFAULT_FONTID
+ int "Default Font ID"
+ ---help---
+ Default font ID. Default: NXFONT_DEFAULT
+
+config NXWIDGETS_TNXARRAY_INITIALSIZE
+ int "Initial Size of Dynamic Arrays"
+ default 16
+ ---help---
+ Default dynamic array size (in entries). Default: 16
+
+config NXWIDGETS_TNXARRAY_SIZEINCREMENT
+ int "Dyanamic Array Reallocation Size Increment"
+ default 8
+ ---help---
+ Default dynamic array realloctino increment (in entries). Default: 8
+
+config NXWIDGETS_DEFAULT_BACKGROUNDCOLOR
+ hex "Normal Background Color"
+ ---help---
+ Normal background color. Default: RGB(148,189,215)
+
+config NXWIDGETS_DEFAULT_SELECTEDBACKGROUNDCOLOR
+ hex "Selected Background Color"
+ ---help---
+ Default selected background color. Default: RGB(206,227,241)
+
+config NXWIDGETS_DEFAULT_SHINEEDGECOLOR
+ hex "Shiny Edge Color"
+ ---help---
+ Shiny side boarder color. Default: RGB(248,248,248)
+
+config NXWIDGETS_DEFAULT_SHADOWEDGECOLOR
+ hex "Shadow Edge Color"
+ ---help---
+ Shadowed side border color. Default: RGB(35,58,73)
+
+config NXWIDGETS_DEFAULT_HIGHLIGHTCOLOR
+ hex "Highlight Color"
+ ---help---
+ Highlight color. Default: RGB(192,192,192)
+
+config NXWIDGETS_DEFAULT_DISABLEDTEXTCOLOR
+ hex "Disabled Text Color"
+ ---help---
+ Text color on a disabled widget: Default: RGB(192,192,192)
+
+config NXWIDGETS_DEFAULT_ENABLEDTEXTCOLOR
+ hex "Enabled Text Color"
+ ---help---
+ Text color on a enabled widget. Default: RGB(248,248,248)
+
+config NXWIDGETS_DEFAULT_SELECTEDTEXTCOLOR
+ hex "Selected Text Color"
+ ---help---
+ Text color on a selected widget. Default: RGB(0,0,0)
+
+config NXWIDGETS_DEFAULT_FONTCOLOR
+ hex "Default Font Color"
+ ---help---
+ Default font color. Default: RGB(255,255,255)
+
+config NXWIDGETS_TRANSPARENT_COLOR
+ hex "Transparent Color"
+ ---help---
+ Transparent color. Default: RGB(0,0,0)
+
+comment "Keypad behavior"
+
+config NXWIDGETS_FIRST_REPEAT_TIME
+ int "First Repeat Time"
+ default 500
+ ---help---
+ Time taken before a key starts repeating (in milliseconds). Default: 500
+
+config NXWIDGETS_CONTINUE_REPEAT_TIME
+ int "Continue Repeat Time"
+ default 200
+ ---help---
+ Time taken before a repeating key repeats again (in milliseconds).
+ Default: 200
+
+config NXWIDGETS_DOUBLECLICK_TIME
+ int "Double Click Time"
+ default 350
+ ---help---
+ Left button release-press time for double click (in milliseconds).
+ Default: 350
+
+config NXWIDGETS_KBDBUFFER_SIZE
+ int "Keybard Buffer Size"
+ default 16
+ ---help---
+ Size of incoming character buffer, i.e., the maximum number of
+ characters that can be entered between NX polling cycles without
+ losing data.
+
+config NXWIDGETS_CURSORCONTROL_SIZE
+ int "Cursor Control Buffer Size"
+ default 4
+ ---help---
+ Size of incoming cursor control buffer, i.e., the maximum number
+ of cursor controls that can between entered by NX polling cycles
+ without losing data. Default: 4
+
+endif
+
+menuconfig NXWM
+ bool "Enable NxWM"
+ default n
+ depends on NXWIDGETS && NX_MULTIUSER
+ ---help---
+ Enable support for the NuttX Tiny Window Manager (NxWM)
+
+if NXWM
+comment "General settings"
+
+config NXWM_DEFAULT_FONTID
+ int "Font ID"
+ ---help---
+ The NxWM default font ID. Default: NXFONT_DEFAULT
+
+config NXWM_UNITTEST
+ bool "NxWM Unit Test"
+ default n
+ ---help---
+ Enable Hooks for the NxWM Unit Test
+
+comment "Color configuration"
+
+config NXWM_DEFAULT_BACKGROUNDCOLOR
+ hex "Background Color"
+ ---help---
+ Normal background color. Default: RGB(148,189,215)
+
+config NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR
+ hex "Normal Background Color"
+ ---help---
+ Select background color. Default: RGB(206,227,241)
+
+config NXWM_DEFAULT_SHINEEDGECOLOR
+ hex "Shiny Edge Color"
+ ---help---
+ Color of the bright edge of a border. Default: RGB(255,255,255)
+
+config NXWM_DEFAULT_SHADOWEDGECOLOR
+ hex "Shadow Edge Color"
+ ---help---
+ Color of the shadowed edge of a border. Default: RGB(0,0,0)
+
+config NXWM_DEFAULT_FONTCOLOR
+ hex "Default Font Color"
+ ---help---
+ Default fong color. Default: RGB(0,0,0)
+
+config NXWM_TRANSPARENT_COLOR
+ hex "Transparent Color"
+ ---help---
+ The "transparent" color. Default: RGB(0,0,0)
+
+comment "Horizontal and vertical spacing of icons in the task bar"
+
+config NXWM_TASKBAR_VSPACING
+ int "Vertical Spacing"
+ default 2
+ ---help---
+ Vertical spacing. Default: 2 pixels
+
+config NXWM_TASKBAR_HSPACING
+ int "Horizontal Spacing"
+ default 2
+ ---help---
+ Horizontal spacing. Default: 2 rows
+
+choice NXWM_TASKBAR_LOCATION
+ prompt "Taskbar Location"
+ default NXWM_TASKBAR_TOP
+
+config NXWM_TASKBAR_TOP
+ bool "Top"
+ ---help---
+ Task bar is at the top of the display
+
+config NXWM_TASKBAR_BOTTOM
+ bool "Bottom"
+ ---help---
+ Task bar is at the bottom of the display
+
+config NXWM_TASKBAR_LEFT
+ bool "Left"
+ ---help---
+ Task bar is on the left side of the display
+
+config NXWM_TASKBAR_RIGHT
+ bool "Right"
+ ---help---
+ Task bar is on the right side of the display
+
+endchoice
+
+config NXWM_TASKBAR_WIDTH
+ int "Taskbar Width"
+ ---help---
+ Task bar thickness (either vertical or horizontal). Default: 25 + 2*spacing
+
+comment "Tool Bar Configuration"
+
+config NXWM_TOOLBAR_HEIGHT
+ int "Toolbar Height"
+ ---help---
+ The height of the tool bar in each application window. At present,
+ all icons are 21 pixels in height and, hence, require a task bar of
+ at least that size.
+
+comment "Background Image"
+
+config NXWM_BACKGROUND_IMAGE
+ string "Background Image"
+ ---help---
+ The name of the image to use in the background window. Default:
+ NXWidgets::g_nuttxBitmap
+
+comment "Start Window Configuration"
+
+comment "Horizontal and vertical spacing of icons in the task bar"
+
+config NXWM_STARTWINDOW_VSPACING
+ int "Vertical Spacing"
+ default 4
+ ---help---
+ Vertical spacing. Default: 4 pixels
+
+config NXWM_STARTWINDOW_HSPACING
+ int "Horizontal Spacing"
+ default 4
+ ---help---
+ Horizontal spacing. Default: 4 rows
+
+config NXWM_STARTWINDOW_ICON
+ string "StartWindow Icon"
+ ---help---
+ The glyph to use as the start window icon. Default: NxWM::g_playBitmap
+
+config NXWM_STARTWINDOW_MQNAME
+ string "Message Queue Name"
+ default "/dev/nxwm"
+ ---help---
+ The well known name of the message queue. Used to communicated from
+ CWindowMessenger to the start window thread. Default: "/dev/nxwm"
+
+config NXWM_STARTWINDOW_MXMSGS
+ int "Max Messages"
+ default 32
+ ---help---
+ The maximum number of messages to queue before blocking. Defualt 32
+
+config NXWM_STARTWINDOW_MXMPRIO
+ int "Message Priority"
+ default 42
+ ---help---
+ The message priority. Default: 42.
+
+config NXWM_STARTWINDOW_PRIO
+ int "StartWindow Task Priority"
+ default 50
+ ---help---
+ Priority of the StartWindow task. Default: 50.
+
+ NOTE: This priority should be less than NXWIDGETS_SERVERPRIO or else
+ there may be data overrun errors. Such errors would most likely appear
+ as duplicated rows of data on the display.
+
+config NXWM_STARTWINDOW_STACKSIZE
+ int "StartWindow Task Stack Size"
+ default 2048
+ ---help---
+ The stack size to use when starting the StartWindow task. Default:
+ 2048 bytes.
+
+comment "NxConsole Window Configuration"
+
+config NXWM_NXCONSOLE_PRIO
+ int "NxConsole Task Priority"
+ default 50
+ ---help---
+ Priority of the NxConsole task. Default: 50.
+
+ NOTE: This priority should be less than NXWIDGETS_SERVERPRIO or
+ else there may be data overrun errors. Such errors would most likely
+ appear as duplicated rows of data on the display.
+
+config NXWM_NXCONSOLE_STACKSIZE
+ int "NxConsole Task Stack Size"
+ default 2048
+ ---help---
+ The stack size to use when starting the NxConsole task. Default:
+ 2048 bytes.
+
+config NXWM_NXCONSOLE_WCOLOR
+ hex "NxConsole Background Color"
+ ---help---
+ The color of the NxConsole window background. Default:
+ RGB(192,192,192)
+
+config NXWM_NXCONSOLE_FONTCOLOR
+ hex "NxConsole Font Color"
+ ---help---
+ The color of the fonts to use in the NxConsole window.
+ Default: RGB(0,0,0)
+
+config NXWM_NXCONSOLE_FONTID
+ int "NxConsole Font ID"
+ ---help---
+ The ID of the font to use in the NxConsole window. Default:
+ NXWM_DEFAULT_FONTID
+
+config NXWM_NXCONSOLE_ICON
+ string "NxConsole Icon"
+ ---help---
+ The glyph to use as the NxConsole icon. Default: NxWM::g_cmdBitmap
+
+config NXWM_TOUCHSCREEN
+ bool "Touchscreen Support"
+ default y if INPUT
+ default n if !INPUT
+ ---help---
+ Define to build in touchscreen support.
+
+if NXWM_TOUCHSCREEN
+comment "Touchscreen device settings"
+
+config NXWM_TOUCHSCREEN_DEVNO
+ int "Touchscreen Device Number"
+ default 0
+ ---help---
+ Touchscreen device minor number, i.e., the N in /dev/inputN.
+ Default: 0
+
+config NXWM_TOUCHSCREEN_DEVPATH
+ string "Touchscreen Device Path"
+ default "/dev/input0"
+ ---help---
+ The full path to the touchscreen device. Default: "/dev/input0"
+
+config NXWM_TOUCHSCREEN_SIGNO
+ int "Touchscreen Signal Number"
+ default 5
+ ---help---
+ The realtime signal used to wake up the touchscreen listener
+ thread. Default: 5
+
+config NXWM_TOUCHSCREEN_LISTENERPRIO
+ int "Touchscreen Listener Task Priority"
+ default 50
+ ---help---
+ Priority of the touchscreen listener thread. Default: 50
+
+config NXWM_TOUCHSCREEN_LISTENERSTACK
+ int "Touchscreen Listener Task Stack Size"
+ ---help---
+ Touchscreen listener thread stack size. Default 1024
+
+endif
+
+config NXWM_KEYBOARD
+ bool "Keyboard Support"
+ default n
+ ---help---
+ Define to build in touchscreen support.
+
+if NXWM_KEYBOARD
+comment "Keyboard device settings"
+
+config NXWM_KEYBOARD_DEVPATH
+ string "Keyboard Device Path"
+ default "/dev/console"
+ ---help---
+ The full path to the touchscreen device. Default: "/dev/console"
+
+config NXWM_KEYBOARD_SIGNO
+ int "Keyboard Task Signal Number"
+ default 6
+ ---help---
+ The realtime signal used to wake up the touchscreen listener thread.
+ Default: 6
+
+config NXWM_KEYBOARD_BUFSIZE
+ int "Keyboard Buffer Size"
+ default 16
+ ---help---
+ The size of the keyboard read data buffer. Default: 16
+
+config NXWM_KEYBOARD_LISTENERPRIO
+ int "Keyboard Listener Task Priority"
+ default 50
+ ---help---
+ Priority of the touchscreen listener thread. Default: 50
+
+config NXWM_KEYBOARD_LISTENERSTACK
+ int "Keyboard Listener Task Stack Size"
+ default 2048
+ ---help---
+ Keyboard listener thread stack size. Default: 1024
+
+endif
+
+comment "Calibration display settings"
+
+config NXWM_CALIBRATION_BACKGROUNDCOLOR
+ hex "Background Color"
+ ---help---
+ The background color of the touchscreen calibration display.
+ Default: Same as NXWM_DEFAULT_BACKGROUNDCOLOR.
+
+config NXWM_CALIBRATION_LINECOLOR
+ hex "Line Color"
+ ---help---
+ The color of the lines used in the touchscreen calibration display.
+ Default: RGB(0, 0, 128) (dark blue)
+
+config NXWM_CALIBRATION_CIRCLECOLOR
+ hex "Normal Circle Color"
+ ---help---
+ The color of the circle in the touchscreen calibration display.
+ Default: RGB(255, 255, 255) (white)
+
+config NXWM_CALIBRATION_TOUCHEDCOLOR
+ hex "Touched Circle Color"
+ ---help---
+ The color of the circle in the touchscreen calibration display after
+ the touch is recorder. Default: RGB(255, 255, 96) (very light yellow)
+
+config NXWM_CALIBRATION_ICON
+ string "Callibration Icon"
+ ---help---
+ The ICON to use for the touchscreen calibration application. Default:
+ NxWM::g_calibrationBitmap
+
+config NXWM_CALIBRATION_SIGNO
+ int "Calibration Signal Number"
+ default 5
+ ---help---
+ The realtime signal used to wake up the touchscreen calibration
+ thread. Default: 5
+
+config NXWM_CALIBRATION_LISTENERPRIO
+ int "Calibration Task Priority"
+ default 50
+ ---help---
+ Priority of the calibration listener thread. Default: 50
+
+config NXWM_CALIBRATION_LISTENERSTACK
+ int "Calibration Task Stack Size"
+ default 2048
+ ---help---
+ Calibration listener thread stack size. Default 2048
+
+comment "Calibration display settings"
+
+config NXWM_HEXCALCULATOR_BACKGROUNDCOLOR
+ hex "Calculator Background Color"
+ ---help---
+ The background color of the calculator display. Default: Same
+ as NXWM_DEFAULT_BACKGROUNDCOLOR
+
+config NXWM_HEXCALCULATOR_ICON
+ string "Calculator Icon"
+ ---help---
+ The ICON to use for the hex calculator application. Default:
+ NxWM::g_calculatorBitmap
+
+config NXWM_HEXCALCULATOR_FONTID
+ int "Calculator Font ID"
+ ---help---
+ The font used with the calculator. Default: NXWM_DEFAULT_FONTID
+
+endif
diff --git a/apps/NxWidgets/README.txt b/apps/NxWidgets/README.txt
new file mode 100644
index 000000000..835ea781e
--- /dev/null
+++ b/apps/NxWidgets/README.txt
@@ -0,0 +1,11 @@
+apps/NxWidgets README File
+==========================
+
+The NxWidgets and NxWM libraries don't physically reside in the apps/ source
+tree. The source code actually resides at the top level NxWidgets/
+directory. This directory is just a kludge...it is here only support
+configuration of NxWidgets and NxWM.
+
+The only files that reside in this directory are (1) this README.txt file
+and (2) the Kconfig file to support NxWidgets configuration. This is a
+duplicate of the NxWidgets file that you can file at NxWidgets/Kconfig.
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index 56929ad2f..c64112ecb 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -3400,3 +3400,10 @@
* configs/shenzhou/src/up_lcd.c: Oops. Shenzhou LCD does not
have an SSD1289 controller. Its an ILI93xx. Ported the
STM3240G-EVAL ILI93xx driver to work on the Shenzhou board.
+ * configs/shenzhou/nxwm: Added an NxWM configuratino for the
+ Shenzhou board. This is untested on initial check-in. It will
+ be used to verify the Shenzhou LCD driver (and eventually the
+ touchscreen driver).
+ * configs/shenzhou/src/up_touchscreen.c: Add ADS7843E touchscreen
+ support for the Shenzhou board. The initial check-in is untested
+ and basically a clone of the the touchscreen support fro the SAM-3U.
diff --git a/nuttx/configs/shenzhou/nxwm/defconfig b/nuttx/configs/shenzhou/nxwm/defconfig
new file mode 100644
index 000000000..805d54739
--- /dev/null
+++ b/nuttx/configs/shenzhou/nxwm/defconfig
@@ -0,0 +1,1196 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# Nuttx/ Configuration
+#
+CONFIG_NUTTX_NEWCONFIG=y
+
+#
+# Build Setup
+#
+# CONFIG_EXPERIMENTAL is not set
+
+#
+# Build Configuration
+#
+# CONFIG_APPS_DIR="../apps"
+# CONFIG_BUILD_2PASS is not set
+
+#
+# Binary Output Formats
+#
+# CONFIG_RRLOAD_BINARY is not set
+CONFIG_INTELHEX_BINARY=y
+# CONFIG_MOTOROLA_SREC is not set
+# CONFIG_RAW_BINARY is not set
+
+#
+# Customize Header Files
+#
+# CONFIG_ARCH_STDBOOL_H is not set
+# CONFIG_ARCH_MATH_H is not set
+# CONFIG_ARCH_STDARG_H is not set
+
+#
+# Debug Options
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_SYMBOLS is not set
+
+#
+# System Type
+#
+# CONFIG_ARCH_8051 is not set
+CONFIG_ARCH_ARM=y
+# CONFIG_ARCH_AVR is not set
+# CONFIG_ARCH_HC is not set
+# CONFIG_ARCH_MIPS is not set
+# CONFIG_ARCH_RGMP is not set
+# CONFIG_ARCH_SH is not set
+# CONFIG_ARCH_SIM is not set
+# CONFIG_ARCH_X86 is not set
+# CONFIG_ARCH_Z16 is not set
+# CONFIG_ARCH_Z80 is not set
+CONFIG_ARCH="arm"
+# CONFIG_ARCH_CHIP_C5471 is not set
+# CONFIG_ARCH_CHIP_CALYPSO is not set
+# CONFIG_ARCH_CHIP_DM320 is not set
+# CONFIG_ARCH_CHIP_IMX is not set
+# CONFIG_ARCH_CHIP_KINETIS is not set
+# CONFIG_ARCH_CHIP_LM3S is not set
+# CONFIG_ARCH_CHIP_LPC17XX is not set
+# CONFIG_ARCH_CHIP_LPC214X is not set
+# CONFIG_ARCH_CHIP_LPC2378 is not set
+# CONFIG_ARCH_CHIP_LPC31XX is not set
+# CONFIG_ARCH_CHIP_LPC43XX is not set
+# CONFIG_ARCH_CHIP_SAM3U is not set
+CONFIG_ARCH_CHIP_STM32=y
+# CONFIG_ARCH_CHIP_STR71X is not set
+CONFIG_ARCH_CORTEXM3=y
+CONFIG_ARCH_FAMILY="armv7-m"
+CONFIG_ARCH_CHIP="stm32"
+CONFIG_ARCH_HAVE_MPU=y
+# CONFIG_ARMV7M_MPU is not set
+CONFIG_ARCH_IRQPRIO=y
+CONFIG_BOARD_LOOPSPERMSEC=10926
+# CONFIG_ARCH_CALIBRATION is not set
+# CONFIG_SERIAL_TERMIOS is not set
+# CONFIG_NET_MULTICAST is not set
+
+#
+# STM32 Configuration Options
+#
+# CONFIG_ARCH_CHIP_STM32F100C8 is not set
+# CONFIG_ARCH_CHIP_STM32F100CB is not set
+# CONFIG_ARCH_CHIP_STM32F100R8 is not set
+# CONFIG_ARCH_CHIP_STM32F100RB is not set
+# CONFIG_ARCH_CHIP_STM32F100V8 is not set
+# CONFIG_ARCH_CHIP_STM32F100VB is not set
+# CONFIG_ARCH_CHIP_STM32F103RET6 is not set
+# CONFIG_ARCH_CHIP_STM32F103VCT6 is not set
+# CONFIG_ARCH_CHIP_STM32F103VET6 is not set
+# CONFIG_ARCH_CHIP_STM32F103ZET6 is not set
+# CONFIG_ARCH_CHIP_STM32F105VBT7 is not set
+CONFIG_ARCH_CHIP_STM32F107VC=y
+# CONFIG_ARCH_CHIP_STM32F207IG is not set
+# CONFIG_ARCH_CHIP_STM32F405RG is not set
+# CONFIG_ARCH_CHIP_STM32F405VG is not set
+# CONFIG_ARCH_CHIP_STM32F405ZG is not set
+# CONFIG_ARCH_CHIP_STM32F407VE is not set
+# CONFIG_ARCH_CHIP_STM32F407VG is not set
+# CONFIG_ARCH_CHIP_STM32F407ZE is not set
+# CONFIG_ARCH_CHIP_STM32F407ZG is not set
+# CONFIG_ARCH_CHIP_STM32F407IE is not set
+# CONFIG_ARCH_CHIP_STM32F407IG is not set
+CONFIG_STM32_STM32F10XX=y
+CONFIG_STM32_CONNECTIVITYLINE=y
+CONFIG_STM32_CODESOURCERYW=y
+# CONFIG_STM32_CODESOURCERYL is not set
+# CONFIG_STM32_ATOLLIC_LITE is not set
+# CONFIG_STM32_ATOLLIC_PRO is not set
+# CONFIG_STM32_DEVKITARM is not set
+# CONFIG_STM32_RAISONANCE is not set
+# CONFIG_STM32_BUILDROOT is not set
+# CONFIG_STM32_DFU is not set
+
+#
+# STM32 Peripheral Support
+#
+# CONFIG_STM32_ADC1 is not set
+# CONFIG_STM32_ADC2 is not set
+# CONFIG_STM32_ADC3 is not set
+# CONFIG_STM32_CRC is not set
+# CONFIG_STM32_DMA1 is not set
+# CONFIG_STM32_DMA2 is not set
+# CONFIG_STM32_BKP is not set
+# CONFIG_STM32_CAN1 is not set
+# CONFIG_STM32_DAC1 is not set
+# CONFIG_STM32_DAC2 is not set
+CONFIG_STM32_ETHMAC=y
+CONFIG_STM32_I2C1=y
+# CONFIG_STM32_I2C2 is not set
+# CONFIG_STM32_IWDG is not set
+CONFIG_STM32_PWR=y
+# CONFIG_STM32_SPI1 is not set
+# CONFIG_STM32_SPI2 is not set
+# CONFIG_STM32_SPI4 is not set
+# CONFIG_STM32_TIM1 is not set
+# CONFIG_STM32_TIM2 is not set
+# CONFIG_STM32_TIM3 is not set
+# CONFIG_STM32_TIM4 is not set
+# CONFIG_STM32_TIM5 is not set
+# CONFIG_STM32_TIM6 is not set
+# CONFIG_STM32_TIM7 is not set
+# CONFIG_STM32_TIM8 is not set
+# CONFIG_STM32_USART1 is not set
+CONFIG_STM32_USART2=y
+# CONFIG_STM32_USART3 is not set
+# CONFIG_STM32_UART4 is not set
+# CONFIG_STM32_UART5 is not set
+# CONFIG_STM32_USB is not set
+# CONFIG_STM32_WWDG is not set
+CONFIG_STM32_I2C=y
+
+#
+# Alternate Pin Mapping
+#
+# CONFIG_STM32_USART2_REMAP is not set
+# CONFIG_STM32_I2C1_REMAP is not set
+# CONFIG_STM32_ETH_REMAP is not set
+# CONFIG_STM32_JTAG_DISABLE is not set
+CONFIG_STM32_JTAG_FULL_ENABLE=y
+# CONFIG_STM32_JTAG_NOJNTRST_ENABLE is not set
+# CONFIG_STM32_JTAG_SW_ENABLE is not set
+# CONFIG_STM32_FORCEPOWER is not set
+# CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG is not set
+
+#
+# I2C Configuration
+#
+# CONFIG_STM32_I2C_DYNTIMEO is not set
+CONFIG_STM32_I2CTIMEOSEC=0
+CONFIG_STM32_I2CTIMEOMS=500
+CONFIG_STM32_I2CTIMEOTICKS=500
+# CONFIG_STM32_I2C_DUTY16_9 is not set
+
+#
+# Ethernet MAC configuration
+#
+CONFIG_STM32_PHYADDR=0
+CONFIG_STM32_MII=y
+CONFIG_STM32_MII_MCO=y
+# CONFIG_STM32_MII_EXTCLK is not set
+CONFIG_STM32_AUTONEG=y
+CONFIG_STM32_PHYSR=16
+# CONFIG_STM32_PHYSR_ALTCONFIG is not set
+CONFIG_STM32_PHYSR_SPEED=0x0002
+CONFIG_STM32_PHYSR_100MBPS=0x0000
+CONFIG_STM32_PHYSR_MODE=0x0004
+CONFIG_STM32_PHYSR_FULLDUPLEX=0x0004
+# CONFIG_STM32_ETH_PTP is not set
+
+#
+# USB Host Configuration
+#
+
+#
+# Architecture Options
+#
+# CONFIG_ARCH_NOINTC is not set
+# CONFIG_ARCH_DMA is not set
+CONFIG_ARCH_STACKDUMP=y
+
+#
+# Board Settings
+#
+CONFIG_DRAM_START=0x20000000
+CONFIG_DRAM_SIZE=196608
+CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
+CONFIG_ARCH_INTERRUPTSTACK=0
+
+#
+# Boot options
+#
+# CONFIG_BOOT_RUNFROMEXTSRAM is not set
+CONFIG_BOOT_RUNFROMFLASH=y
+# CONFIG_BOOT_RUNFROMISRAM is not set
+# CONFIG_BOOT_RUNFROMSDRAM is not set
+# CONFIG_BOOT_COPYTORAM is not set
+
+#
+# Board Selection
+#
+# CONFIG_ARCH_BOARD_OLIMEX_STM32P107 is not set
+CONFIG_ARCH_BOARD_SHENZHOU=y
+# CONFIG_ARCH_BOARD_CUSTOM is not set
+CONFIG_ARCH_BOARD="shenzhou"
+
+#
+# Common Board Options
+#
+CONFIG_ARCH_HAVE_LEDS=y
+CONFIG_ARCH_LEDS=y
+CONFIG_ARCH_HAVE_BUTTONS=y
+# CONFIG_ARCH_BUTTONS is not set
+CONFIG_ARCH_HAVE_IRQBUTTONS=y
+CONFIG_NSH_MMCSDMINOR=0
+
+#
+# Board-Specific Options
+#
+
+#
+# LCD Controller Selection
+#
+
+#
+# Disable Unused LCD Controllers
+#
+# CONFIG_STM32_ILI1505_DISABLE is not set
+# CONFIG_STM32_ILI9300_DISABLE is not set
+# CONFIG_STM32_ILI9320_DISABLE is not set
+# CONFIG_STM32_ILI9321_DISABLE is not set
+# CONFIG_STM32_ILI9325_DISABLE is not set
+# CONFIG_STM32_ILI9328_DISABLE is not set
+# CONFIG_STM32_ILI9331_DISABLE is not set
+# CONFIG_STM32_ILI9919_DISABLE is not set
+
+#
+# RTOS Features
+#
+CONFIG_MSEC_PER_TICK=10
+CONFIG_RR_INTERVAL=200
+# CONFIG_SCHED_INSTRUMENTATION is not set
+CONFIG_TASK_NAME_SIZE=0
+# CONFIG_JULIAN_TIME is not set
+CONFIG_START_YEAR=2012
+CONFIG_START_MONTH=5
+CONFIG_START_DAY=28
+CONFIG_DEV_CONSOLE=y
+# CONFIG_DEV_LOWCONSOLE is not set
+# CONFIG_MUTEX_TYPES is not set
+# CONFIG_PRIORITY_INHERITANCE is not set
+# CONFIG_FDCLONE_DISABLE is not set
+# CONFIG_FDCLONE_STDIO is not set
+CONFIG_SDCLONE_DISABLE=y
+CONFIG_SCHED_WORKQUEUE=y
+CONFIG_SCHED_WORKPRIORITY=192
+CONFIG_SCHED_WORKPERIOD=50000
+CONFIG_SCHED_WORKSTACKSIZE=2048
+CONFIG_SIG_SIGWORK=4
+# CONFIG_SCHED_LPWORK is not set
+CONFIG_SCHED_WAITPID=y
+# CONFIG_SCHED_ATEXIT is not set
+CONFIG_SCHED_ONEXIT=y
+CONFIG_SCHED_ONEXIT_MAX=1
+CONFIG_USER_ENTRYPOINT="nxwm_main"
+CONFIG_DISABLE_OS_API=y
+# CONFIG_DISABLE_CLOCK is not set
+# CONFIG_DISABLE_POSIX_TIMERS is not set
+# CONFIG_DISABLE_PTHREAD is not set
+# CONFIG_DISABLE_SIGNALS is not set
+# CONFIG_DISABLE_MQUEUE is not set
+# CONFIG_DISABLE_MOUNTPOINT is not set
+# CONFIG_DISABLE_ENVIRON is not set
+CONFIG_DISABLE_POLL=y
+
+#
+# Sizes of configurable things (0 disables)
+#
+CONFIG_MAX_TASKS=16
+CONFIG_MAX_TASK_ARGS=4
+CONFIG_NPTHREAD_KEYS=4
+CONFIG_NFILE_DESCRIPTORS=12
+CONFIG_NFILE_STREAMS=12
+CONFIG_NAME_MAX=32
+CONFIG_PREALLOC_MQ_MSGS=32
+CONFIG_MQ_MAXMSGSIZE=48
+CONFIG_MAX_WDOGPARMS=2
+CONFIG_PREALLOC_WDOGS=8
+CONFIG_PREALLOC_TIMERS=4
+
+#
+# Stack and heap information
+#
+# CONFIG_CUSTOM_STACK is not set
+CONFIG_IDLETHREAD_STACKSIZE=1024
+CONFIG_USERMAIN_STACKSIZE=2048
+CONFIG_PTHREAD_STACK_MIN=256
+CONFIG_PTHREAD_STACK_DEFAULT=2048
+
+#
+# Device Drivers
+#
+CONFIG_DEV_NULL=y
+# CONFIG_DEV_ZERO is not set
+# CONFIG_LOOP is not set
+# CONFIG_RAMDISK is not set
+# CONFIG_CAN is not set
+# CONFIG_PWM is not set
+CONFIG_I2C=y
+# CONFIG_I2C_SLAVE is not set
+CONFIG_I2C_TRANSFER=y
+# CONFIG_I2C_WRITEREAD is not set
+CONFIG_I2C_POLLED=y
+# CONFIG_I2C_TRACE is not set
+CONFIG_ARCH_HAVE_I2CRESET=y
+# CONFIG_I2C_RESET is not set
+CONFIG_SPI=y
+# CONFIG_SPI_OWNBUS is not set
+CONFIG_SPI_EXCHANGE=y
+# CONFIG_SPI_CMDDATA is not set
+CONFIG_RTC=y
+CONFIG_RTC_DATETIME=y
+# CONFIG_RTC_ALARM is not set
+# CONFIG_WATCHDOG is not set
+# CONFIG_ANALOG is not set
+# CONFIG_BCH is not set
+CONFIG_INPUT=y
+# CONFIG_INPUT_TSC2007 is not set
+CONFIG_INPUT_ADS7843E=y
+CONFIG_LCD=y
+# CONFIG_LCD_NOGETRUN is not set
+CONFIG_LCD_MAXCONTRAST=1
+CONFIG_LCD_MAXPOWER=1
+# CONFIG_LCD_P14201 is not set
+# CONFIG_LCD_NOKIA6100 is not set
+# CONFIG_LCD_UG9664HSWAG01 is not set
+CONFIG_LCD_LANDSCAPE=y
+# CONFIG_LCD_PORTRAIT is not set
+# CONFIG_LCD_RPORTRAIT is not set
+# CONFIG_LCD_RLANDSCAPE is not set
+# CONFIG_MMCSD is not set
+# CONFIG_MTD is not set
+# CONFIG_NETDEVICES is not set
+# CONFIG_NET_SLIP is not set
+# CONFIG_PIPES is not set
+# CONFIG_PM is not set
+# CONFIG_POWER is not set
+# CONFIG_SENSORS is not set
+# CONFIG_SERCOMM_CONSOLE is not set
+CONFIG_SERIAL=y
+# CONFIG_LOWLEVEL_CONSOLE is not set
+# CONFIG_16550_UART is not set
+CONFIG_ARCH_HAVE_USART2=y
+CONFIG_MCU_SERIAL=y
+CONFIG_STANDARD_SERIAL=y
+CONFIG_USART2_SERIAL_CONSOLE=y
+# CONFIG_NO_SERIAL_CONSOLE is not set
+
+#
+# USART2 Configuration
+#
+CONFIG_USART2_RXBUFSIZE=128
+CONFIG_USART2_TXBUFSIZE=128
+CONFIG_USART2_BAUD=115200
+CONFIG_USART2_BITS=8
+CONFIG_USART2_PARITY=0
+CONFIG_USART2_2STOP=0
+# CONFIG_USBDEV is not set
+# CONFIG_USBHOST is not set
+# CONFIG_WIRELESS is not set
+
+#
+# System Logging Device Options
+#
+
+#
+# System Logging
+#
+# CONFIG_RAMLOG is not set
+
+#
+# Networking Support
+#
+CONFIG_NET=y
+# CONFIG_NET_NOINTS is not set
+CONFIG_NET_MULTIBUFFER=y
+# CONFIG_NET_IPv6 is not set
+CONFIG_NSOCKET_DESCRIPTORS=10
+CONFIG_NET_NACTIVESOCKETS=16
+CONFIG_NET_SOCKOPTS=y
+CONFIG_NET_BUFSIZE=562
+# CONFIG_NET_TCPURGDATA is not set
+CONFIG_NET_TCP=y
+CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_MAX_LISTENPORTS=40
+CONFIG_NET_TCP_READAHEAD_BUFSIZE=562
+CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
+CONFIG_NET_TCP_RECVDELAY=0
+CONFIG_NET_TCPBACKLOG=y
+CONFIG_NET_UDP=y
+CONFIG_NET_UDP_CHECKSUMS=y
+CONFIG_NET_UDP_CONNS=8
+# CONFIG_NET_BROADCAST is not set
+CONFIG_NET_ICMP=y
+CONFIG_NET_ICMP_PING=y
+# CONFIG_NET_PINGADDRCONF is not set
+# CONFIG_NET_IGMP is not set
+CONFIG_NET_STATISTICS=y
+CONFIG_NET_RECEIVE_WINDOW=562
+CONFIG_NET_ARPTAB_SIZE=16
+# CONFIG_NET_ARP_IPIN is not set
+
+#
+# File Systems
+#
+
+#
+# File system configuration
+#
+CONFIG_FS_FAT=y
+CONFIG_FAT_LCNAMES=y
+CONFIG_FAT_LFN=y
+CONFIG_FAT_MAXFNAME=32
+# CONFIG_FS_FATTIME is not set
+# CONFIG_FAT_DMAMEMORY is not set
+# CONFIG_FS_RAMMAP is not set
+# CONFIG_NFS is not set
+# CONFIG_FS_NXFFS is not set
+# CONFIG_FS_ROMFS is not set
+
+#
+# System Logging
+#
+# CONFIG_SYSLOG is not set
+
+#
+# Graphics Support
+#
+CONFIG_NX=y
+CONFIG_NX_LCDDRIVER=y
+CONFIG_NX_NPLANES=1
+# CONFIG_NX_WRITEONLY is not set
+
+#
+# Supported Pixel Depths
+#
+CONFIG_NX_DISABLE_1BPP=y
+CONFIG_NX_DISABLE_2BPP=y
+CONFIG_NX_DISABLE_4BPP=y
+CONFIG_NX_DISABLE_8BPP=y
+# CONFIG_NX_DISABLE_16BPP is not set
+CONFIG_NX_DISABLE_24BPP=y
+CONFIG_NX_DISABLE_32BPP=y
+# CONFIG_NX_PACKEDMSFIRST is not set
+
+#
+# Input Devices
+#
+CONFIG_NX_MOUSE=y
+CONFIG_NX_KBD=y
+
+#
+# Framed Window Borders
+#
+CONFIG_NXTK_BORDERWIDTH=4
+CONFIG_NXTK_BORDERCOLOR1=0x5cb7
+CONFIG_NXTK_BORDERCOLOR2=0x21c9
+CONFIG_NXTK_BORDERCOLOR3=0xffdf
+# CONFIG_NXTK_AUTORAISE is not set
+
+#
+# Font Selections
+#
+CONFIG_NXFONTS_CHARBITS=7
+# CONFIG_NXFONT_SANS17X22 is not set
+# CONFIG_NXFONT_SANS20X26 is not set
+CONFIG_NXFONT_SANS23X27=y
+# CONFIG_NXFONT_SANS22X29 is not set
+# CONFIG_NXFONT_SANS28X37 is not set
+# CONFIG_NXFONT_SANS39X48 is not set
+# CONFIG_NXFONT_SANS17X23B is not set
+# CONFIG_NXFONT_SANS20X27B is not set
+CONFIG_NXFONT_SANS22X29B=y
+# CONFIG_NXFONT_SANS28X37B is not set
+# CONFIG_NXFONT_SANS40X49B is not set
+# CONFIG_NXFONT_SERIF22X29 is not set
+# CONFIG_NXFONT_SERIF29X37 is not set
+# CONFIG_NXFONT_SERIF38X48 is not set
+# CONFIG_NXFONT_SERIF22X28B is not set
+# CONFIG_NXFONT_SERIF27X38B is not set
+# CONFIG_NXFONT_SERIF38X49B is not set
+CONFIG_NXCONSOLE=y
+
+#
+# NxConsole Output Text/Graphics Options
+#
+CONFIG_NXCONSOLE_BPP=16
+CONFIG_NXCONSOLE_CURSORCHAR=137
+CONFIG_NXCONSOLE_MXCHARS=325
+CONFIG_NXCONSOLE_CACHESIZE=32
+CONFIG_NXCONSOLE_LINESEPARATION=0
+# CONFIG_NXCONSOLE_NOWRAP is not set
+
+#
+# NxConsole Input options
+#
+CONFIG_NXCONSOLE_NXKBDIN=y
+CONFIG_NXCONSOLE_KBDBUFSIZE=16
+CONFIG_NXCONSOLE_NPOLLWAITERS=4
+
+#
+# NX Multi-user only options
+#
+CONFIG_NX_MULTIUSER=y
+CONFIG_NX_BLOCKING=y
+CONFIG_NX_MXSERVERMSGS=32
+CONFIG_NX_MXCLIENTMSGS=16
+
+#
+# Memory Management
+#
+# CONFIG_MM_SMALL is not set
+CONFIG_MM_REGIONS=1
+# CONFIG_GRAN is not set
+
+#
+# Library Routines
+#
+CONFIG_STDIO_BUFFER_SIZE=64
+CONFIG_STDIO_LINEBUFFER=y
+CONFIG_NUNGET_CHARS=2
+CONFIG_LIB_HOMEDIR="/"
+# CONFIG_HAVE_LIBM is not set
+# CONFIG_NOPRINTF_FIELDWIDTH is not set
+# CONFIG_LIBC_FLOATINGPOINT is not set
+# CONFIG_EOL_IS_CR is not set
+# CONFIG_EOL_IS_LF is not set
+# CONFIG_EOL_IS_BOTH_CRLF is not set
+CONFIG_EOL_IS_EITHER_CRLF=y
+# CONFIG_LIBC_STRERROR is not set
+# CONFIG_LIBC_PERROR_STDOUT is not set
+CONFIG_ARCH_LOWPUTC=y
+CONFIG_LIB_SENDFILE_BUFSIZE=512
+# CONFIG_ARCH_ROMGETC is not set
+# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set
+CONFIG_HAVE_CXX=y
+CONFIG_HAVE_CXXINITIALIZE=y
+# CONFIG_CXX_NEWLONG is not set
+
+#
+# Application Configuration
+#
+
+#
+# Named Applications
+#
+CONFIG_NAMEDAPP=y
+
+#
+# Examples
+#
+
+#
+# ADC Example
+#
+# CONFIG_EXAMPLES_ADC is not set
+
+#
+# Buttons Example
+#
+# CONFIG_EXAMPLES_BUTTONS is not set
+
+#
+# CAN Example
+#
+# CONFIG_EXAMPLES_CAN is not set
+
+#
+# USB CDC/ACM Class Driver Example
+#
+# CONFIG_EXAMPLES_CDCACM is not set
+
+#
+# USB composite Class Driver Example
+#
+# CONFIG_EXAMPLES_COMPOSITE is not set
+
+#
+# DHCP Server Example
+#
+# CONFIG_EXAMPLES_DHCPD is not set
+
+#
+# FTP Client Example
+#
+# CONFIG_EXAMPLES_FTPC is not set
+
+#
+# FTP Server Example
+#
+# CONFIG_EXAMPLES_FTPD is not set
+
+#
+# "Hello, World!" Example
+#
+# CONFIG_EXAMPLES_HELLO is not set
+
+#
+# "Hello, World!" C++ Example
+#
+# CONFIG_EXAMPLES_HELLOXX is not set
+
+#
+# USB HID Keyboard Example
+#
+# CONFIG_EXAMPLES_HIDKBD is not set
+
+#
+# IGMP Example
+#
+# CONFIG_EXAMPLES_IGMP is not set
+
+#
+# LCD Read/Write Example
+#
+# CONFIG_EXAMPLES_LCDRW is not set
+
+#
+# Memory Management Example
+#
+# CONFIG_EXAMPLES_MM is not set
+
+#
+# File System Mount Example
+#
+# CONFIG_EXAMPLES_MOUNT is not set
+
+#
+# FreeModBus Example
+#
+# CONFIG_EXAMPLES_MODBUS is not set
+
+#
+# Network Test Example
+#
+# CONFIG_EXAMPLES_NETTEST is not set
+
+#
+# NuttShell (NSH) Example
+#
+# CONFIG_EXAMPLES_NSH is not set
+
+#
+# NULL Example
+#
+# CONFIG_EXAMPLES_NULL is not set
+
+#
+# NX Graphics Example
+#
+# CONFIG_EXAMPLES_NX is not set
+
+#
+# NxConsole Example
+#
+# CONFIG_EXAMPLES_NXCONSOLE is not set
+
+#
+# NXFFS File System Example
+#
+# CONFIG_EXAMPLES_NXFFS is not set
+
+#
+# NXFLAT Example
+#
+# CONFIG_EXAMPLES_NXFLAT is not set
+
+#
+# NX Graphics "Hello, World!" Example
+#
+# CONFIG_EXAMPLES_NXHELLO is not set
+
+#
+# NX Graphics image Example
+#
+# CONFIG_EXAMPLES_NXIMAGE is not set
+
+#
+# NX Graphics lines Example
+#
+# CONFIG_EXAMPLES_NXLINES is not set
+
+#
+# NX Graphics Text Example
+#
+# CONFIG_EXAMPLES_NXTEXT is not set
+
+#
+# OS Test Example
+#
+# CONFIG_EXAMPLES_OSTEST is not set
+
+#
+# Pascal "Hello, World!"example
+#
+# CONFIG_EXAMPLES_PASHELLO is not set
+
+#
+# Pipe Example
+#
+# CONFIG_EXAMPLES_PIPE is not set
+
+#
+# Poll Example
+#
+# CONFIG_EXAMPLES_POLL is not set
+
+#
+# Pulse Width Modulation (PWM) Example
+#
+
+#
+# Quadrature Encoder Example
+#
+# CONFIG_EXAMPLES_QENCODER is not set
+
+#
+# RGMP Example
+#
+# CONFIG_EXAMPLES_RGMP is not set
+
+#
+# ROMFS Example
+#
+# CONFIG_EXAMPLES_ROMFS is not set
+
+#
+# sendmail Example
+#
+# CONFIG_EXAMPLES_SENDMAIL is not set
+
+#
+# Serial Loopback Example
+#
+# CONFIG_EXAMPLES_SERLOOP is not set
+
+#
+# Telnet Daemon Example
+#
+# CONFIG_EXAMPLES_TELNETD is not set
+
+#
+# THTTPD Web Server Example
+#
+# CONFIG_EXAMPLES_THTTPD is not set
+
+#
+# TIFF Generation Example
+#
+# CONFIG_EXAMPLES_TIFF is not set
+
+#
+# Touchscreen Example
+#
+# CONFIG_EXAMPLES_TOUCHSCREEN is not set
+
+#
+# UDP Example
+#
+# CONFIG_EXAMPLES_UDP is not set
+
+#
+# UDP Discovery Daemon Example
+#
+# CONFIG_EXAMPLE_DISCOVER is not set
+
+#
+# uIP Web Server Example
+#
+# CONFIG_EXAMPLES_UIP is not set
+
+#
+# USB Serial Test Example
+#
+# CONFIG_EXAMPLES_USBSERIAL is not set
+
+#
+# USB Mass Storage Class Example
+#
+# CONFIG_EXAMPLES_USBMSC is not set
+
+#
+# USB Serial Terminal Example
+#
+# CONFIG_EXAMPLES_USBTERM is not set
+
+#
+# Watchdog timer Example
+#
+# CONFIG_EXAMPLES_WATCHDOG is not set
+
+#
+# wget Example
+#
+# CONFIG_EXAMPLES_WGET is not set
+
+#
+# WLAN Example
+#
+# CONFIG_EXAMPLES_WLAN is not set
+
+#
+# XML RPC Example
+#
+
+#
+# Interpreters
+#
+
+#
+# Interpreters
+#
+# CONFIG_FICL is not set
+# CONFIG_PCODE is not set
+
+#
+# Network Utilities
+#
+
+#
+# Networking Utilities
+#
+
+#
+# DHCP client
+#
+# CONFIG_NETUTILS_DHCPC is not set
+
+#
+# DHCP server
+#
+# CONFIG_NETUTILS_DHCPD is not set
+
+#
+# FTP client
+#
+# CONFIG_NETUTILS_FTPC is not set
+
+#
+# FTP server
+#
+# CONFIG_NETUTILS_FTPD is not set
+
+#
+# Name resolution
+#
+CONFIG_NETUTILS_RESOLV=y
+CONFIG_NET_RESOLV_ENTRIES=4
+
+#
+# SMTP
+#
+# CONFIG_NETUTILS_SMTP is not set
+
+#
+# TFTP client
+#
+CONFIG_NETUTILS_TELNETD=y
+
+#
+# TFTP client
+#
+CONFIG_NETUTILS_TFTPC=y
+
+#
+# THTTPD web server
+#
+# CONFIG_NETUTILS_THTTPD is not set
+
+#
+# uIP support library
+#
+CONFIG_NETUTILS_UIPLIB=y
+
+#
+# uIP web client
+#
+CONFIG_NETUTILS_WEBCLIENT=y
+
+#
+# uIP web server
+#
+# CONFIG_NETUTILS_WEBSERVER is not set
+
+#
+# UDP Discovery Utility
+#
+# CONFIG_NETUTILS_DISCOVER is not set
+
+#
+# XML-RPC library
+#
+# CONFIG_NETUTILS_XMLRPC is not set
+
+#
+# ModBus
+#
+
+#
+# FreeModbus
+#
+# CONFIG_MODBUS is not set
+
+#
+# NSH Library
+#
+CONFIG_NSH_LIBRARY=y
+CONFIG_NSH_BUILTIN_APPS=y
+
+#
+# Disable Individual commands
+#
+# CONFIG_NSH_DISABLE_CAT is not set
+# CONFIG_NSH_DISABLE_CD is not set
+# CONFIG_NSH_DISABLE_CP is not set
+# CONFIG_NSH_DISABLE_DD is not set
+# CONFIG_NSH_DISABLE_ECHO is not set
+# CONFIG_NSH_DISABLE_EXEC is not set
+# CONFIG_NSH_DISABLE_EXIT is not set
+# CONFIG_NSH_DISABLE_FREE is not set
+# CONFIG_NSH_DISABLE_GET is not set
+# CONFIG_NSH_DISABLE_HELP is not set
+# CONFIG_NSH_DISABLE_IFCONFIG is not set
+# CONFIG_NSH_DISABLE_KILL is not set
+# CONFIG_NSH_DISABLE_LOSETUP is not set
+# CONFIG_NSH_DISABLE_LS is not set
+# CONFIG_NSH_DISABLE_MB is not set
+# CONFIG_NSH_DISABLE_MKDIR is not set
+# CONFIG_NSH_DISABLE_MKFATFS is not set
+# CONFIG_NSH_DISABLE_MKFIFO is not set
+# CONFIG_NSH_DISABLE_MKRD is not set
+# CONFIG_NSH_DISABLE_MH is not set
+# CONFIG_NSH_DISABLE_MOUNT is not set
+# CONFIG_NSH_DISABLE_MW is not set
+# CONFIG_NSH_DISABLE_NSFMOUNT is not set
+# CONFIG_NSH_DISABLE_PS is not set
+# CONFIG_NSH_DISABLE_PING is not set
+# CONFIG_NSH_DISABLE_PUT is not set
+# CONFIG_NSH_DISABLE_PWD is not set
+# CONFIG_NSH_DISABLE_RM is not set
+# CONFIG_NSH_DISABLE_RMDIR is not set
+# CONFIG_NSH_DISABLE_SET is not set
+# CONFIG_NSH_DISABLE_SH is not set
+# CONFIG_NSH_DISABLE_SLEEP is not set
+# CONFIG_NSH_DISABLE_TEST is not set
+# CONFIG_NSH_DISABLE_UMOUNT is not set
+# CONFIG_NSH_DISABLE_UNSET is not set
+# CONFIG_NSH_DISABLE_USLEEP is not set
+# CONFIG_NSH_DISABLE_WGET is not set
+# CONFIG_NSH_DISABLE_XD is not set
+CONFIG_NSH_FILEIOSIZE=512
+CONFIG_NSH_LINELEN=64
+CONFIG_NSH_NESTDEPTH=3
+# CONFIG_NSH_DISABLESCRIPT is not set
+# CONFIG_NSH_DISABLEBG is not set
+CONFIG_NSH_CONSOLE=y
+# CONFIG_NSH_CONDEV is not set
+# CONFIG_NSH_ARCHINIT is not set
+CONFIG_NSH_TELNET=y
+CONFIG_NSH_TELNETD_PORT=23
+CONFIG_NSH_TELNETD_DAEMONPRIO=100
+CONFIG_NSH_TELNETD_DAEMONSTACKSIZE=2048
+CONFIG_NSH_TELNETD_CLIENTPRIO=100
+CONFIG_NSH_TELNETD_CLIENTSTACKSIZE=2048
+CONFIG_NSH_IOBUFFER_SIZE=512
+CONFIG_NSH_IPADDR=0x0a000002
+CONFIG_NSH_DRIPADDR=0x0a000001
+CONFIG_NSH_NETMASK=0xffffff00
+CONFIG_NSH_NOMAC=y
+
+#
+# NxWidgets/NxWM
+#
+CONFIG_NXWIDGETS=y
+
+#
+# NX Server/Device Configuration
+#
+CONFIG_NXWIDGETS_DEVNO=0
+CONFIG_NXWIDGETS_VPLANE=0
+CONFIG_NXWIDGETS_SERVERPRIO=51
+CONFIG_NXWIDGETS_SERVERSTACK=2048
+CONFIG_NXWIDGETS_CLIENTPRIO=50
+CONFIG_NXWIDGETS_LISTENERPRIO=50
+CONFIG_NXWIDGETS_LISTENERSTACK=2048
+# CONFIG_NXWIDGETS_EXTERNINIT is not set
+# CONFIG_NXWIDGET_EVENTWAIT is not set
+
+#
+# NXWidget Configuration
+#
+CONFIG_NXWIDGETS_BPP=16
+CONFIG_NXWIDGETS_SIZEOFCHAR=1
+
+#
+# NXWidget Default Values
+#
+CONFIG_NXWIDGETS_DEFAULT_FONTID=
+CONFIG_NXWIDGETS_TNXARRAY_INITIALSIZE=16
+CONFIG_NXWIDGETS_TNXARRAY_SIZEINCREMENT=8
+CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR=
+CONFIG_NXWIDGETS_DEFAULT_SELECTEDBACKGROUNDCOLOR=
+CONFIG_NXWIDGETS_DEFAULT_SHINEEDGECOLOR=
+CONFIG_NXWIDGETS_DEFAULT_SHADOWEDGECOLOR=
+CONFIG_NXWIDGETS_DEFAULT_HIGHLIGHTCOLOR=
+CONFIG_NXWIDGETS_DEFAULT_DISABLEDTEXTCOLOR=
+CONFIG_NXWIDGETS_DEFAULT_ENABLEDTEXTCOLOR=
+CONFIG_NXWIDGETS_DEFAULT_SELECTEDTEXTCOLOR=
+CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR=
+CONFIG_NXWIDGETS_TRANSPARENT_COLOR=
+
+#
+# Keypad behavior
+#
+CONFIG_NXWIDGETS_FIRST_REPEAT_TIME=500
+CONFIG_NXWIDGETS_CONTINUE_REPEAT_TIME=200
+CONFIG_NXWIDGETS_DOUBLECLICK_TIME=350
+CONFIG_NXWIDGETS_KBDBUFFER_SIZE=16
+CONFIG_NXWIDGETS_CURSORCONTROL_SIZE=4
+CONFIG_NXWM=y
+
+#
+# General settings
+#
+CONFIG_NXWM_DEFAULT_FONTID=
+CONFIG_NXWM_UNITTEST=y
+
+#
+# Color configuration
+#
+CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR=
+CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR=
+CONFIG_NXWM_DEFAULT_SHINEEDGECOLOR=
+CONFIG_NXWM_DEFAULT_SHADOWEDGECOLOR=
+CONFIG_NXWM_DEFAULT_FONTCOLOR=
+CONFIG_NXWM_TRANSPARENT_COLOR=
+
+#
+# Horizontal and vertical spacing of icons in the task bar
+#
+CONFIG_NXWM_TASKBAR_VSPACING=4
+CONFIG_NXWM_TASKBAR_HSPACING=2
+# CONFIG_NXWM_TASKBAR_TOP is not set
+# CONFIG_NXWM_TASKBAR_BOTTOM is not set
+CONFIG_NXWM_TASKBAR_LEFT=y
+# CONFIG_NXWM_TASKBAR_RIGHT is not set
+CONFIG_NXWM_TASKBAR_WIDTH=
+
+#
+# Tool Bar Configuration
+#
+CONFIG_NXWM_TOOLBAR_HEIGHT=
+
+#
+# Background Image
+#
+CONFIG_NXWM_BACKGROUND_IMAGE=""
+
+#
+# Start Window Configuration
+#
+
+#
+# Horizontal and vertical spacing of icons in the task bar
+#
+CONFIG_NXWM_STARTWINDOW_VSPACING=4
+CONFIG_NXWM_STARTWINDOW_HSPACING=4
+CONFIG_NXWM_STARTWINDOW_ICON=""
+CONFIG_NXWM_STARTWINDOW_MQNAME="/dev/nxwm"
+CONFIG_NXWM_STARTWINDOW_MXMSGS=32
+CONFIG_NXWM_STARTWINDOW_MXMPRIO=42
+CONFIG_NXWM_STARTWINDOW_PRIO=50
+CONFIG_NXWM_STARTWINDOW_STACKSIZE=2048
+
+#
+# NxConsole Window Configuration
+#
+CONFIG_NXWM_NXCONSOLE_PRIO=50
+CONFIG_NXWM_NXCONSOLE_STACKSIZE=2048
+CONFIG_NXWM_NXCONSOLE_WCOLOR=
+CONFIG_NXWM_NXCONSOLE_FONTCOLOR=
+CONFIG_NXWM_NXCONSOLE_FONTID=
+CONFIG_NXWM_NXCONSOLE_ICON=""
+CONFIG_NXWM_TOUCHSCREEN=y
+
+#
+# Touchscreen device settings
+#
+CONFIG_NXWM_TOUCHSCREEN_DEVNO=0
+CONFIG_NXWM_TOUCHSCREEN_DEVPATH="/dev/input0"
+CONFIG_NXWM_TOUCHSCREEN_SIGNO=5
+CONFIG_NXWM_TOUCHSCREEN_LISTENERPRIO=50
+CONFIG_NXWM_TOUCHSCREEN_LISTENERSTACK=
+CONFIG_NXWM_KEYBOARD=y
+
+#
+# Keyboard device settings
+#
+CONFIG_NXWM_KEYBOARD_DEVPATH="/dev/console"
+CONFIG_NXWM_KEYBOARD_SIGNO=6
+CONFIG_NXWM_KEYBOARD_BUFSIZE=16
+CONFIG_NXWM_KEYBOARD_LISTENERPRIO=50
+CONFIG_NXWM_KEYBOARD_LISTENERSTACK=2048
+
+#
+# Calibration display settings
+#
+CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR=
+CONFIG_NXWM_CALIBRATION_LINECOLOR=
+CONFIG_NXWM_CALIBRATION_CIRCLECOLOR=
+CONFIG_NXWM_CALIBRATION_TOUCHEDCOLOR=
+CONFIG_NXWM_CALIBRATION_ICON=""
+CONFIG_NXWM_CALIBRATION_SIGNO=5
+CONFIG_NXWM_CALIBRATION_LISTENERPRIO=50
+CONFIG_NXWM_CALIBRATION_LISTENERSTACK=2048
+
+#
+# Calibration display settings
+#
+CONFIG_NXWM_HEXCALCULATOR_BACKGROUNDCOLOR=
+CONFIG_NXWM_HEXCALCULATOR_ICON=""
+CONFIG_NXWM_HEXCALCULATOR_FONTID=5
+
+#
+# System NSH Add-Ons
+#
+
+#
+# Custom free memory command
+#
+# CONFIG_SYSTEM_FREE is not set
+
+#
+# I2C tool
+#
+CONFIG_SYSTEM_I2CTOOL=y
+CONFIG_I2CTOOL_BUILTIN=y
+CONFIG_I2CTOOL_MINBUS=1
+CONFIG_I2CTOOL_MAXBUS=3
+CONFIG_I2CTOOL_MINADDR=0x03
+CONFIG_I2CTOOL_MAXADDR=0x77
+CONFIG_I2CTOOL_MAXREGADDR=0xff
+CONFIG_I2CTOOL_DEFFREQ=100000
+
+#
+# FLASH Program Installation
+#
+# CONFIG_SYSTEM_INSTALL is not set
+
+#
+# readline() support
+#
+CONFIG_SYSTEM_READLINE=y
+CONFIG_READLINE_ECHO=y
+
+#
+# VSN board Add-Ons
+#
+
+#
+# VSN board add-ons
+#
+# CONFIG_VSN_POWEROFF is not set
+# CONFIG_VSN_RAMTRON is not set
+# CONFIG_VSN_SDCARD is not set
+# CONFIG_VSN_SYSINFO is not set
diff --git a/nuttx/configs/shenzhou/src/Makefile b/nuttx/configs/shenzhou/src/Makefile
index fc1d6caa1..04088110c 100644
--- a/nuttx/configs/shenzhou/src/Makefile
+++ b/nuttx/configs/shenzhou/src/Makefile
@@ -92,6 +92,10 @@ else
CSRCS += up_lcd.c
endif
+ifeq ($(CONFIG_INPUT_ADS7843E),y)
+CSRCS += up_touchscreen.c
+endif
+
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
diff --git a/nuttx/configs/shenzhou/src/up_touchscreen.c b/nuttx/configs/shenzhou/src/up_touchscreen.c
new file mode 100644
index 000000000..4ed34c0ec
--- /dev/null
+++ b/nuttx/configs/shenzhou/src/up_touchscreen.c
@@ -0,0 +1,292 @@
+/************************************************************************************
+ * configs/shenzhou/src/up_touchscreen.c
+ * arch/arm/src/board/up_touchscreen.c
+ *
+ * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
+ *
+ * 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.
+ *
+ ************************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <debug.h>
+#include <assert.h>
+#include <errno.h>
+
+#include <nuttx/irq.h>
+#include <nuttx/spi.h>
+#include <nuttx/input/touchscreen.h>
+#include <nuttx/input/ads7843e.h>
+
+#include "stm32_internal.h"
+#include "shenzhou_internal.h"
+
+/****************************************************************************
+ * Pre-Processor Definitions
+ ****************************************************************************/
+/* Configuration ************************************************************/
+
+#ifdef CONFIG_INPUT_ADS7843E
+#ifndef CONFIG_INPUT
+# error "Touchscreen support requires CONFIG_INPUT"
+#endif
+
+#ifndef CONFIG_STM32_SPI3
+# error "Touchscreen support requires CONFIG_STM32_SPI3"
+#endif
+
+#ifndef CONFIG_ADS7843E_FREQUENCY
+# define CONFIG_ADS7843E_FREQUENCY 500000
+#endif
+
+#ifndef CONFIG_ADS7843E_SPIDEV
+# define CONFIG_ADS7843E_SPIDEV 3
+#endif
+
+#if CONFIG_ADS7843E_SPIDEV != 3
+# error "CONFIG_ADS7843E_SPIDEV must be three"
+#endif
+
+#ifndef CONFIG_ADS7843E_DEVMINOR
+# define CONFIG_ADS7843E_DEVMINOR 0
+#endif
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct stm32_config_s
+{
+ struct ads7843e_config_s dev;
+ xcpt_t handler;
+};
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+/* IRQ/GPIO access callbacks. These operations all hidden behind
+ * callbacks to isolate the ADS7843E driver from differences in GPIO
+ * interrupt handling by varying boards and MCUs. If possible,
+ * interrupts should be configured on both rising and falling edges
+ * so that contact and loss-of-contact events can be detected.
+ *
+ * attach - Attach the ADS7843E interrupt handler to the GPIO interrupt
+ * enable - Enable or disable the GPIO interrupt
+ * clear - Acknowledge/clear any pending GPIO interrupt
+ * pendown - Return the state of the pen down GPIO input
+ */
+
+static int tsc_attach(FAR struct ads7843e_config_s *state, xcpt_t isr);
+static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable);
+static void tsc_clear(FAR struct ads7843e_config_s *state);
+static bool tsc_busy(FAR struct ads7843e_config_s *state);
+static bool tsc_pendown(FAR struct ads7843e_config_s *state);
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/* A reference to a structure of this type must be passed to the ADS7843E
+ * driver. This structure provides information about the configuration
+ * of the ADS7843E and provides some board-specific hooks.
+ *
+ * Memory for this structure is provided by the caller. It is not copied
+ * by the driver and is presumed to persist while the driver is active. The
+ * memory must be writable because, under certain circumstances, the driver
+ * may modify frequency or X plate resistance values.
+ */
+
+static struct stm32_config_s g_tscinfo =
+{
+ {
+ .frequency = CONFIG_ADS7843E_FREQUENCY,
+ .attach = tsc_attach,
+ .enable = tsc_enable,
+ .clear = tsc_clear,
+ .busy = tsc_busy,
+ .pendown = tsc_pendown,
+ },
+ .handler = NULL,
+};
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/* IRQ/GPIO access callbacks. These operations all hidden behind
+ * callbacks to isolate the ADS7843E driver from differences in GPIO
+ * interrupt handling by varying boards and MCUs. If possible,
+ * interrupts should be configured on both rising and falling edges
+ * so that contact and loss-of-contact events can be detected.
+ *
+ * attach - Attach the ADS7843E interrupt handler to the GPIO interrupt
+ * enable - Enable or disable the GPIO interrupt
+ * clear - Acknowledge/clear any pending GPIO interrupt
+ * pendown - Return the state of the pen down GPIO input
+ */
+
+static int tsc_attach(FAR struct ads7843e_config_s *state, xcpt_t isr)
+{
+ FAR struct stm32_config_s *priv = (FAR struct stm32_config_s *)state;
+
+ /* Just save the handler for use when the interrupt is enabled */
+
+ priv->handler = handler;
+}
+
+static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable)
+{
+ FAR struct stm32_config_s *priv = (FAR struct stm32_config_s *)state;
+
+ DEBUGASSERT(priv->handler);
+
+ /* Attach and enable, or detach and disable */
+
+ ivdbg("IRQ:%d enable:%d\n", STM32_TCS_IRQ, enable);
+ if (enable)
+ {
+ (void)stm32_gpiosetevent(GPIO_TP_INT, false, true, true,
+ priv->handler);
+ }
+ else
+ {
+ (void)stm32_gpiosetevent(GPIO_TP_INT, false, true, true, NULL);
+ }
+}
+
+static void tsc_clear(FAR struct ads7843e_config_s *state)
+{
+ /* Does nothing */
+}
+
+static bool tsc_busy(FAR struct ads7843e_config_s *state)
+{
+ /* Hmmm... The ADS7843E BUSY pin is not brought out on the Shenzhou board.
+ * We will most certainly have to revisit this.
+ */
+
+ return false;
+}
+
+static bool tsc_pendown(FAR struct ads7843e_config_s *state)
+{
+ /* REVISIT: This might need to be inverted */
+
+ bool pendown = stm32_gpioread(GPIO_TP_INT);
+ ivdbg("pendown:%d\n", pendown);
+ return pendown;
+}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: arch_tcinitialize
+ *
+ * Description:
+ * Each board that supports a touchscreen device must provide this function.
+ * This function is called by application-specific, setup logic to
+ * configure the touchscreen device. This function will register the driver
+ * as /dev/inputN where N is the minor device number.
+ *
+ * Input Parameters:
+ * minor - The input device minor number
+ *
+ * Returned Value:
+ * Zero is returned on success. Otherwise, a negated errno value is
+ * returned to indicate the nature of the failure.
+ *
+ ****************************************************************************/
+
+int arch_tcinitialize(int minor)
+{
+ FAR struct spi_dev_s *dev;
+ int ret;
+
+ idbg("minor %d\n", minor);
+ DEBUGASSERT(minor == 0);
+
+ /* Configure and enable the ADS7843E interrupt pin as an input. */
+
+ (void)stm32_configgpio(GPIO_TP_INT);
+
+ /* Get an instance of the SPI interface */
+
+ dev = up_spiinitialize(CONFIG_ADS7843E_SPIDEV);
+ if (!dev)
+ {
+ idbg("Failed to initialize SPI bus %d\n", CONFIG_ADS7843E_SPIDEV);
+ return -ENODEV;
+ }
+
+ /* Initialize and register the SPI touschscreen device */
+
+ ret = ads7843e_register(dev, &g_tscinfo, CONFIG_ADS7843E_DEVMINOR);
+ if (ret < 0)
+ {
+ idbg("Failed to initialize SPI bus %d\n", CONFIG_ADS7843E_SPIDEV);
+ /* up_spiuninitialize(dev); */
+ return -ENODEV;
+ }
+
+ return OK;
+}
+
+/****************************************************************************
+ * Name: arch_tcuninitialize
+ *
+ * Description:
+ * Each board that supports a touchscreen device must provide this function.
+ * This function is called by application-specific, setup logic to
+ * uninitialize the touchscreen device.
+ *
+ * Input Parameters:
+ * None
+ *
+ * Returned Value:
+ * None.
+ *
+ ****************************************************************************/
+
+void arch_tcuninitialize(void)
+{
+ /* No support for un-initializing the touchscreen ADS7843E device yet */
+}
+
+#endif /* CONFIG_INPUT_ADS7843E */
+