summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-03-31 13:21:25 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-03-31 13:21:25 -0600
commit0d085198e9bafae34dcb77d1e75305785f1e5d08 (patch)
tree335f2ab4a732bac3b6b61ea9394e93241d3183eb
parent6fcc161c79d4e24444997e35e5a37d7aff6049b9 (diff)
rch_tcinitialize() and arch_tcunitinitialize() renamed to board_tsc_setup() and board_tsc_teardown(). These are not long called directly by applications but only indirectly throught the crappy boardctl() OS interface.
-rw-r--r--NxWidgets/ChangeLog.txt5
-rw-r--r--NxWidgets/Kconfig11
-rw-r--r--NxWidgets/nxwm/src/ctouchscreen.cxx3
-rw-r--r--apps/NxWidgets/Kconfig11
-rw-r--r--apps/examples/README.txt11
-rw-r--r--apps/examples/touchscreen/Kconfig25
-rw-r--r--apps/examples/touchscreen/tc_main.c7
-rw-r--r--nuttx/arch/sim/src/up_touchscreen.c9
-rw-r--r--nuttx/configs/Kconfig5
-rw-r--r--nuttx/configs/arduino-due/src/sam_touchscreen.c9
-rwxr-xr-xnuttx/configs/boardctl.c35
-rw-r--r--nuttx/configs/hymini-stm32v/nsh2/defconfig2
-rw-r--r--nuttx/configs/hymini-stm32v/src/stm32_ts.c15
-rw-r--r--nuttx/configs/mikroe-stm32f4/fulldemo/defconfig2
-rw-r--r--nuttx/configs/mikroe-stm32f4/src/stm32_touchscreen.c9
-rw-r--r--nuttx/configs/olimex-lpc1766stk/hidmouse/defconfig2
-rw-r--r--nuttx/configs/olimex-lpc1766stk/src/lpc17_hidmouse.c9
-rw-r--r--nuttx/configs/open1788/src/lpc17_touchscreen.c8
-rw-r--r--nuttx/configs/pic32mx7mmb/src/pic32_touchscreen.c9
-rw-r--r--nuttx/configs/sam3u-ek/src/sam_touchscreen.c9
-rw-r--r--nuttx/configs/sam4e-ek/src/sam_ads7843e.c9
-rw-r--r--nuttx/configs/sama5d3x-ek/src/sam_touchscreen.c10
-rw-r--r--nuttx/configs/sama5d4-ek/ipv6/defconfig2
-rw-r--r--nuttx/configs/sama5d4-ek/nsh/defconfig2
-rw-r--r--nuttx/configs/sama5d4-ek/src/sam_maxtouch.c9
-rw-r--r--nuttx/configs/samv71-xult/mxtxplnd/defconfig2
-rw-r--r--nuttx/configs/samv71-xult/src/sam_maxtouch.c9
-rw-r--r--nuttx/configs/shenzhou/src/stm32_touchscreen.c9
-rw-r--r--nuttx/configs/sim/README.txt2
-rw-r--r--nuttx/configs/sim/nsh2/defconfig2
-rw-r--r--nuttx/configs/sim/src/sim_touchscreen.c13
-rw-r--r--nuttx/configs/sim/touchscreen/defconfig2
-rw-r--r--nuttx/configs/stm3220g-eval/src/stm32_stmpe811.c9
-rw-r--r--nuttx/configs/stm3240g-eval/src/stm32_boot.c4
-rw-r--r--nuttx/configs/stm3240g-eval/src/stm32_stmpe811.c9
-rw-r--r--nuttx/configs/viewtool-stm32f107/src/stm32_touchscreen.c9
-rw-r--r--nuttx/include/nuttx/board.h54
-rw-r--r--nuttx/include/nuttx/input/touchscreen.h38
-rw-r--r--nuttx/include/sys/boardctl.h18
39 files changed, 236 insertions, 172 deletions
diff --git a/NxWidgets/ChangeLog.txt b/NxWidgets/ChangeLog.txt
index ff21d88525..6cf53f54c5 100644
--- a/NxWidgets/ChangeLog.txt
+++ b/NxWidgets/ChangeLog.txt
@@ -544,3 +544,8 @@
NuttX 7.6 and previous versions of the UnitTest code.
1.15 2015-xx-xx Gregory Nutt <gnutt@nuttx.org>
+
+* In NuttX 7.9, the interface arch_tcinitialize() was replaced with the
+ boardctl() interface. Old versions of NxWM will then be incompatible
+ with Versions of NuttX at 7.9 and beyond (2015-03-31).
+
diff --git a/NxWidgets/Kconfig b/NxWidgets/Kconfig
index 89e7e222d5..066cdb2dad 100644
--- a/NxWidgets/Kconfig
+++ b/NxWidgets/Kconfig
@@ -782,12 +782,11 @@ config NXWM_TOUCHSCREEN_DEVINIT
depends on !BUILD_PROTECTED && !BUILD_KERNEL
---help---
It this option is selected, then the NxWM:CTouchscreen listener
- thread will call a function arch_tcinitialize(NXWM_TOUCHSCREEN_DEVNO)
- in order to instantiate the touchscreen driver at path
- NXWM_TOUCHSCREEN_DEVPATH. If NXWM_TOUCHSCREEN_DEVINIT is not
- selected, then the NxWM:CTouchscreen listener thread will assume
- that the driver has already been initialized at
- NXWM_TOUCHSCREEN_DEVPATH.
+ thread will call a function boardctl() in order to instantiate the
+ touchscreen driver at path NXWM_TOUCHSCREEN_DEVPATH. If
+ NXWM_TOUCHSCREEN_DEVINIT is not selected, then the NxWM:CTouchscreen
+ listener thread will assume that the driver has already been
+ initialized at NXWM_TOUCHSCREEN_DEVPATH.
NOTE that in the kernel build, all touchscreen initialize must be
performed in kernel logic prior to the execution of NxWM.
diff --git a/NxWidgets/nxwm/src/ctouchscreen.cxx b/NxWidgets/nxwm/src/ctouchscreen.cxx
index dc462727db..3792811a4c 100644
--- a/NxWidgets/nxwm/src/ctouchscreen.cxx
+++ b/NxWidgets/nxwm/src/ctouchscreen.cxx
@@ -43,6 +43,7 @@
#include <cerrno>
#include <cfcntl>
+#include <sys/boardctl.h>
#include <sched.h>
#include <pthread.h>
#include <assert.h>
@@ -281,7 +282,7 @@ FAR void *CTouchscreen::listener(FAR void *arg)
#ifdef CONFIG_NXWM_TOUCHSCREEN_DEVINIT
// Initialize the touchscreen device
- int ret = arch_tcinitialize(CONFIG_NXWM_TOUCHSCREEN_DEVNO);
+ int ret = boardctl(BOARDIOC_TSCTEST_SETUP, CONFIG_NXWM_TOUCHSCREEN_DEVNO);
if (ret < 0)
{
dbg("ERROR Failed initialize the touchscreen device: %d\n", ret);
diff --git a/apps/NxWidgets/Kconfig b/apps/NxWidgets/Kconfig
index 89e7e222d5..066cdb2dad 100644
--- a/apps/NxWidgets/Kconfig
+++ b/apps/NxWidgets/Kconfig
@@ -782,12 +782,11 @@ config NXWM_TOUCHSCREEN_DEVINIT
depends on !BUILD_PROTECTED && !BUILD_KERNEL
---help---
It this option is selected, then the NxWM:CTouchscreen listener
- thread will call a function arch_tcinitialize(NXWM_TOUCHSCREEN_DEVNO)
- in order to instantiate the touchscreen driver at path
- NXWM_TOUCHSCREEN_DEVPATH. If NXWM_TOUCHSCREEN_DEVINIT is not
- selected, then the NxWM:CTouchscreen listener thread will assume
- that the driver has already been initialized at
- NXWM_TOUCHSCREEN_DEVPATH.
+ thread will call a function boardctl() in order to instantiate the
+ touchscreen driver at path NXWM_TOUCHSCREEN_DEVPATH. If
+ NXWM_TOUCHSCREEN_DEVINIT is not selected, then the NxWM:CTouchscreen
+ listener thread will assume that the driver has already been
+ initialized at NXWM_TOUCHSCREEN_DEVPATH.
NOTE that in the kernel build, all touchscreen initialize must be
performed in kernel logic prior to the execution of NxWM.
diff --git a/apps/examples/README.txt b/apps/examples/README.txt
index 1a40475924..27ff6d1e2b 100644
--- a/apps/examples/README.txt
+++ b/apps/examples/README.txt
@@ -1809,12 +1809,13 @@ examples/touchscreen
CONFIG_EXAMPLES_TOUCHSREEN=y
- The board-specific logic must provide the following interfaces that will
- be called by the example in order to initialize and uninitialize the
- touchscreen hardware:
+ This example code will call boardctl() to setup the touchscreen driver
+ for texting. The implementation of boardctl() will require that board-
+ specific logic provide the following interfaces that will be called by
+ the boardctl() in order to initialize and uninitialize the touchscreen hardware:
- int arch_tcinitialize(int minor);
- int arch_tcuninitialize(void);
+ int board_tsc_setup(int minor);
+ void board_tsc_teardown(void);
examples/udp
^^^^^^^^^^^^
diff --git a/apps/examples/touchscreen/Kconfig b/apps/examples/touchscreen/Kconfig
index e266972b6d..2edad59155 100644
--- a/apps/examples/touchscreen/Kconfig
+++ b/apps/examples/touchscreen/Kconfig
@@ -46,12 +46,13 @@ config EXAMPLES_TOUCHSCREEN_MOUSE
config EXAMPLES_TOUCHSCREEN_ARCHINIT
bool "Architecture-specific initialization"
default y
- depends on !BUILD_PROTECTED && !BUILD_KERNEL
+ depends on LIB_BOARDCTL
+ select BOARDCTL_TSCTEST
---help---
- By default, the touchscreen example will call arch_tcinitialize() to
+ By default, the touchscreen example will call boardctl() to
register the touchscreen device before it attempts to open it.
- Similarly, it will call arch_tcuninitialize() to unregister the
- touchscreen device when it is finished.
+ Similarly, it will call boardctl() to unregister the touchscreen
+ device when it is finished.
This works well for the typical touchscreen controller but there are
other devices that cannot be initialized and uninitialized in this
@@ -60,17 +61,9 @@ config EXAMPLES_TOUCHSCREEN_ARCHINIT
mouse is disconnected.
So, in cases like this, there are two options: (1) provide dummy
- arch_tcinitialize() and arch_tcuninitialize() just to satisfy the
- linking requirements or, (2) select this option. if this option is
- de-selected, then the arch_tcinitialize() and arch_tcuninitialize() will
- never be called.
-
- NOTE also that the functions arch_tcinitialize() and
- arch_tcuninitialize() are effective non-standard operating system
- calls. This is cheap shortcut and a violation of the OS interface.
- You can get away with this in the flat build (CONFIG_BUILD_FLAT),
- but not in the protected or kernel builds (CONFIG_BUILD_PROTECTED
- or CONFIG)BUILD_KERNEL). In those cases, you will need to perform
- one-time touchscreen initialization in board_initialize().
+ board_tsc_setup() and board_tsc_teardown() just to satisfy the
+ linking requirements of boardctl() or, (2) de-select this option.
+ If this option is de-selected, then the boardctl() will never be
+ called.
endif
diff --git a/apps/examples/touchscreen/tc_main.c b/apps/examples/touchscreen/tc_main.c
index c2c451f2f6..8e35630d21 100644
--- a/apps/examples/touchscreen/tc_main.c
+++ b/apps/examples/touchscreen/tc_main.c
@@ -40,6 +40,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
+#include <sys/boardctl.h>
#include <stdio.h>
#include <stdlib.h>
@@ -130,10 +131,10 @@ int tc_main(int argc, char *argv[])
*/
printf("tc_main: Initializing external touchscreen device\n");
- ret = arch_tcinitialize(CONFIG_EXAMPLES_TOUCHSCREEN_MINOR);
+ ret = boardctl(BOARDIOC_TSCTEST_SETUP, CONFIG_EXAMPLES_TOUCHSCREEN_MINOR);
if (ret != OK)
{
- printf("tc_main: arch_tcinitialize failed: %d\n", ret);
+ printf("tc_main: board_tsc_setup failed: %d\n", ret);
errval = 1;
goto errout;
}
@@ -260,7 +261,7 @@ errout_with_dev:
errout_with_tc:
#ifdef CONFIG_EXAMPLES_TOUCHSCREEN_ARCHINIT
- arch_tcuninitialize();
+ boardctl(BOARDIOC_TSCTEST_TEARDOWN, 0);
errout:
#endif
diff --git a/nuttx/arch/sim/src/up_touchscreen.c b/nuttx/arch/sim/src/up_touchscreen.c
index 9ee99cbe92..a7f6d68fb4 100644
--- a/nuttx/arch/sim/src/up_touchscreen.c
+++ b/nuttx/arch/sim/src/up_touchscreen.c
@@ -52,6 +52,7 @@
#include <assert.h>
#include <debug.h>
+#include <nuttx/board.h>
#include <nuttx/kmalloc.h>
#include <nuttx/arch.h>
#include <nuttx/fs/fs.h>
@@ -625,7 +626,7 @@ errout:
****************************************************************************/
/****************************************************************************
- * Name: arch_tcinitialize
+ * Name: board_tsc_setup
*
* Description:
* Configure the simulated touchscreen. This will register the driver as
@@ -640,7 +641,7 @@ errout:
*
****************************************************************************/
-int arch_tcinitialize(int minor)
+int board_tsc_setup(int minor)
{
FAR struct up_dev_s *priv = ( FAR struct up_dev_s *)&g_simtouchscreen;
char devname[DEV_NAMELEN];
@@ -687,7 +688,7 @@ errout_with_priv:
}
/****************************************************************************
- * Name: arch_tcuninitialize
+ * Name: board_tsc_teardown
*
* Description:
* Uninitialized the simulated touchscreen
@@ -700,7 +701,7 @@ errout_with_priv:
*
****************************************************************************/
-void arch_tcuninitialize(void)
+void board_tsc_teardown(void)
{
FAR struct up_dev_s *priv = ( FAR struct up_dev_s *)&g_simtouchscreen;
char devname[DEV_NAMELEN];
diff --git a/nuttx/configs/Kconfig b/nuttx/configs/Kconfig
index 403002594b..c1dc72ca95 100644
--- a/nuttx/configs/Kconfig
+++ b/nuttx/configs/Kconfig
@@ -1585,3 +1585,8 @@ endif
config LIB_BOARDCTL
bool "Enabled boardctl() interface"
default n
+
+config BOARDCTL_TSCTEST
+ bool "Enable touchscreen test interfaces"
+ default n
+ depends on LIB_BOARDCTL
diff --git a/nuttx/configs/arduino-due/src/sam_touchscreen.c b/nuttx/configs/arduino-due/src/sam_touchscreen.c
index 5e5a22a8d2..6a7c1cfed6 100644
--- a/nuttx/configs/arduino-due/src/sam_touchscreen.c
+++ b/nuttx/configs/arduino-due/src/sam_touchscreen.c
@@ -45,6 +45,7 @@
#include <assert.h>
#include <errno.h>
+#include <nuttx/board.h>
#include <nuttx/spi/spi.h>
#include <nuttx/spi/spi_bitbang.h>
#include <nuttx/input/touchscreen.h>
@@ -335,7 +336,7 @@ static FAR struct spi_dev_s *sam_tsc_spiinitialize(void)
****************************************************************************/
/****************************************************************************
- * Name: arch_tcinitialize
+ * Name: board_tsc_setup
*
* Description:
* Each board that supports a touchscreen device must provide this function.
@@ -352,7 +353,7 @@ static FAR struct spi_dev_s *sam_tsc_spiinitialize(void)
*
****************************************************************************/
-int arch_tcinitialize(int minor)
+int board_tsc_setup(int minor)
{
FAR struct spi_dev_s *dev;
static bool initialized = false;
@@ -405,7 +406,7 @@ int arch_tcinitialize(int minor)
}
/****************************************************************************
- * Name: arch_tcuninitialize
+ * Name: board_tsc_teardown
*
* Description:
* Each board that supports a touchscreen device must provide this function.
@@ -420,7 +421,7 @@ int arch_tcinitialize(int minor)
*
****************************************************************************/
-void arch_tcuninitialize(void)
+void board_tsc_teardown(void)
{
/* No support for un-initializing the touchscreen XPT2046 device. It will
* continue to run and process touch interrupts in the background.
diff --git a/nuttx/configs/boardctl.c b/nuttx/configs/boardctl.c
index a41c1d2e6b..d865fff685 100755
--- a/nuttx/configs/boardctl.c
+++ b/nuttx/configs/boardctl.c
@@ -98,24 +98,31 @@ int boardctl(unsigned int cmd, uintptr_t arg)
break;
#ifdef CONFIG_BOARDCTL_TSCTEST
- /* CMD: BOARDIOC_TSCTEST
+ /* CMD: BOARDIOC_TSCTEST_SETUP
* DESCRIPTION: Touchscreen controller test configuration
- * ARG: 0: Setup touchscreen test, 1: Teardown touchscreen test
- * CONFIGURATION: CONFIG_LIB_BOARDCTL &&
- * DEPENDENCIES: Board logic must provide board_tsc_setup() and
- * board_tsc_teardown().
+ * ARG: Touch controller device minor number
+ * CONFIGURATION: CONFIG_LIB_BOARDCTL && CONFIG_BOARDCTL_TSCTEST
+ * DEPENDENCIES: Board logic must provide board_tsc_setup()
*/
- case BOARDIOC_TSCTEST:
- if (arg)
- {
- ret = board_tsc_setup();
- }
- else
- {
- ret = board_tsc_teardown();
- }
+ case BOARDIOC_TSCTEST_SETUP:
+ {
+ ret = board_tsc_setup((int)arg);
+ }
+ break;
+
+ /* CMD: BOARDIOC_TSCTEST_TEARDOWN
+ * DESCRIPTION: Touchscreen controller test configuration
+ * ARG: None
+ * CONFIGURATION: CONFIG_LIB_BOARDCTL && CONFIG_BOARDCTL_TSCTEST
+ * DEPENDENCIES: Board logic must provide board_tsc_teardown()
+ */
+ case BOARDIOC_TSCTEST_TEARDOWN:
+ {
+ board_tsc_teardown();
+ ret = OK;
+ }
break;
#endif
diff --git a/nuttx/configs/hymini-stm32v/nsh2/defconfig b/nuttx/configs/hymini-stm32v/nsh2/defconfig
index a588d93018..3c92af4041 100644
--- a/nuttx/configs/hymini-stm32v/nsh2/defconfig
+++ b/nuttx/configs/hymini-stm32v/nsh2/defconfig
@@ -714,6 +714,8 @@ CONFIG_EXAMPLES_NXIMAGE=y
# CONFIG_EXAMPLES_THTTPD is not set
# CONFIG_EXAMPLES_TIFF is not set
CONFIG_EXAMPLES_TOUCHSCREEN=y
+CONFIG_LIB_BOARDCTL=y
+CONFIG_BOARDCTL_TSCTEST=y
CONFIG_EXAMPLES_TOUCHSCREEN_MINOR=0
CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH="/dev/input0"
CONFIG_EXAMPLES_TOUCHSCREEN_ARCHINIT=y
diff --git a/nuttx/configs/hymini-stm32v/src/stm32_ts.c b/nuttx/configs/hymini-stm32v/src/stm32_ts.c
index 0c384048d1..6d156d860a 100644
--- a/nuttx/configs/hymini-stm32v/src/stm32_ts.c
+++ b/nuttx/configs/hymini-stm32v/src/stm32_ts.c
@@ -45,12 +45,13 @@
#include <errno.h>
#include <debug.h>
-#include "stm32.h"
-#include "hymini_stm32v-internal.h"
-
+#include <nuttx/board.h>
#include <nuttx/input/touchscreen.h>
#include <nuttx/input/ads7843e.h>
+#include "stm32.h"
+#include "hymini_stm32v-internal.h"
+
/************************************************************************************
* Pre-processor Defintiions
************************************************************************************/
@@ -131,7 +132,7 @@ static bool hymini_ts_pendown(FAR struct ads7843e_config_s *state)
}
/****************************************************************************
- * Name: arch_tcinitialize
+ * Name: board_tsc_setup
*
* Description:
* Each board that supports a touchscreen device must provide this function.
@@ -148,7 +149,7 @@ static bool hymini_ts_pendown(FAR struct ads7843e_config_s *state)
*
****************************************************************************/
-int arch_tcinitialize(int minor)
+int board_tsc_setup(int minor)
{
FAR struct spi_dev_s *dev;
@@ -169,7 +170,7 @@ int arch_tcinitialize(int minor)
}
/****************************************************************************
- * Name: arch_tcuninitialize
+ * Name: board_tsc_teardown
*
* Description:
* Each board that supports a touchscreen device must provide this function.
@@ -184,7 +185,7 @@ int arch_tcinitialize(int minor)
*
****************************************************************************/
-void arch_tcuninitialize(void)
+void board_tsc_teardown(void)
{
/* FIXME What can/should we do here ? */
}
diff --git a/nuttx/configs/mikroe-stm32f4/fulldemo/defconfig b/nuttx/configs/mikroe-stm32f4/fulldemo/defconfig
index 9e3dc090a2..ba66239b8d 100644
--- a/nuttx/configs/mikroe-stm32f4/fulldemo/defconfig
+++ b/nuttx/configs/mikroe-stm32f4/fulldemo/defconfig
@@ -1146,6 +1146,8 @@ CONFIG_EXAMPLES_NX_NOTIFYSIGNO=4
# CONFIG_EXAMPLES_THTTPD is not set
# CONFIG_EXAMPLES_TIFF is not set
CONFIG_EXAMPLES_TOUCHSCREEN=y
+CONFIG_LIB_BOARDCTL=y
+CONFIG_BOARDCTL_TSCTEST=y
CONFIG_EXAMPLES_TOUCHSCREEN_MINOR=0
CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH="/dev/input0"
# CONFIG_EXAMPLES_TOUCHSCREEN_MOUSE is not set
diff --git a/nuttx/configs/mikroe-stm32f4/src/stm32_touchscreen.c b/nuttx/configs/mikroe-stm32f4/src/stm32_touchscreen.c
index 210c11d193..f15c688ed6 100644
--- a/nuttx/configs/mikroe-stm32f4/src/stm32_touchscreen.c
+++ b/nuttx/configs/mikroe-stm32f4/src/stm32_touchscreen.c
@@ -50,6 +50,7 @@
#include <errno.h>
#include <debug.h>
+#include <nuttx/board.h>
#include <nuttx/clock.h>
#include <nuttx/wqueue.h>
#include <nuttx/fs/fs.h>
@@ -1473,7 +1474,7 @@ errout:
************************************************************************************/
/****************************************************************************
- * Name: arch_tcinitialize
+ * Name: board_tsc_setup
*
* Description:
* Each board that supports a touchscreen device must provide this function.
@@ -1490,7 +1491,7 @@ errout:
*
****************************************************************************/
-int arch_tcinitialize(int minor)
+int board_tsc_setup(int minor)
{
FAR struct tc_dev_s *priv;
char devname[DEV_NAMELEN];
@@ -1583,7 +1584,7 @@ errout_with_priv:
}
/****************************************************************************
- * Name: arch_tcuninitialize
+ * Name: board_tsc_teardown
*
* Description:
* Each board that supports a touchscreen device must provide this function.
@@ -1598,7 +1599,7 @@ errout_with_priv:
*
****************************************************************************/
-void arch_tcuninitialize(void)
+void board_tsc_teardown(void)
{
/* Need to unregister the /dev/inputN device here. */
}
diff --git a/nuttx/configs/olimex-lpc1766stk/hidmouse/defconfig b/nuttx/configs/olimex-lpc1766stk/hidmouse/defconfig
index 68f5381c57..da70dc4a22 100644
--- a/nuttx/configs/olimex-lpc1766stk/hidmouse/defconfig
+++ b/nuttx/configs/olimex-lpc1766stk/hidmouse/defconfig
@@ -703,6 +703,8 @@ CONFIG_EXAMPLES_NSH=y
# CONFIG_EXAMPLES_THTTPD is not set
# CONFIG_EXAMPLES_TIFF is not set
CONFIG_EXAMPLES_TOUCHSCREEN=y
+CONFIG_LIB_BOARDCTL=y
+CONFIG_BOARDCTL_TSCTEST=y
CONFIG_EXAMPLES_TOUCHSCREEN_MINOR=0
CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH="/dev/mouse0"
CONFIG_EXAMPLES_TOUCHSCREEN_MOUSE=y
diff --git a/nuttx/configs/olimex-lpc1766stk/src/lpc17_hidmouse.c b/nuttx/configs/olimex-lpc1766stk/src/lpc17_hidmouse.c
index d78579245c..24fa5aa17d 100644
--- a/nuttx/configs/olimex-lpc1766stk/src/lpc17_hidmouse.c
+++ b/nuttx/configs/olimex-lpc1766stk/src/lpc17_hidmouse.c
@@ -45,6 +45,7 @@
#include <assert.h>
#include <errno.h>
+#include <nuttx/board.h>
#include <nuttx/usb/usbhost.h>
#include <nuttx/input/touchscreen.h>
@@ -90,7 +91,7 @@
****************************************************************************/
/****************************************************************************
- * Name: arch_tcinitialize
+ * Name: board_tsc_setup
*
* Description:
* Each board that supports a touchscreen device must provide this
@@ -108,7 +109,7 @@
*
****************************************************************************/
-int arch_tcinitialize(int minor)
+int board_tsc_setup(int minor)
{
static bool initialized = false;
int ret;
@@ -142,7 +143,7 @@ int arch_tcinitialize(int minor)
}
/****************************************************************************
- * Name: arch_tcuninitialize
+ * Name: board_tsc_teardown
*
* Description:
* Each board that supports a touchscreen device must provide this function.
@@ -157,7 +158,7 @@ int arch_tcinitialize(int minor)
*
****************************************************************************/
-void arch_tcuninitialize(void)
+void board_tsc_teardown(void)
{
/* No support for un-initializing the USB mouse driver. It will continue
* to run and process touch interrupts in the background.
diff --git a/nuttx/configs/open1788/src/lpc17_touchscreen.c b/nuttx/configs/open1788/src/lpc17_touchscreen.c
index 09dcb0a338..2dfb69c550 100644
--- a/nuttx/configs/open1788/src/lpc17_touchscreen.c
+++ b/nuttx/configs/open1788/src/lpc17_touchscreen.c
@@ -254,7 +254,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
****************************************************************************/
/****************************************************************************
- * Name: arch_tcinitialize
+ * Name: board_tsc_setup
*
* Description:
* Each board that supports a touchscreen device must provide this
@@ -271,7 +271,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
*
****************************************************************************/
-int arch_tcinitialize(int minor)
+int board_tsc_setup(int minor)
{
static bool initialized = false;
FAR struct spi_dev_s *dev;
@@ -323,7 +323,7 @@ int arch_tcinitialize(int minor)
}
/****************************************************************************
- * Name: arch_tcuninitialize
+ * Name: board_tsc_teardown
*
* Description:
* Each board that supports a touchscreen device must provide this function.
@@ -338,7 +338,7 @@ int arch_tcinitialize(int minor)
*
****************************************************************************/
-void arch_tcuninitialize(void)
+void board_tsc_teardown(void)
{
/* No support for un-initializing the touchscreen XPT2046 device yet */
}
diff --git a/nuttx/configs/pic32mx7mmb/src/pic32_touchscreen.c b/nuttx/configs/pic32mx7mmb/src/pic32_touchscreen.c
index e4b8a2d64d..33434bd8e8 100644
--- a/nuttx/configs/pic32mx7mmb/src/pic32_touchscreen.c
+++ b/nuttx/configs/pic32mx7mmb/src/pic32_touchscreen.c
@@ -48,6 +48,7 @@
#include <errno.h>
#include <debug.h>
+#include <nuttx/board.h>
#include <nuttx/clock.h>
#include <nuttx/wqueue.h>
#include <nuttx/fs/fs.h>
@@ -1343,7 +1344,7 @@ errout:
************************************************************************************/
/****************************************************************************
- * Name: arch_tcinitialize
+ * Name: board_tsc_setup
*
* Description:
* Each board that supports a touchscreen device must provide this function.
@@ -1360,7 +1361,7 @@ errout:
*
****************************************************************************/
-int arch_tcinitialize(int minor)
+int board_tsc_setup(int minor)
{
FAR struct tc_dev_s *priv;
char devname[DEV_NAMELEN];
@@ -1436,7 +1437,7 @@ errout_with_priv:
}
/****************************************************************************
- * Name: arch_tcuninitialize
+ * Name: board_tsc_teardown
*
* Description:
* Each board that supports a touchscreen device must provide this function.
@@ -1451,7 +1452,7 @@ errout_with_priv:
*
****************************************************************************/
-void arch_tcuninitialize(void)
+void board_tsc_teardown(void)
{
/* Need to unregister the /dev/inputN device here. */
}
diff --git a/nuttx/configs/sam3u-ek/src/sam_touchscreen.c b/nuttx/configs/sam3u-ek/src/sam_touchscreen.c
index 0becba7824..533b3b26b9 100644
--- a/nuttx/configs/sam3u-ek/src/sam_touchscreen.c
+++ b/nuttx/configs/sam3u-ek/src/sam_touchscreen.c
@@ -45,6 +45,7 @@
#include <assert.h>
#include <errno.h>
+#include <nuttx/board.h>
#include <nuttx/spi/spi.h>
#include <nuttx/input/touchscreen.h>
#include <nuttx/input/ads7843e.h>
@@ -213,7 +214,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
****************************************************************************/
/****************************************************************************
- * Name: arch_tcinitialize
+ * Name: board_tsc_setup
*
* Description:
* Each board that supports a touchscreen device must provide this function.
@@ -230,7 +231,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
*
****************************************************************************/
-int arch_tcinitialize(int minor)
+int board_tsc_setup(int minor)
{
FAR struct spi_dev_s *dev;
int ret;
@@ -270,7 +271,7 @@ int arch_tcinitialize(int minor)
}
/****************************************************************************
- * Name: arch_tcuninitialize
+ * Name: board_tsc_teardown
*
* Description:
* Each board that supports a touchscreen device must provide this function.
@@ -285,7 +286,7 @@ int arch_tcinitialize(int minor)
*
****************************************************************************/
-void arch_tcuninitialize(void)
+void board_tsc_teardown(void)
{
/* No support for un-initializing the touchscreen ADS7843E device yet */
}
diff --git a/nuttx/configs/sam4e-ek/src/sam_ads7843e.c b/nuttx/configs/sam4e-ek/src/sam_ads7843e.c
index 1f3265bcf9..1fe76919f1 100644
--- a/nuttx/configs/sam4e-ek/src/sam_ads7843e.c
+++ b/nuttx/configs/sam4e-ek/src/sam_ads7843e.c
@@ -45,6 +45,7 @@
#include <assert.h>
#include <errno.h>
+#include <nuttx/board.h>
#include <nuttx/spi/spi.h>
#include <nuttx/input/touchscreen.h>
#include <nuttx/input/ads7843e.h>
@@ -210,7 +211,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
****************************************************************************/
/****************************************************************************
- * Name: arch_tcinitialize
+ * Name: board_tsc_setup
*
* Description:
* Each board that supports a touchscreen device must provide this function.
@@ -227,7 +228,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
*
****************************************************************************/
-int arch_tcinitialize(int minor)
+int board_tsc_setup(int minor)
{
FAR struct spi_dev_s *dev;
int ret;
@@ -267,7 +268,7 @@ int arch_tcinitialize(int minor)
}
/****************************************************************************
- * Name: arch_tcuninitialize
+ * Name: board_tsc_teardown
*
* Description:
* Each board that supports a touchscreen device must provide this function.
@@ -282,7 +283,7 @@ int arch_tcinitialize(int minor)
*
****************************************************************************/
-void arch_tcuninitialize(void)
+void board_tsc_teardown(void)
{
/* No support for un-initializing the touchscreen ADS7843E device yet */
}
diff --git a/nuttx/configs/sama5d3x-ek/src/sam_touchscreen.c b/nuttx/configs/sama5d3x-ek/src/sam_touchscreen.c
index 51345ab667..3ab2572b2c 100644
--- a/nuttx/configs/sama5d3x-ek/src/sam_touchscreen.c
+++ b/nuttx/configs/sama5d3x-ek/src/sam_touchscreen.c
@@ -47,6 +47,8 @@
#include "sam_tsd.h"
#include "sama5d3x-ek.h"
+#include <nuttx/board.h>
+
#ifdef CONFIG_SAMA5_TSD
/****************************************************************************
@@ -83,7 +85,7 @@
****************************************************************************/
/****************************************************************************
- * Name: arch_tcinitialize
+ * Name: board_tsc_setup
*
* Description:
* Each board that supports a touchscreen device must provide this
@@ -100,7 +102,7 @@
*
****************************************************************************/
-int arch_tcinitialize(int minor)
+int board_tsc_setup(int minor)
{
struct sam_adc_s *adc;
static bool initialized = false;
@@ -141,7 +143,7 @@ int arch_tcinitialize(int minor)
}
/****************************************************************************
- * Name: arch_tcuninitialize
+ * Name: board_tsc_teardown
*
* Description:
* Each board that supports a touchscreen device must provide this function.
@@ -156,7 +158,7 @@ int arch_tcinitialize(int minor)
*
****************************************************************************/
-void arch_tcuninitialize(void)
+void board_tsc_teardown(void)
{
/* No support for un-initializing the touchscreen yet */
}
diff --git a/nuttx/configs/sama5d4-ek/ipv6/defconfig b/nuttx/configs/sama5d4-ek/ipv6/defconfig
index 77f44963ea..ca5ee10e7c 100644
--- a/nuttx/configs/sama5d4-ek/ipv6/defconfig
+++ b/nuttx/configs/sama5d4-ek/ipv6/defconfig
@@ -1220,6 +1220,8 @@ CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT=16
# CONFIG_EXAMPLES_THTTPD is not set
# CONFIG_EXAMPLES_TIFF is not set
CONFIG_EXAMPLES_TOUCHSCREEN=y
+CONFIG_LIB_BOARDCTL=y
+CONFIG_BOARDCTL_TSCTEST=y
CONFIG_EXAMPLES_TOUCHSCREEN_MINOR=0
CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH="/dev/input0"
# CONFIG_EXAMPLES_TOUCHSCREEN_MOUSE is not set
diff --git a/nuttx/configs/sama5d4-ek/nsh/defconfig b/nuttx/configs/sama5d4-ek/nsh/defconfig
index 49badb8f9e..82c1de8947 100644
--- a/nuttx/configs/sama5d4-ek/nsh/defconfig
+++ b/nuttx/configs/sama5d4-ek/nsh/defconfig
@@ -1222,6 +1222,8 @@ CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT=16
# CONFIG_EXAMPLES_THTTPD is not set
# CONFIG_EXAMPLES_TIFF is not set
CONFIG_EXAMPLES_TOUCHSCREEN=y
+CONFIG_LIB_BOARDCTL=y
+CONFIG_BOARDCTL_TSCTEST=y
CONFIG_EXAMPLES_TOUCHSCREEN_MINOR=0
CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH="/dev/input0"
# CONFIG_EXAMPLES_TOUCHSCREEN_MOUSE is not set
diff --git a/nuttx/configs/sama5d4-ek/src/sam_maxtouch.c b/nuttx/configs/sama5d4-ek/src/sam_maxtouch.c
index 6a73fb4cec..8de590332b 100644
--- a/nuttx/configs/sama5d4-ek/src/sam_maxtouch.c
+++ b/nuttx/configs/sama5d4-ek/src/sam_maxtouch.c
@@ -45,6 +45,7 @@
#include <assert.h>
#include <errno.h>
+#include <nuttx/board.h>
#include <nuttx/spi/spi.h>
#include <nuttx/input/touchscreen.h>
#include <nuttx/input/mxt.h>
@@ -218,7 +219,7 @@ static int mxt_interrupt(int irq, FAR void *context)
****************************************************************************/
/****************************************************************************
- * Name: arch_tcinitialize
+ * Name: board_tsc_setup
*
* Description:
* Each board that supports a touchscreen device must provide this function.
@@ -235,7 +236,7 @@ static int mxt_interrupt(int irq, FAR void *context)
*
****************************************************************************/
-int arch_tcinitialize(int minor)
+int board_tsc_setup(int minor)
{
FAR struct i2c_dev_s *i2c;
static bool initialized = false;
@@ -290,7 +291,7 @@ int arch_tcinitialize(int minor)
}
/****************************************************************************
- * Name: arch_tcuninitialize
+ * Name: board_tsc_teardown
*
* Description:
* Each board that supports a touchscreen device must provide this function.
@@ -305,7 +306,7 @@ int arch_tcinitialize(int minor)
*
****************************************************************************/
-void arch_tcuninitialize(void)
+void board_tsc_teardown(void)
{
/* No support for un-initializing the touchscreen maXTouch device. It will
* continue to run and process touch interrupts in the background.
diff --git a/nuttx/configs/samv71-xult/mxtxplnd/defconfig b/nuttx/configs/samv71-xult/mxtxplnd/defconfig
index a514a3bd24..ff5f597dbc 100644
--- a/nuttx/configs/samv71-xult/mxtxplnd/defconfig
+++ b/nuttx/configs/samv71-xult/mxtxplnd/defconfig
@@ -792,6 +792,8 @@ CONFIG_EXAMPLES_NSH=y
# CONFIG_EXAMPLES_THTTPD is not set
# CONFIG_EXAMPLES_TIFF is not set
CONFIG_EXAMPLES_TOUCHSCREEN=y
+CONFIG_LIB_BOARDCTL=y
+CONFIG_BOARDCTL_TSCTEST=y
CONFIG_EXAMPLES_TOUCHSCREEN_MINOR=0
CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH="/dev/input0"
# CONFIG_EXAMPLES_TOUCHSCREEN_MOUSE is not set
diff --git a/nuttx/configs/samv71-xult/src/sam_maxtouch.c b/nuttx/configs/samv71-xult/src/sam_maxtouch.c
index b0559b3253..14615cc220 100644
--- a/nuttx/configs/samv71-xult/src/sam_maxtouch.c
+++ b/nuttx/configs/samv71-xult/src/sam_maxtouch.c
@@ -45,6 +45,7 @@
#include <assert.h>
#include <errno.h>
+#include <nuttx/board.h>
#include <nuttx/spi/spi.h>
#include <nuttx/input/touchscreen.h>
#include <nuttx/input/mxt.h>
@@ -214,7 +215,7 @@ static int mxt_interrupt(int irq, FAR void *context)
****************************************************************************/
/****************************************************************************
- * Name: arch_tcinitialize
+ * Name: board_tsc_setup
*
* Description:
* Each board that supports a touchscreen device must provide this function.
@@ -231,7 +232,7 @@ static int mxt_interrupt(int irq, FAR void *context)
*
****************************************************************************/
-int arch_tcinitialize(int minor)
+int board_tsc_setup(int minor)
{
FAR struct i2c_dev_s *i2c;
static bool initialized = false;
@@ -286,7 +287,7 @@ int arch_tcinitialize(int minor)
}
/****************************************************************************
- * Name: arch_tcuninitialize
+ * Name: board_tsc_teardown
*
* Description:
* Each board that supports a touchscreen device must provide this function.
@@ -301,7 +302,7 @@ int arch_tcinitialize(int minor)
*
****************************************************************************/
-void arch_tcuninitialize(void)
+void board_tsc_teardown(void)
{
/* No support for un-initializing the touchscreen maXTouch device. It will
* continue to run and process touch interrupts in the background.
diff --git a/nuttx/configs/shenzhou/src/stm32_touchscreen.c b/nuttx/configs/shenzhou/src/stm32_touchscreen.c
index 5128733ef7..e2c6ba0d0b 100644
--- a/nuttx/configs/shenzhou/src/stm32_touchscreen.c
+++ b/nuttx/configs/shenzhou/src/stm32_touchscreen.c
@@ -45,6 +45,7 @@
#include <assert.h>
#include <errno.h>
+#include <nuttx/board.h>
#include <nuttx/irq.h>
#include <nuttx/spi/spi.h>
#include <nuttx/input/touchscreen.h>
@@ -228,7 +229,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
****************************************************************************/
/****************************************************************************
- * Name: arch_tcinitialize
+ * Name: board_tsc_setup
*
* Description:
* Each board that supports a touchscreen device must provide this function.
@@ -245,7 +246,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
*
****************************************************************************/
-int arch_tcinitialize(int minor)
+int board_tsc_setup(int minor)
{
FAR struct spi_dev_s *dev;
int ret;
@@ -280,7 +281,7 @@ int arch_tcinitialize(int minor)
}
/****************************************************************************
- * Name: arch_tcuninitialize
+ * Name: board_tsc_teardown
*
* Description:
* Each board that supports a touchscreen device must provide this function.
@@ -295,7 +296,7 @@ int arch_tcinitialize(int minor)
*
****************************************************************************/
-void arch_tcuninitialize(void)
+void board_tsc_teardown(void)
{
/* No support for un-initializing the touchscreen ADS7843E device yet */
}
diff --git a/nuttx/configs/sim/README.txt b/nuttx/configs/sim/README.txt
index 6d6192a33c..aaeba1c1da 100644
--- a/nuttx/configs/sim/README.txt
+++ b/nuttx/configs/sim/README.txt
@@ -490,7 +490,7 @@ nx11
CONFIG_SIM_TOUCHSCREEN=y
Then you must also have some application logic that will call
- arch_tcinitialize(0) to register the touchscreen driver. See
+ board_tsc_setup(0) to register the touchscreen driver. See
also configuration "touchscreen"
NOTES:
diff --git a/nuttx/configs/sim/nsh2/defconfig b/nuttx/configs/sim/nsh2/defconfig
index 067434c8e1..3bc73dad54 100644
--- a/nuttx/configs/sim/nsh2/defconfig
+++ b/nuttx/configs/sim/nsh2/defconfig
@@ -517,6 +517,8 @@ CONFIG_EXAMPLES_NXLINES_BPP=32
# CONFIG_EXAMPLES_THTTPD is not set
# CONFIG_EXAMPLES_TIFF is not set
CONFIG_EXAMPLES_TOUCHSCREEN=y
+CONFIG_LIB_BOARDCTL=y
+CONFIG_BOARDCTL_TSCTEST=y
CONFIG_EXAMPLES_TOUCHSCREEN_MINOR=0
CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH="/dev/input0"
CONFIG_EXAMPLES_TOUCHSCREEN_ARCHINIT=y
diff --git a/nuttx/configs/sim/src/sim_touchscreen.c b/nuttx/configs/sim/src/sim_touchscreen.c
index f91674c443..57ec36c1ae 100644
--- a/nuttx/configs/sim/src/sim_touchscreen.c
+++ b/nuttx/configs/sim/src/sim_touchscreen.c
@@ -44,6 +44,7 @@
#include <errno.h>
#include <debug.h>
+#include <nuttx/board.h>
#include <nuttx/video/fb.h>
#include <nuttx/input/touchscreen.h>
#include <nuttx/nx/nx.h>
@@ -83,7 +84,7 @@ static struct sim_touchscreen_s g_simtc;
****************************************************************************/
/****************************************************************************
- * Name: arch_tcinitialize()
+ * Name: board_tsc_setup()
*
* Description:
* Perform architecuture-specific initialization of the touchscreen
@@ -92,7 +93,7 @@ static struct sim_touchscreen_s g_simtc;
*
****************************************************************************/
-int arch_tcinitialize(int minor)
+int board_tsc_setup(int minor)
{
FAR NX_DRIVERTYPE *dev;
nxgl_mxpixel_t color;
@@ -143,10 +144,10 @@ int arch_tcinitialize(int minor)
/* Finally, initialize the touchscreen simulation on the X window */
- ret = arch_tcinitialize(minor);
+ ret = board_tsc_setup(minor);
if (ret < 0)
{
- idbg("arch_tcinitialize failed: %d\n", ret);
+ idbg("board_tsc_setup failed: %d\n", ret);
goto errout_with_nx;
}
return OK;
@@ -161,7 +162,7 @@ errout:
}
/****************************************************************************
- * Name: arch_tcuninitialize()
+ * Name: board_tsc_teardown()
*
* Description:
* Perform architecuture-specific un-initialization of the touchscreen
@@ -170,7 +171,7 @@ errout:
*
****************************************************************************/
-void arch_tcuninitialize(void)
+void board_tsc_teardown(void)
{
/* Shut down the touchscreen driver */
diff --git a/nuttx/configs/sim/touchscreen/defconfig b/nuttx/configs/sim/touchscreen/defconfig
index 7b914fa5f7..399eab66d6 100644
--- a/nuttx/configs/sim/touchscreen/defconfig
+++ b/nuttx/configs/sim/touchscreen/defconfig
@@ -511,6 +511,8 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512
# CONFIG_EXAMPLES_THTTPD is not set
# CONFIG_EXAMPLES_TIFF is not set
CONFIG_EXAMPLES_TOUCHSCREEN=y
+CONFIG_LIB_BOARDCTL=y
+CONFIG_BOARDCTL_TSCTEST=y
CONFIG_EXAMPLES_TOUCHSCREEN_MINOR=0
CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH="/dev/input0"
CONFIG_EXAMPLES_TOUCHSCREEN_NSAMPLES=25
diff --git a/nuttx/configs/stm3220g-eval/src/stm32_stmpe811.c b/nuttx/configs/stm3220g-eval/src/stm32_stmpe811.c
index a9e7886082..30f2ea3dee 100644
--- a/nuttx/configs/stm3220g-eval/src/stm32_stmpe811.c
+++ b/nuttx/configs/stm3220g-eval/src/stm32_stmpe811.c
@@ -44,6 +44,7 @@
#include <debug.h>
#include <errno.h>
+#include <nuttx/board.h>
#include <nuttx/i2c.h>
#include <nuttx/input/touchscreen.h>
#include <nuttx/input/stmpe811.h>
@@ -255,7 +256,7 @@ static void stmpe811_clear(FAR struct stmpe811_config_s *state)
****************************************************************************/
/****************************************************************************
- * Name: arch_tcinitialize
+ * Name: board_tsc_setup
*
* Description:
* Each board that supports a touchscreen device must provide this function.
@@ -272,7 +273,7 @@ static void stmpe811_clear(FAR struct stmpe811_config_s *state)
*
****************************************************************************/
-int arch_tcinitialize(int minor)
+int board_tsc_setup(int minor)
{
#ifndef CONFIG_STMPE811_TSC_DISABLE
FAR struct i2c_dev_s *dev;
@@ -328,7 +329,7 @@ int arch_tcinitialize(int minor)
}
/****************************************************************************
- * Name: arch_tcuninitialize
+ * Name: board_tsc_teardown
*
* Description:
* Each board that supports a touchscreen device must provide this function.
@@ -343,7 +344,7 @@ int arch_tcinitialize(int minor)
*
****************************************************************************/
-void arch_tcuninitialize(void)
+void board_tsc_teardown(void)
{
/* No support for un-initializing the touchscreen STMPE811 device yet */
}
diff --git a/nuttx/configs/stm3240g-eval/src/stm32_boot.c b/nuttx/configs/stm3240g-eval/src/stm32_boot.c
index d6d14e50a8..bbf5bc5331 100644
--- a/nuttx/configs/stm3240g-eval/src/stm32_boot.c
+++ b/nuttx/configs/stm3240g-eval/src/stm32_boot.c
@@ -181,10 +181,10 @@ static int board_initthread(int argc, char *argv[])
/* Initialize the touchscreen */
#ifdef HAVE_TCINIT
- ret = arch_tcinitialize(CONFIG_NXWM_TOUCHSCREEN_DEVNO);
+ ret = board_tsc_setup(CONFIG_NXWM_TOUCHSCREEN_DEVNO);
if (ret < 0)
{
- gdbg("ERROR: arch_tcinitialize failed: %d\n", ret);
+ gdbg("ERROR: board_tsc_setup failed: %d\n", ret);
}
#endif
diff --git a/nuttx/configs/stm3240g-eval/src/stm32_stmpe811.c b/nuttx/configs/stm3240g-eval/src/stm32_stmpe811.c
index 6ef8eb2690..0418283c26 100644
--- a/nuttx/configs/stm3240g-eval/src/stm32_stmpe811.c
+++ b/nuttx/configs/stm3240g-eval/src/stm32_stmpe811.c
@@ -44,6 +44,7 @@
#include <debug.h>
#include <errno.h>
+#include <nuttx/board.h>
#include <nuttx/i2c.h>
#include <nuttx/input/touchscreen.h>
#include <nuttx/input/stmpe811.h>
@@ -255,7 +256,7 @@ static void stmpe811_clear(FAR struct stmpe811_config_s *state)
****************************************************************************/
/****************************************************************************
- * Name: arch_tcinitialize
+ * Name: board_tsc_setup
*
* Description:
* Each board that supports a touchscreen device must provide this function.
@@ -272,7 +273,7 @@ static void stmpe811_clear(FAR struct stmpe811_config_s *state)
*
****************************************************************************/
-int arch_tcinitialize(int minor)
+int board_tsc_setup(int minor)
{
#ifndef CONFIG_STMPE811_TSC_DISABLE
FAR struct i2c_dev_s *dev;
@@ -328,7 +329,7 @@ int arch_tcinitialize(int minor)
}
/****************************************************************************
- * Name: arch_tcuninitialize
+ * Name: board_tsc_teardown
*
* Description:
* Each board that supports a touchscreen device must provide this function.
@@ -343,7 +344,7 @@ int arch_tcinitialize(int minor)
*
****************************************************************************/
-void arch_tcuninitialize(void)
+void board_tsc_teardown(void)
{
/* No support for un-initializing the touchscreen STMPE811 device yet */
}
diff --git a/nuttx/configs/viewtool-stm32f107/src/stm32_touchscreen.c b/nuttx/configs/viewtool-stm32f107/src/stm32_touchscreen.c
index e2061e4697..a0edfcabf4 100644
--- a/nuttx/configs/viewtool-stm32f107/src/stm32_touchscreen.c
+++ b/nuttx/configs/viewtool-stm32f107/src/stm32_touchscreen.c
@@ -45,6 +45,7 @@
#include <assert.h>
#include <errno.h>
+#include <nuttx/board.h>
#include <nuttx/spi/spi.h>
#include <nuttx/input/touchscreen.h>
#include <nuttx/input/ads7843e.h>
@@ -234,7 +235,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
****************************************************************************/
/****************************************************************************
- * Name: arch_tcinitialize
+ * Name: board_tsc_setup
*
* Description:
* Each board that supports a touchscreen device must provide this function.
@@ -251,7 +252,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
*
****************************************************************************/
-int arch_tcinitialize(int minor)
+int board_tsc_setup(int minor)
{
FAR struct spi_dev_s *dev;
static bool initialized = false;
@@ -300,7 +301,7 @@ int arch_tcinitialize(int minor)
}
/****************************************************************************
- * Name: arch_tcuninitialize
+ * Name: board_tsc_teardown
*
* Description:
* Each board that supports a touchscreen device must provide this function.
@@ -315,7 +316,7 @@ int arch_tcinitialize(int minor)
*
****************************************************************************/
-void arch_tcuninitialize(void)
+void board_tsc_teardown(void)
{
/* No support for un-initializing the touchscreen XPT2046 device. It will
* continue to run and process touch interrupts in the background.
diff --git a/nuttx/include/nuttx/board.h b/nuttx/include/nuttx/board.h
index cfbbb83318..2942b02173 100644
--- a/nuttx/include/nuttx/board.h
+++ b/nuttx/include/nuttx/board.h
@@ -142,7 +142,59 @@ void board_initialize(void);
#ifdef CONFIG_LIB_BOARDCTL
int board_app_initialize(void);
-#endif
+#endif /* CONFIG_LIB_BOARDCTL */
+
+/****************************************************************************
+ * Name: board_tsc_setup
+ *
+ * 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.
+ *
+ * This is an internal OS interface but may be invoked indirectly from
+ * application-level touchscreen testing logic (perhaps by
+ * apps/examples/touchscreen). If CONFIG_LIB_BOARDCTL=y and
+ * CONFIG_BOARDCTL_TSCTEST=y, then this functions will be invoked via the
+ * (non-standard) boardctl() interface using the commands
+ * BOARDIOC_TSCTEST_SETUP command.
+ *
+ * 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 board_tsc_setup(int minor);
+
+/****************************************************************************
+ * Name: board_tsc_teardown
+ *
+ * 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.
+ *
+ * This is an internal OS interface but may be invoked indirectly from
+ * application-level touchscreen testing logic (perhaps by
+ * apps/examples/touchscreen). If CONFIG_LIB_BOARDCTL=y and
+ * CONFIG_BOARDCTL_TSCTEST=y, then this functions will be invoked via the
+ * (non-standard) boardctl() interface using the commands
+ * BOARDIOC_TSCTEST_TEARDOWN command.
+ *
+ * Input Parameters:
+ * None
+ *
+ * Returned Value:
+ * None.
+ *
+ ****************************************************************************/
+
+void board_tsc_teardown(void);
/****************************************************************************
* Name: board_led_initialize
diff --git a/nuttx/include/nuttx/input/touchscreen.h b/nuttx/include/nuttx/input/touchscreen.h
index d9e531d5ff..dcd91b4d59 100644
--- a/nuttx/include/nuttx/input/touchscreen.h
+++ b/nuttx/include/nuttx/input/touchscreen.h
@@ -134,44 +134,6 @@ extern "C"
#define EXTERN extern
#endif
-/****************************************************************************
- * 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);
-
-/****************************************************************************
- * 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);
-
#undef EXTERN
#ifdef __cplusplus
}
diff --git a/nuttx/include/sys/boardctl.h b/nuttx/include/sys/boardctl.h
index 811953e084..675daa8025 100644
--- a/nuttx/include/sys/boardctl.h
+++ b/nuttx/include/sys/boardctl.h
@@ -58,16 +58,22 @@
* CONFIGURATION: CONFIG_LIB_BOARDCTL
* DEPENDENCIES: Board logic must provide board_app_initialization
*
- * CMD: BOARDIOC_TSCTEST
+ * CMD: BOARDIOC_TSCTEST_SETUP
* DESCRIPTION: Touchscreen controller test configuration
- * ARG: 0: Setup touchscreen test, 1: Teardown touchscreen test
+ * ARG: Touch controller device minor number
* CONFIGURATION: CONFIG_LIB_BOARDCTL && CONFIG_BOARDCTL_TSCTEST
- * DEPENDENCIES: Board logic must provide board_tsc_setup() and
- * board_tsc_teardown().
+ * DEPENDENCIES: Board logic must provide board_tsc_setup()
+ *
+ * CMD: BOARDIOC_TSCTEST_TEARDOWN
+ * DESCRIPTION: Touchscreen controller test configuration
+ * ARG: None
+ * CONFIGURATION: CONFIG_LIB_BOARDCTL && CONFIG_BOARDCTL_TSCTEST
+ * DEPENDENCIES: Board logic must provide board_tsc_teardown()
*/
-#define BOARDIOC_INIT _BOARDIOC(0x0001)
-#define BOARDIOC_TSCTEST _BOARDIOC(0x0002)
+#define BOARDIOC_INIT _BOARDIOC(0x0001)
+#define BOARDIOC_TSCTEST_SETUP _BOARDIOC(0x0002)
+#define BOARDIOC_TSCTEST_TEARDOWN _BOARDIOC(0x0003)
/****************************************************************************
* Public Type Definitions