diff --git a/configs/hymini-stm32v/src/hymini_stm32v-internal.h b/configs/hymini-stm32v/src/hymini_stm32v-internal.h index 718220454bf..03dceea19cc 100644 --- a/configs/hymini-stm32v/src/hymini_stm32v-internal.h +++ b/configs/hymini-stm32v/src/hymini_stm32v-internal.h @@ -135,19 +135,6 @@ extern void weak_function stm32_spiinitialize(void); extern void weak_function stm32_usbinitialize(void); -#if defined(CONFIG_INPUT_ADS7843E) - -/************************************************************************************ - * Name: Touchscreen initialization - * - ************************************************************************************/ - -extern int arch_tcinitialize(int minor); - -extern void arch_tcuninitialize(void); - -#endif /* CONFIG_INPUT_ADS7843E */ - #endif /* __ASSEMBLY__ */ #endif /* __CONFIGS_HYMINI_STM32V_INTERNAL_H */ diff --git a/configs/hymini-stm32v/src/up_ts.c b/configs/hymini-stm32v/src/up_ts.c index 6c4decf7c90..e5a77960527 100644 --- a/configs/hymini-stm32v/src/up_ts.c +++ b/configs/hymini-stm32v/src/up_ts.c @@ -46,6 +46,7 @@ #include "stm32_internal.h" #include "hymini_stm32v-internal.h" +#include #include #if !defined(CONFIG_STM32_SPI1) @@ -120,11 +121,20 @@ static bool hymini_ts_pendown(FAR struct ads7843e_config_s *state) } /**************************************************************************** - * Name: arch_tcinitialize() + * Name: arch_tcinitialize * * Description: - * Perform architecture-specific initialization of the touchscreen. - * This function must be called directly from application. + * 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. * ****************************************************************************/ @@ -132,12 +142,12 @@ int arch_tcinitialize(int minor) { FAR struct spi_dev_s *dev; - idbg("arch_tcinitialize: minor %d\n", minor); + idbg("minor %d\n", minor); dev = up_spiinitialize(1); if (!dev) { - idbg("arch_tcinitialize: Failed to initialize SPI bus\n"); + idbg("Failed to initialize SPI bus\n"); return -ENODEV; } @@ -149,11 +159,18 @@ int arch_tcinitialize(int minor) } /**************************************************************************** - * Name: arch_tcuninitialize() + * Name: arch_tcuninitialize * * Description: - * Perform architecture-specific un-initialization of the touchscreen - * hardware. This function must be called directly from application. + * 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. * ****************************************************************************/ diff --git a/configs/sam3u-ek/src/up_touchscreen.c b/configs/sam3u-ek/src/up_touchscreen.c index 0de367ec945..35ab4385921 100644 --- a/configs/sam3u-ek/src/up_touchscreen.c +++ b/configs/sam3u-ek/src/up_touchscreen.c @@ -2,7 +2,7 @@ * configs/sam3u-ek/src/up_touchscreen.c * arch/arm/src/board/up_touchscreen.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -213,16 +214,27 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state) * Name: arch_tcinitialize * * Description: - * Initialize the touchscreen device + * 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(void) +int arch_tcinitialize(int minor) { FAR struct spi_dev_s *dev; int ret; - ivdbg("Initializing\n"); + idbg("minor %d\n", minor); + DEBUGASSERT(minor == 0); /* Configure and enable the ADS7843E interrupt pin as an input */ @@ -259,7 +271,15 @@ int arch_tcinitialize(void) * Name: arch_tcuninitialize * * Description: - * Un-initialize the touchscreen device + * 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. * ****************************************************************************/ diff --git a/configs/sim/README.txt b/configs/sim/README.txt index 3be43bf80bd..833ec58dc7f 100644 --- a/configs/sim/README.txt +++ b/configs/sim/README.txt @@ -342,7 +342,7 @@ nx11 CONFIG_SIM_TOUCHSCREEN=y Then you must also have some application logic that will call - sim_tcinitialize(0) to register the touchscreen driver. See + arch_tcinitialize(0) to register the touchscreen driver. See also configuration "touchscreen" NOTES: diff --git a/configs/sim/src/up_touchscreen.c b/configs/sim/src/up_touchscreen.c index 54d6d0cb372..ef368628847 100644 --- a/configs/sim/src/up_touchscreen.c +++ b/configs/sim/src/up_touchscreen.c @@ -143,10 +143,10 @@ int arch_tcinitialize(int minor) /* Finally, initialize the touchscreen simulation on the X window */ - ret = sim_tcinitialize(minor); + ret = arch_tcinitialize(minor); if (ret < 0) { - idbg("sim_tcinitialize failed: %d\n", ret); + idbg("arch_tcinitialize failed: %d\n", ret); goto errout_with_nx; } return OK; diff --git a/configs/stm3240g-eval/nxwm/appconfig b/configs/stm3240g-eval/nxwm/appconfig index 212e366801c..6a5864fb158 100644 --- a/configs/stm3240g-eval/nxwm/appconfig +++ b/configs/stm3240g-eval/nxwm/appconfig @@ -33,8 +33,9 @@ # ############################################################################ -# The NSH Library -- NOTE: The NxWM unit must be installed in order -# to build this example. +# The NSH Library -- NOTE: The NxWM unit test must be installed at +# apps/external in order to build this example. See +# NxWidgets/UnitTests/README.txt for additional information CONFIGURED_APPS += system/readline CONFIGURED_APPS += nshlib diff --git a/configs/stm3240g-eval/src/up_stmpe11.c b/configs/stm3240g-eval/src/up_stmpe11.c index a9402eda7ed..e06e203e715 100644 --- a/configs/stm3240g-eval/src/up_stmpe11.c +++ b/configs/stm3240g-eval/src/up_stmpe11.c @@ -252,16 +252,29 @@ static void stmpe11_clear(FAR struct stmpe11_config_s *state) * Name: arch_tcinitialize * * Description: - * Initialize the touchscreen device + * 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(void) +int arch_tcinitialize(int minor) { #ifndef CONFIG_STMPE11_TSC_DISABLE FAR struct i2c_dev_s *dev; int ret; + idbg("minor %d\n", minor); + DEBUGASSERT(minor == 0); + /* Check if we are already initialized */ if (!g_stmpe11config.handle) @@ -312,7 +325,15 @@ int arch_tcinitialize(void) * Name: arch_tcuninitialize * * Description: - * Un-initialize the touchscreen device + * 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. * ****************************************************************************/