summaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx')
-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
32 files changed, 200 insertions, 135 deletions
diff --git a/nuttx/arch/sim/src/up_touchscreen.c b/nuttx/arch/sim/src/up_touchscreen.c
index 9ee99cbe9..a7f6d68fb 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 403002594..c1dc72ca9 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 5e5a22a8d..6a7c1cfed 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 a41c1d2e6..d865fff68 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 a588d9301..3c92af404 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 0c384048d..6d156d860 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 9e3dc090a..ba66239b8 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 210c11d19..f15c688ed 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 68f5381c5..da70dc4a2 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 d78579245..24fa5aa17 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 09dcb0a33..2dfb69c55 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 e4b8a2d64..33434bd8e 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 0becba782..533b3b26b 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 1f3265bcf..1fe76919f 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 51345ab66..3ab2572b2 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 77f44963e..ca5ee10e7 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 49badb8f9..82c1de894 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 6a73fb4ce..8de590332 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 a514a3bd2..ff5f597db 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 b0559b325..14615cc22 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 5128733ef..e2c6ba0d0 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 6d6192a33..aaeba1c1d 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 067434c8e..3bc73dad5 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 f91674c44..57ec36c1a 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 7b914fa5f..399eab66d 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 a9e788608..30f2ea3de 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 d6d14e50a..bbf5bc533 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 6ef8eb269..0418283c2 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 e2061e469..a0edfcabf 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 cfbbb8331..2942b0217 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 d9e531d5f..dcd91b4d5 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 811953e08..675daa802 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