This commit eliminates the BOARDIOC_TSCTEST_SETUP command.
Squashed commit of the following: configs: Each board now initializes the touchscreen controller as a normal part of its board bring-up. board_tsc_setup() is gone; the touchscreen controller is now treated like any other on-board device. Remove all support for BOARDIOC_TSCTEST_SETUP Move prototype for board_tsc_setup() from include/nuttx/board.h to individual board header files.
This commit is contained in:
parent
21eff99d72
commit
301bf1ee77
@ -2351,14 +2351,6 @@ config BOARDCTL_USBDEVCTRL
|
||||
---help---
|
||||
Enables support for the BOARDIOC_USBDEV_CONTROL boardctl() command.
|
||||
|
||||
config BOARDCTL_TSCTEST
|
||||
bool "Enable touchscreen test interfaces"
|
||||
default n
|
||||
---help---
|
||||
Enables support for the BOARDIOC_TSCTEST_SETUP and
|
||||
BOARDIOC_TSCTEST_TEARDOWN boardctl() commands. Architecture
|
||||
specific logic must provide the board_tsc_setup() interface.
|
||||
|
||||
config BOARDCTL_IOCTL
|
||||
bool "Board-specific boardctl() commands"
|
||||
default n
|
||||
|
@ -166,7 +166,7 @@
|
||||
* and the SD card.
|
||||
* 2. UART0 cannot be used. USARTs on the COMM connector should be available.
|
||||
* 3. Parallel data is not contiguous in the PIO register
|
||||
* 4. Touchcontroller /CS pin is connected to ground (always selected).
|
||||
* 4. Touch controller /CS pin is connected to ground (always selected).
|
||||
* 5. Either PA28 or PC29 may drive PWM10
|
||||
*/
|
||||
|
||||
@ -308,7 +308,7 @@
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
/************************************************************************************
|
||||
* Name: sam_bringup
|
||||
*
|
||||
* Description:
|
||||
@ -320,23 +320,44 @@
|
||||
* CONFIG_BOARD_INITIALIZE=y && CONFIG_LIB_BOARDCTL=y :
|
||||
* Called from the NSH library
|
||||
*
|
||||
****************************************************************************/
|
||||
************************************************************************************/
|
||||
|
||||
int sam_bringup(void);
|
||||
|
||||
/****************************************************************************
|
||||
/************************************************************************************
|
||||
* Name: sam_sdinitialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the SPI-based SD card.
|
||||
*
|
||||
****************************************************************************/
|
||||
************************************************************************************/
|
||||
|
||||
#if defined(CONFIG_ARDUINO_ITHEAD_TFT) && defined(CONFIG_SPI_BITBANG) && \
|
||||
defined(CONFIG_MMCSD_SPI)
|
||||
int sam_sdinitialize(int minor);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: sam_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* This function is called by board-bringup 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.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#if defined(CONFIG_ARDUINO_ITHEAD_TFT) && defined(CONFIG_SPI_BITBANG) && \
|
||||
defined(CONFIG_INPUT_ADS7843E)
|
||||
int sam_tsc_setup(int minor);
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __CONFIGS_ARDUINO_DUE_SRC_ARDUNO_DUE_H */
|
||||
|
@ -118,6 +118,17 @@ int sam_bringup(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_ARDUINO_ITHEAD_TFT) && defined(CONFIG_SPI_BITBANG) && \
|
||||
defined(CONFIG_INPUT_ADS7843E)
|
||||
/* Initialize the touchscreen */
|
||||
|
||||
ret = sam_tsc_setup(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: sam_tsc_setup failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
UNUSED(ret);
|
||||
return OK;
|
||||
}
|
||||
|
@ -336,13 +336,12 @@ static FAR struct spi_dev_s *sam_tsc_spiinitialize(void)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup
|
||||
* Name: sam_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 function is called by board-bringup 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
|
||||
@ -353,7 +352,7 @@ static FAR struct spi_dev_s *sam_tsc_spiinitialize(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_tsc_setup(int minor)
|
||||
int sam_tsc_setup(int minor)
|
||||
{
|
||||
FAR struct spi_dev_s *dev;
|
||||
static bool initialized = false;
|
||||
|
@ -401,21 +401,6 @@ int boardctl(unsigned int cmd, uintptr_t arg)
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BOARDCTL_TSCTEST
|
||||
/* CMD: BOARDIOC_TSCTEST_SETUP
|
||||
* DESCRIPTION: Touchscreen controller test configuration
|
||||
* ARG: Touch controller device minor number
|
||||
* CONFIGURATION: CONFIG_LIB_BOARDCTL && CONFIG_BOARDCTL_TSCTEST
|
||||
* DEPENDENCIES: Board logic must provide board_tsc_setup()
|
||||
*/
|
||||
|
||||
case BOARDIOC_TSCTEST_SETUP:
|
||||
{
|
||||
ret = board_tsc_setup((int)arg);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
{
|
||||
#ifdef CONFIG_BOARDCTL_IOCTL
|
||||
|
@ -1,7 +1,7 @@
|
||||
/************************************************************************************
|
||||
* configs/hymini-stm32v/src/hymini-stm32v.h
|
||||
*
|
||||
* Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2009, 2011, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
* Laurent Latil <laurent@latil.nom.fr>
|
||||
*
|
||||
@ -122,7 +122,7 @@
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
extern void weak_function stm32_spidev_initialize(void);
|
||||
void weak_function stm32_spidev_initialize(void);
|
||||
|
||||
/************************************************************************************
|
||||
* Name: stm32_usbinitialize
|
||||
@ -132,7 +132,28 @@ extern void weak_function stm32_spidev_initialize(void);
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
extern void weak_function stm32_usbinitialize(void);
|
||||
void weak_function stm32_usbinitialize(void);
|
||||
|
||||
/************************************************************************************
|
||||
* Name: stm32_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* This function is called by board-bringup 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.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_INPUT
|
||||
int stm32_tsc_setup(int minor);
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __CONFIGS_HYMINI_STM32V_H */
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* config/hymini-stm32v/src/stm32_appinit.c
|
||||
*
|
||||
* Copyright (C) 2009, 2011, 2016-2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2009, 2011, 2016-2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -170,10 +170,11 @@ static int nsh_cdinterrupt(int irq, FAR void *context, FAR void *arg)
|
||||
|
||||
int board_app_initialize(uintptr_t arg)
|
||||
{
|
||||
#ifdef NSH_HAVEMMCSD
|
||||
int ret;
|
||||
|
||||
#ifdef NSH_HAVEMMCSD
|
||||
/* Card detect */
|
||||
|
||||
bool cd_status;
|
||||
|
||||
/* Configure the card detect GPIO */
|
||||
@ -220,5 +221,17 @@ int board_app_initialize(uintptr_t arg)
|
||||
|
||||
sdio_mediachange(g_sdiodev, cd_status);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_INPUT
|
||||
/* Initialize the touchscreen */
|
||||
|
||||
ret = stm32_tsc_setup(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: stm32_tsc_setup failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
UNUSED(ret);
|
||||
return OK;
|
||||
}
|
||||
|
@ -53,7 +53,7 @@
|
||||
#include "hymini-stm32v.h"
|
||||
|
||||
/************************************************************************************
|
||||
* Pre-processor Defintiions
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_STM32_SPI1)
|
||||
@ -136,13 +136,12 @@ static bool hymini_ts_pendown(FAR struct ads7843e_config_s *state)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup
|
||||
* Name: stm32_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 function is called by board-bringup 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
|
||||
@ -153,7 +152,7 @@ static bool hymini_ts_pendown(FAR struct ads7843e_config_s *state)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_tsc_setup(int minor)
|
||||
int stm32_tsc_setup(int minor)
|
||||
{
|
||||
FAR struct spi_dev_s *dev;
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
# CONFIG_ARCH_FPU is not set
|
||||
# CONFIG_EXAMPLES_TOUCHSCREEN_ARCHINIT is not set
|
||||
CONFIG_ARCH_BOARD_LPCXPRESSO_LPC54628=y
|
||||
CONFIG_ARCH_BOARD="lpcxpresso-lpc54628"
|
||||
CONFIG_ARCH_CHIP_LPC54628=y
|
||||
|
@ -2,7 +2,6 @@
|
||||
# CONFIG_NX_DISABLE_16BPP is not set
|
||||
# CONFIG_NXFONTS_DISABLE_16BPP is not set
|
||||
# CONFIG_NXTK_DEFAULT_BORDERCOLORS is not set
|
||||
# CONFIG_NXWM_TOUCHSCREEN_DEVINIT is not set
|
||||
CONFIG_ARCH_BOARD_LPCXPRESSO_LPC54628=y
|
||||
CONFIG_ARCH_BOARD="lpcxpresso-lpc54628"
|
||||
CONFIG_ARCH_CHIP_LPC54628=y
|
||||
|
@ -245,20 +245,4 @@ int lpc54_ft5x06_register(void)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* Stubs for expected interfaces. This implementation does not permit the
|
||||
* application to mange the touch screen controller.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_BOARDCTL_TSCTEST
|
||||
int board_tsc_setup(int minor)
|
||||
{
|
||||
DEBUGASSERT(minor == 0);
|
||||
return OK;
|
||||
}
|
||||
|
||||
#endif /* HAVE_FT5x06*/
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************************************
|
||||
* configs/mikroe-stm32f4/src/mikroe-stm32f4.h
|
||||
*
|
||||
* Copyright (C) 2011-2013, 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2011-2013, 2016, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -218,7 +218,7 @@ void weak_function stm32_spidev_initialize(void);
|
||||
* Name: stm32_usbinitialize
|
||||
*
|
||||
* Description:
|
||||
* Called from stm32_usbinitialize very early in inialization to setup USB-related
|
||||
* Called from stm32_usbinitialize very early in initialization to setup USB-related
|
||||
* GPIO pins for the Mikroe-stm32f4 board.
|
||||
*
|
||||
****************************************************************************************************/
|
||||
@ -227,13 +227,13 @@ void weak_function stm32_spidev_initialize(void);
|
||||
void weak_function stm32_usbinitialize(void);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************************************
|
||||
* Name: stm32_pwm_setup
|
||||
*
|
||||
* Description:
|
||||
* Initialize PWM and register the PWM device.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PWM
|
||||
int stm32_pwm_setup(void);
|
||||
@ -252,13 +252,13 @@ int stm32_pwm_setup(void);
|
||||
# error "The Mikroe-STM32F4 board does not support HOST OTG, only device!"
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
/****************************************************************************************************
|
||||
* Name: stm32_qencoder_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize and register a qencoder
|
||||
*
|
||||
****************************************************************************/
|
||||
****************************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SENSORS_QENCODER
|
||||
int stm32_qencoder_initialize(FAR const char *devpath, int timer);
|
||||
@ -277,6 +277,26 @@ int stm32_qencoder_initialize(FAR const char *devpath, int timer);
|
||||
void stm32_lcdinitialize(void);
|
||||
#endif
|
||||
|
||||
/****************************************************************************************************
|
||||
* Name: stm32_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* This function is called by board-bringup 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.
|
||||
*
|
||||
****************************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_INPUT
|
||||
int stm32_tsc_setup(int minor);
|
||||
#endif
|
||||
|
||||
/****************************************************************************************************
|
||||
* Name: up_vs1053initialize
|
||||
*
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* config/mikroe_stm32f4/src/stm32_appinit.c
|
||||
*
|
||||
* Copyright (C) 2012-2013, 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012-2013, 2016, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -350,6 +350,16 @@ int board_app_initialize(uintptr_t arg)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_INPUT
|
||||
/* Initialize the touchscreen */
|
||||
|
||||
ret = stm32_tsc_setup(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: stm32_tsc_setup failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PWM
|
||||
/* Initialize PWM and register the PWM device. */
|
||||
|
||||
|
@ -1474,13 +1474,12 @@ errout:
|
||||
************************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup
|
||||
* Name: stm32_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 function is called by board-bringup 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
|
||||
@ -1491,7 +1490,7 @@ errout:
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_tsc_setup(int minor)
|
||||
int stm32_tsc_setup(int minor)
|
||||
{
|
||||
FAR struct tc_dev_s *priv;
|
||||
char devname[DEV_NAMELEN];
|
||||
|
@ -1,7 +1,7 @@
|
||||
/************************************************************************************
|
||||
* configs/olimex-lpc1766stk/src/lpc1766stk.h
|
||||
*
|
||||
* Copyright (C) 2010-2011, 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2010-2011, 2016, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -272,6 +272,27 @@ void weak_function lpc1766stk_sspdev_initialize(void);
|
||||
int lpc1766stk_can_setup(void);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: lpc1766stk_hidmouse_setup
|
||||
*
|
||||
* Description:
|
||||
* This function is called by board-bringup logic to configure the HID mouse
|
||||
* 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.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_USBHOST_HIDMOUSE
|
||||
int lpc1766stk_hidmouse_setup(int minor);
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* _CONFIGS_OLIMEX_LPC1766STK_SRC_LPC1766STK_H */
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* config/olimex-lpc1766stk/src/lpc17_appinit.c
|
||||
*
|
||||
* Copyright (C) 2010, 2013-2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2010, 2013-2016, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -362,6 +362,16 @@ int board_app_initialize(uintptr_t arg)
|
||||
syslog(LOG_ERR, "ERROR: Failed to initialize USB host: %d\n", ret);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_USBHOST_HIDMOUSE
|
||||
/* Initialize the HID Mouse class */
|
||||
|
||||
ret = lpc1766stk_hidmouse_setup(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: lpc1766stk_hidmouse_setup failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CAN
|
||||
/* Initialize CAN and register the CAN driver. */
|
||||
|
||||
|
@ -71,17 +71,15 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup
|
||||
* Name: lpc1766stk_hidmouse_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 USB HID mouse driver that emulates a touchscreen
|
||||
* device. This function will register the driver as /dev/mouseN where N
|
||||
* is the minor device number.
|
||||
* This function is called by board-bringup logic to configure the HID
|
||||
* mouse device. This function will register the driver as /dev/inputN
|
||||
* where N is the minor device number.
|
||||
*
|
||||
* Input Parameters:
|
||||
* minor - The mouse device minor number
|
||||
* minor - The mouse device minor number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero is returned on success. Otherwise, a negated errno value is
|
||||
@ -89,7 +87,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_tsc_setup(int minor)
|
||||
int lpc1766stk_hidmouse_setup(int minor)
|
||||
{
|
||||
static bool initialized = false;
|
||||
int ret;
|
||||
|
@ -89,6 +89,6 @@ int board_app_initialize(uintptr_t arg)
|
||||
#else
|
||||
/* Perform board-specific initialization */
|
||||
|
||||
return lpc17_bringup();
|
||||
return open1788_bringup();
|
||||
#endif
|
||||
}
|
||||
|
@ -137,6 +137,6 @@ void board_initialize(void)
|
||||
{
|
||||
/* Perform board-specific initialization */
|
||||
|
||||
(void)lpc17_bringup();
|
||||
(void)open1788_bringup();
|
||||
}
|
||||
#endif
|
||||
|
@ -245,12 +245,11 @@ static int nsh_sdinitialize(void)
|
||||
|
||||
lpc17_configgpio(GPIO_SD_CD);
|
||||
|
||||
#ifdef NSH_HAVE_MMCSD_CDINT
|
||||
/* Attach an interrupt handler to get notifications when a card is
|
||||
* inserted or deleted.
|
||||
*/
|
||||
|
||||
#ifdef NSH_HAVE_MMCSD_CDINT
|
||||
|
||||
(void)irq_attach(LPC17_IRQ_P0p13, nsh_cdinterrupt, NULL);
|
||||
up_enable_irq(LPC17_IRQ_P0p13);
|
||||
|
||||
@ -361,7 +360,7 @@ static int nsh_usbhostinitialize(void)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: lpc17_bringup
|
||||
* Name: open1788_bringup
|
||||
*
|
||||
* Description:
|
||||
* Perform architecture-specific initialization
|
||||
@ -374,7 +373,7 @@ static int nsh_usbhostinitialize(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int lpc17_bringup(void)
|
||||
int open1788_bringup(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@ -398,6 +397,16 @@ int lpc17_bringup(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_INPUT_ADS7843E
|
||||
/* Initialize the touchscreen */
|
||||
|
||||
ret = open1788_tsc_setup(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: open1788_tsc_setup failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_OPEN1788_DJOYSTICK
|
||||
/* Initialize and register the joystick driver */
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
/************************************************************************************
|
||||
* configs/open1788/src/lpc17_touchscreen.c
|
||||
* arch/arm/src/board/lpc17_touchscreen.c
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
@ -255,13 +254,12 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup
|
||||
* Name: open1788_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 function is called by board-bringup 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
|
||||
@ -272,7 +270,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_tsc_setup(int minor)
|
||||
int open1788_tsc_setup(int minor)
|
||||
{
|
||||
static bool initialized = false;
|
||||
FAR struct spi_dev_s *dev;
|
||||
|
@ -2,7 +2,7 @@
|
||||
* configs/open1788/src/open1788.h
|
||||
* arch/arm/src/board/open1788.n
|
||||
*
|
||||
* Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2013, 2017-2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -162,7 +162,7 @@
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Name: lpc17_bringup
|
||||
* Name: open1788_bringup
|
||||
*
|
||||
* Description:
|
||||
* Perform architecture-specific initialization
|
||||
@ -175,7 +175,7 @@
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
int lpc17_bringup(void);
|
||||
int open1788_bringup(void);
|
||||
|
||||
/************************************************************************************
|
||||
* Name: open1788_sspdev_initialize
|
||||
@ -237,13 +237,34 @@ void open1788_nand_initialize(void);
|
||||
void open1788_lcd_initialize(void);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
/************************************************************************************
|
||||
* Name: open1788_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* This function is called by board-bringup 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.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_INPUT_ADS7843E
|
||||
int open1788_tsc_setup(int minor);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: lpc17_djoy_initialization
|
||||
*
|
||||
* Description:
|
||||
* Initialize and register the discrete joystick driver
|
||||
*
|
||||
****************************************************************************/
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_OPEN1788_DJOYSTICK
|
||||
int lpc17_djoy_initialization(void);
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* config/pic32mx7mmb/src/pic32_bringup.c
|
||||
*
|
||||
* Copyright (C) 2012, 2016-2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012, 2016-2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -407,5 +407,15 @@ int pic32mx_bringup(void)
|
||||
ret = nsh_usbdevinitialize();
|
||||
}
|
||||
|
||||
#ifdef CONFIG_INPUT
|
||||
/* Initialize the touchscreen */
|
||||
|
||||
ret = pic32mx_tsc_setup(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: pic32mx_tsc_setup failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -1343,13 +1343,12 @@ errout:
|
||||
************************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup
|
||||
* Name: pic32mx_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 function is called by board-bringup 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
|
||||
@ -1360,7 +1359,7 @@ errout:
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_tsc_setup(int minor)
|
||||
int pic32mx_tsc_setup(int minor)
|
||||
{
|
||||
FAR struct tc_dev_s *priv;
|
||||
char devname[DEV_NAMELEN];
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* configs/pic32mx7mmb/src/pic32mx7mmb.h
|
||||
*
|
||||
* Copyright (C) 2012, 2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012, 2017-2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -119,33 +119,33 @@ extern "C" {
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: pic32mx_spidev_initialize
|
||||
*
|
||||
* Description:
|
||||
* Called to configure SPI chip select GPIO pins for the Mikroelektronika PIC32MX7
|
||||
* MMB board.
|
||||
* Called to configure SPI chip select GPIO pins for the Mikroelektronika
|
||||
* PIC32MX7 MMB board.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_PIC32MX_SPI1) || defined(CONFIG_PIC32MX_SPI2) || \
|
||||
defined(CONFIG_PIC32MX_SPI3) || defined(CONFIG_PIC32MX_SPI4)
|
||||
void weak_function pic32mx_spidev_initialize(void);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: pic32mx_led_initialize
|
||||
*
|
||||
* Description:
|
||||
* Configure on-board LEDs if LED support has been selected.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_ARCH_LEDS
|
||||
void pic32mx_led_initialize(void);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: pic32mx_bringup
|
||||
*
|
||||
* Description:
|
||||
@ -157,7 +157,7 @@ void pic32mx_led_initialize(void);
|
||||
* CONFIG_BOARD_INITIALIZE=y && CONFIG_LIB_BOARDCTL=y :
|
||||
* Called from the NSH library
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
int pic32mx_bringup(void);
|
||||
|
||||
@ -173,6 +173,27 @@ int pic32mx_bringup(void);
|
||||
|
||||
void pic32mx_lcdinitialize(void);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: pic32mx_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* This function is called by board-bringup 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_INPUT
|
||||
int pic32mx_tsc_setup(int minor);
|
||||
#endif
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ CONFIG_ARCH="arm"
|
||||
CONFIG_ARMV7M_OABI_TOOLCHAIN=y
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=8720
|
||||
CONFIG_BOARDCTL_TSCTEST=y
|
||||
CONFIG_CXX_NEWLONG=y
|
||||
CONFIG_DISABLE_POLL=y
|
||||
CONFIG_HAVE_CXX=y
|
||||
|
@ -1,7 +1,7 @@
|
||||
/************************************************************************************
|
||||
* configs/sam3u-ek/src/sam3u-ek.h
|
||||
*
|
||||
* Copyright (C) 2009-2011, 2013 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2009-2011, 2013, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -263,5 +263,26 @@ bool sam_writeprotected(unsigned char slot);
|
||||
# define sam_writeprotected(slot) (false)
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: sam_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* This function is called by board-bringup 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.
|
||||
*
|
||||
***********************************************************************************/
|
||||
|
||||
#ifdef CONFIG_INPUT_ADS7843E
|
||||
int sam_tsc_setup(int minor);
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __CONFIGS_SAM3U_EK_SRC_SAM3U_EK_H */
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* config/sam3u-ek/src/sam_appinit.c
|
||||
*
|
||||
* Copyright (C) 2010, 2013, 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2010, 2013, 2016, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -128,9 +128,10 @@
|
||||
|
||||
int board_app_initialize(uintptr_t arg)
|
||||
{
|
||||
int ret;
|
||||
|
||||
#ifdef NSH_HAVE_MMCSD
|
||||
FAR struct sdio_dev_s *sdio;
|
||||
int ret;
|
||||
|
||||
/* Mount the SDIO-based MMC/SD block driver */
|
||||
/* First, get an instance of the SDIO interface */
|
||||
@ -164,5 +165,17 @@ int board_app_initialize(uintptr_t arg)
|
||||
|
||||
sdio_mediachange(sdio, sam_cardinserted(0));
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_INPUT
|
||||
/* Initialize the touchscreen */
|
||||
|
||||
ret = sam_tsc_setup(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: sam_tsc_setup failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
UNUSED(ret);
|
||||
return OK;
|
||||
}
|
||||
|
@ -216,13 +216,12 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup
|
||||
* Name: sam_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 function is called by board-bringup 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
|
||||
@ -233,7 +232,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_tsc_setup(int minor)
|
||||
int sam_tsc_setup(int minor)
|
||||
{
|
||||
FAR struct spi_dev_s *dev;
|
||||
int ret;
|
||||
@ -273,4 +272,3 @@ int board_tsc_setup(int minor)
|
||||
}
|
||||
|
||||
#endif /* CONFIG_INPUT_ADS7843E */
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/************************************************************************************
|
||||
* configs/sam4e-ek/src/sam4e-ek.h
|
||||
*
|
||||
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2014, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -440,14 +440,14 @@ bool sam_writeprotected(int slotno);
|
||||
# define sam_writeprotected(slotno) (false)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
/************************************************************************************
|
||||
* Name: sam_at25_automount
|
||||
*
|
||||
* Description:
|
||||
* Initialize, configure, and mount the AT25 serial FLASH. The FLASH will
|
||||
* be mounted at /dev/at25.
|
||||
*
|
||||
****************************************************************************/
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef HAVE_AT25
|
||||
int sam_at25_automount(int minor);
|
||||
@ -455,5 +455,26 @@ int sam_at25_automount(int minor);
|
||||
# define sam_at25_automount(minor) (-ENOSYS)
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: sam_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* This function is called by board-bringup 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.
|
||||
*
|
||||
***********************************************************************************/
|
||||
|
||||
#ifdef CONFIG_INPUT_ADS7843E
|
||||
int sam_tsc_setup(int minor);
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __CONFIGS_SAM4E_EK_SRC_SAM4E_EK_H */
|
||||
|
@ -213,13 +213,12 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup
|
||||
* Name: sam_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 function is called by board-bringup 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
|
||||
@ -230,7 +229,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_tsc_setup(int minor)
|
||||
int sam_tsc_setup(int minor)
|
||||
{
|
||||
FAR struct spi_dev_s *dev;
|
||||
int ret;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* config/sam4e-ek/src/sam_appinit.c
|
||||
*
|
||||
* Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2014, 2016, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -89,9 +89,7 @@
|
||||
|
||||
int board_app_initialize(uintptr_t arg)
|
||||
{
|
||||
#if defined(HAVE_AT25) || defined(HAVE_HSMCI) || defined(HAVE_USBMONITOR)
|
||||
int ret;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AT25
|
||||
/* Initialize the AT25 driver */
|
||||
@ -115,6 +113,16 @@ int board_app_initialize(uintptr_t arg)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_INPUT_ADS7843E
|
||||
/* Initialize the touchscreen */
|
||||
|
||||
ret = sam_tsc_setup(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: sam_tsc_setup failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_USBMONITOR
|
||||
/* Start the USB Monitor */
|
||||
|
||||
@ -126,5 +134,6 @@ int board_app_initialize(uintptr_t arg)
|
||||
}
|
||||
#endif
|
||||
|
||||
UNUSED(ret);
|
||||
return OK;
|
||||
}
|
||||
|
@ -12,7 +12,6 @@ CONFIG_ARCH_STACKDUMP=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARMV7A_TOOLCHAIN_CODESOURCERYW=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=49341
|
||||
CONFIG_BOARDCTL_TSCTEST=y
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_DISABLE_POLL=y
|
||||
CONFIG_FLASH_SIZE=134217728
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* config/sama5d3x-ek/src/sam_appinit.c
|
||||
*
|
||||
* Copyright (C) 2013-2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2013-2016, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -173,6 +173,16 @@ int board_app_initialize(uintptr_t arg)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SAMA5_TSD
|
||||
/* Initialize the touchscreen */
|
||||
|
||||
ret = sam_tsc_setup(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: sam_tsc_setup failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WM8904
|
||||
/* Configure WM8904 audio */
|
||||
|
||||
|
@ -64,34 +64,17 @@
|
||||
# define CONFIG_SAMA5D3xEK_TSD_DEVMINOR 0
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup
|
||||
* Name: sam_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 function is called by board-bringup 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
|
||||
@ -102,7 +85,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_tsc_setup(int minor)
|
||||
int sam_tsc_setup(int minor)
|
||||
{
|
||||
struct sam_adc_s *adc;
|
||||
static bool initialized = false;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/************************************************************************************
|
||||
* configs/sama5d3x-ek/src/sama5d3x-ek.h
|
||||
*
|
||||
* Copyright (C) 2013-2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2013-2015, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -833,6 +833,27 @@ int sam_usbhost_initialize(void);
|
||||
void weak_function sam_netinitialize(void);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: sam_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* This function is called by board-bringup 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.
|
||||
*
|
||||
***********************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SAMA5_TSD
|
||||
int sam_tsc_setup(int minor);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: sam_pwm_setup
|
||||
*
|
||||
|
@ -3268,7 +3268,6 @@ TM7000 LCD/Touchscreen
|
||||
build in a touchscreen test:
|
||||
|
||||
CONFIG_EXAMPLES_TOUCHSCREEN=y
|
||||
CONFIG_EXAMPLES_TOUCHSCREEN_ARCHINIT=y
|
||||
CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH="/dev/input0"
|
||||
CONFIG_EXAMPLES_TOUCHSCREEN_MINOR=0
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* config/sama5d4-ek/src/sam_bringup.c
|
||||
*
|
||||
* Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2014, 2016, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -288,6 +288,16 @@ int sam_bringup(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MAXTOUCH
|
||||
/* Initialize the touchscreen */
|
||||
|
||||
ret = sam_tsc_setup(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: sam_tsc_setup failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PWM
|
||||
/* Initialize PWM and register the PWM device. */
|
||||
|
||||
|
@ -219,13 +219,12 @@ static int mxt_interrupt(int irq, FAR void *context, FAR void *arg)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup
|
||||
* Name: sam_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 function is called by board-bringup 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
|
||||
@ -236,7 +235,7 @@ static int mxt_interrupt(int irq, FAR void *context, FAR void *arg)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_tsc_setup(int minor)
|
||||
int sam_tsc_setup(int minor)
|
||||
{
|
||||
FAR struct i2c_master_s *i2c;
|
||||
static bool initialized = false;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/************************************************************************************
|
||||
* configs/sama5d4-ek/src/sama5d4-ek.h
|
||||
*
|
||||
* Copyright (C) 2014-2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2014-2016, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -1060,19 +1060,41 @@ bool sam_writeprotected(int slotno);
|
||||
void weak_function sam_usbinitialize(void);
|
||||
#endif
|
||||
|
||||
/****************************************************************************************************
|
||||
/************************************************************************************
|
||||
* Name: stm32_usbhost_initialize
|
||||
*
|
||||
* Description:
|
||||
* Called at application startup time to initialize the USB host functionality. This function will
|
||||
* start a thread that will monitor for device connection/disconnection events.
|
||||
* Called at application startup time to initialize the USB host functionality.
|
||||
* This function will start a thread that will monitor for device connection/
|
||||
* disconnection events.
|
||||
*
|
||||
****************************************************************************************************/
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef HAVE_USBHOST
|
||||
int sam_usbhost_initialize(void);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: sam_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* This function is called by board-bringup 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.
|
||||
*
|
||||
***********************************************************************************/
|
||||
|
||||
#ifdef HAVE_MAXTOUCH
|
||||
int sam_tsc_setup(int minor);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: sam_pwm_setup
|
||||
*
|
||||
|
@ -1231,7 +1231,6 @@ MXT Configuration Options
|
||||
|
||||
Application Configuration -> Examples -> Touchscreen example
|
||||
CONFIG_EXAMPLES_TOUCHSCREEN=y : Enables the example
|
||||
CONFIG_EXAMPLES_TOUCHSCREEN_ARCHINIT=y : Have board-specific intialization
|
||||
CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH="/dev/input0"
|
||||
CONFIG_EXAMPLES_TOUCHSCREEN_MINOR=0
|
||||
|
||||
|
@ -27,7 +27,6 @@ CONFIG_AT24XX_EXTENDED=y
|
||||
CONFIG_AT24XX_EXTSIZE=160
|
||||
CONFIG_AT24XX_SIZE=2
|
||||
CONFIG_BOARD_LOOPSPERMSEC=51262
|
||||
CONFIG_BOARDCTL_TSCTEST=y
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_DISABLE_POLL=y
|
||||
CONFIG_FAT_LCNAMES=y
|
||||
|
@ -507,6 +507,16 @@ int sam_bringup(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MAXTOUCH
|
||||
/* Initialize the touchscreen */
|
||||
|
||||
ret = sam_tsc_setup(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: sam_tsc_setup failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WM8904
|
||||
/* Configure WM8904 audio */
|
||||
|
||||
|
@ -218,13 +218,12 @@ static int mxt_interrupt(int irq, FAR void *context, FAR void *arg)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup
|
||||
* Name: sam_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 function is called by board-bringup 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
|
||||
@ -235,7 +234,7 @@ static int mxt_interrupt(int irq, FAR void *context, FAR void *arg)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_tsc_setup(int minor)
|
||||
int sam_tsc_setup(int minor)
|
||||
{
|
||||
FAR struct i2c_master_s *i2c;
|
||||
static bool initialized = false;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/************************************************************************************
|
||||
* configs/samv71-xult/src/samv71-xult.h
|
||||
*
|
||||
* Copyright (C) 2015-2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2015-2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -846,28 +846,49 @@ bool sam_writeprotected(int slotno);
|
||||
int sam_at24config(void);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
/************************************************************************************
|
||||
* Name: sam_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* This function is called by board-bringup 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.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef HAVE_MAXTOUCH
|
||||
int sam_tsc_setup(int minor);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: sam_wm8904_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called by platform-specific, setup logic to configure
|
||||
* and register the WM8904 device. This function will register the driver
|
||||
* as /dev/wm8904[x] where x is determined by the minor device number.
|
||||
* This function is called by platform-specific, setup logic to configure and
|
||||
* register the WM8904 device. This function will register the driver as
|
||||
* /dev/wm8904[x] where x is determined by 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.
|
||||
* Zero is returned on success. Otherwise, a negated errno value is returned
|
||||
* to indicate the nature of the failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef HAVE_WM8904
|
||||
int sam_wm8904_initialize(int minor);
|
||||
#endif /* HAVE_WM8904 */
|
||||
|
||||
/****************************************************************************
|
||||
/************************************************************************************
|
||||
* Name: sam_audio_null_initialize
|
||||
*
|
||||
* Description:
|
||||
@ -877,26 +898,26 @@ int sam_wm8904_initialize(int minor);
|
||||
* 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.
|
||||
* Zero is returned on success. Otherwise, a negated errno value is returned
|
||||
* to indicate the nature of the failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef HAVE_AUDIO_NULL
|
||||
int sam_audio_null_initialize(int minor);
|
||||
#endif /* HAVE_AUDIO_NULL */
|
||||
|
||||
/****************************************************************************
|
||||
/************************************************************************************
|
||||
* Name: stm32_mrf24j40_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the MRF24J40 device.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero is returned on success. Otherwise, a negated errno value is
|
||||
* returned to indicate the nature of the failure.
|
||||
* Zero is returned on success. Otherwise, a negated errno value is returned
|
||||
* to indicate the nature of the failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef HAVE_MRF24J40
|
||||
int sam_mrf24j40_initialize(void);
|
||||
|
@ -17,7 +17,6 @@ CONFIG_ARCH_STACKDUMP=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=5483
|
||||
CONFIG_BOARDCTL_TSCTEST=y
|
||||
CONFIG_ETH0_PHY_DM9161=y
|
||||
CONFIG_HAVE_CXX=y
|
||||
CONFIG_HAVE_CXXINITIALIZE=y
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************************************
|
||||
* configs/shenzhou/src/shenzhou.h
|
||||
*
|
||||
* Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012, 2016, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -426,7 +426,7 @@ void weak_function stm32_spidev_initialize(void);
|
||||
* Name: stm32_usbinitialize
|
||||
*
|
||||
* Description:
|
||||
* Called from stm32_usbinitialize very early in inialization to setup USB-related GPIO pins for
|
||||
* Called from stm32_usbinitialize very early in initialization to setup USB-related GPIO pins for
|
||||
* the STM3240G-EVAL board.
|
||||
*
|
||||
****************************************************************************************************/
|
||||
@ -448,13 +448,34 @@ void weak_function stm32_usbinitialize(void);
|
||||
int stm32_usbhost_initialize(void);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: stm32_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* This function is called by board-bringup 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_INPUT_ADS7843E
|
||||
int stm32_tsc_setup(int minor);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_adc_setup
|
||||
*
|
||||
* Description:
|
||||
* Initialize ADC and register the ADC driver.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_ADC
|
||||
int stm32_adc_setup(void);
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* config/shenzhou/src/stm32_appinit.c
|
||||
*
|
||||
* Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012, 2016, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -204,6 +204,16 @@ int board_app_initialize(uintptr_t arg)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_INPUT_ADS7843E
|
||||
/* Initialize the touchscreen */
|
||||
|
||||
ret = stm32_tsc_setup(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: stm32_tsc_setup failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ADC
|
||||
/* Initialize ADC and register the ADC driver. */
|
||||
|
||||
|
@ -230,13 +230,12 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup
|
||||
* Name: stm32_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 function is called by board-bringup 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
|
||||
@ -247,7 +246,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_tsc_setup(int minor)
|
||||
int stm32_tsc_setup(int minor)
|
||||
{
|
||||
FAR struct spi_dev_s *dev;
|
||||
int ret;
|
||||
|
@ -729,10 +729,6 @@ nx11
|
||||
CONFIG_INPUT=y
|
||||
CONFIG_SIM_TOUCHSCREEN=y
|
||||
|
||||
Then you must also have some application logic that will call
|
||||
board_tsc_setup(0) to register the touchscreen driver. See
|
||||
also configuration "touchscreen"
|
||||
|
||||
NOTES:
|
||||
|
||||
a. If you do not have the call to sim_tcinitialize(0), the build
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* config/sim/src/sim.h
|
||||
*
|
||||
* Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2015-2016, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -123,4 +123,25 @@ int sim_zoneinfo(int minor);
|
||||
int sim_gpio_initialize(void);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sim_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* This function is called by board-bringup 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_SIM_X11FB) && defined(CONFIG_SIM_TOUCHSCREEN)
|
||||
int sim_tsc_setup(int minor);
|
||||
#endif
|
||||
|
||||
#endif /* __CONFIGS_SIM_SRC_SIM_H */
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* configs/sim/src/sam_bringup.c
|
||||
*
|
||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2015, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -68,8 +68,7 @@ int trv_mount_world(int minor, FAR const char *mountpoint);
|
||||
#define NEED_FRAMEBUFFER 1
|
||||
|
||||
/* If we are using the X11 touchscreen simulation, then the frame buffer
|
||||
* initialization happens in board_tsc_setup. Otherwise, we will need to
|
||||
* do that here.
|
||||
* initialization will need to be done here.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_SIM_X11FB) && defined(CONFIG_SIM_TOUCHSCREEN)
|
||||
@ -200,6 +199,16 @@ int sim_bringup(void)
|
||||
sim_ajoy_initialize();
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SIM_X11FB) && defined(CONFIG_SIM_TOUCHSCREEN)
|
||||
/* Initialize the touchscreen */
|
||||
|
||||
ret = sim_tsc_setup(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: sim_tsc_setup failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_GRAPHICS_TRAVELER_ROMFSDEMO
|
||||
/* Special initialization for the Traveler game simulation */
|
||||
|
||||
|
@ -145,16 +145,23 @@ static FAR void *sim_listener(FAR void *arg)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup()
|
||||
* Name: sim_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* Perform architecuture-specific initialization of the touchscreen
|
||||
* hardware. This interface must be provided by all configurations
|
||||
* using apps/examples/touchscreen
|
||||
* This function is called by board-bringup 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 board_tsc_setup(int minor)
|
||||
int sim_tsc_setup(int minor)
|
||||
{
|
||||
struct sched_param param;
|
||||
nxgl_mxpixel_t color;
|
||||
@ -262,4 +269,3 @@ errout_with_nx:
|
||||
errout:
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,6 @@ CONFIG_ARCH_STACKDUMP=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=10926
|
||||
CONFIG_BOARDCTL_TSCTEST=y
|
||||
CONFIG_ETH0_PHY_DP83848C=y
|
||||
CONFIG_FAT_LCNAMES=y
|
||||
CONFIG_FAT_LFN=y
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************************************
|
||||
* configs/stm3220g_eval/src/stm3220g.h
|
||||
*
|
||||
* Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012, 2016, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -249,6 +249,26 @@ void weak_function stm32_usbinitialize(void);
|
||||
int stm32_usbhost_initialize(void);
|
||||
#endif
|
||||
|
||||
/****************************************************************************************************
|
||||
* Name: stm32_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* This function is called by board-bringup 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.
|
||||
*
|
||||
****************************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_INPUT_STMPE811
|
||||
int stm32_tsc_setup(int minor);
|
||||
#endif
|
||||
|
||||
/****************************************************************************************************
|
||||
* Name: stm32_pwm_setup
|
||||
*
|
||||
@ -321,7 +341,7 @@ void stm32_extmemaddr(int naddrs);
|
||||
void stm32_extmemdata(int ndata);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************************************
|
||||
* Name: stm32_enablefsmc
|
||||
*
|
||||
* Description:
|
||||
@ -333,7 +353,7 @@ void stm32_extmemdata(int ndata);
|
||||
void stm32_enablefsmc(void);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************************************
|
||||
* Name: stm32_disablefsmc
|
||||
*
|
||||
* Description:
|
||||
@ -345,7 +365,7 @@ void stm32_enablefsmc(void);
|
||||
void stm32_disablefsmc(void);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************************************
|
||||
* Name: stm32_selectsram
|
||||
*
|
||||
* Description:
|
||||
@ -375,7 +395,7 @@ void stm32_disablefsmc(void);
|
||||
void stm32_selectsram(void);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************************************
|
||||
* Name: stm32_deselectsram
|
||||
*
|
||||
* Description:
|
||||
@ -387,7 +407,7 @@ void stm32_selectsram(void);
|
||||
void stm32_deselectsram(void);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************************************
|
||||
* Name: stm32_selectlcd
|
||||
*
|
||||
* Description:
|
||||
@ -399,7 +419,7 @@ void stm32_deselectsram(void);
|
||||
void stm32_selectlcd(void);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************************************
|
||||
* Name: stm32_deselectlcd
|
||||
*
|
||||
* Description:
|
||||
@ -413,4 +433,3 @@ void stm32_deselectlcd(void);
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __CONFIGS_STM3220G_EVAL_SRC_STM3220G_H */
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* config/stm3220g_eval/src/stm32_appinit.c
|
||||
*
|
||||
* Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012, 2016, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -292,6 +292,16 @@ int board_app_initialize(uintptr_t arg)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_INPUT_STMPE811
|
||||
/* Initialize the touchscreen */
|
||||
|
||||
ret = stm32_tsc_setup(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: stm32_tsc_setup failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PWM
|
||||
/* Initialize PWM and register the PWM device. */
|
||||
|
||||
|
@ -146,7 +146,8 @@ struct stm32_stmpe811config_s
|
||||
|
||||
/* IRQ/GPIO access callbacks. These operations all hidden behind callbacks
|
||||
* to isolate the STMPE811 driver from differences in GPIO
|
||||
* interrupt handling by varying boards and MCUs.* so that contact and loss-of-contact events can be detected.
|
||||
* interrupt handling by varying boards and MCUs.* so that contact and loss-
|
||||
* of-contact events can be detected.
|
||||
*
|
||||
* attach - Attach the STMPE811 interrupt handler to the GPIO interrupt
|
||||
* enable - Enable or disable the GPIO interrupt
|
||||
@ -264,16 +265,15 @@ static void stmpe811_clear(FAR struct stmpe811_config_s *state)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup
|
||||
* Name: stm32_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 function is called by board-bringup 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
|
||||
* minor - The input device minor number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero is returned on success. Otherwise, a negated errno value is
|
||||
@ -281,7 +281,7 @@ static void stmpe811_clear(FAR struct stmpe811_config_s *state)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_tsc_setup(int minor)
|
||||
int stm32_tsc_setup(int minor)
|
||||
{
|
||||
#ifndef CONFIG_STMPE811_TSC_DISABLE
|
||||
FAR struct i2c_master_s *dev;
|
||||
|
@ -15,7 +15,6 @@ CONFIG_ARM_MPU=y
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y
|
||||
CONFIG_BOARD_INITIALIZE=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=16717
|
||||
CONFIG_BOARDCTL_TSCTEST=y
|
||||
CONFIG_BUILD_PROTECTED=y
|
||||
CONFIG_CXX_NEWLONG=y
|
||||
CONFIG_DISABLE_POLL=y
|
||||
|
@ -15,7 +15,6 @@ CONFIG_ARCH_STACKDUMP=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=16717
|
||||
CONFIG_BOARDCTL_TSCTEST=y
|
||||
CONFIG_FAT_LCNAMES=y
|
||||
CONFIG_FAT_LFN=y
|
||||
CONFIG_FS_FAT=y
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************************************
|
||||
* configs/stm3240g_eval/src/stm3240g_eval.h
|
||||
*
|
||||
* Copyright (C) 2011-2013, 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2011-2013, 2016, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -266,6 +266,26 @@ void weak_function stm32_usbinitialize(void);
|
||||
int stm32_usbhost_initialize(void);
|
||||
#endif
|
||||
|
||||
/****************************************************************************************************
|
||||
* Name: stm32_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* This function is called by board-bringup 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.
|
||||
*
|
||||
****************************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_INPUT_STMPE811
|
||||
int stm32_tsc_setup(int minor);
|
||||
#endif
|
||||
|
||||
/****************************************************************************************************
|
||||
* Name: stm32_led_initialize
|
||||
*
|
||||
|
@ -67,7 +67,7 @@
|
||||
* arg - The boardctl() argument is passed to the board_app_initialize()
|
||||
* implementation without modification. The argument has no
|
||||
* meaning to NuttX; the meaning of the argument is a contract
|
||||
* between the board-specific initalization logic and the
|
||||
* between the board-specific initialization logic and the
|
||||
* matching application logic. The value cold be such things as a
|
||||
* mode enumeration value, a set of DIP switch switch settings, a
|
||||
* pointer to configuration data read from a file or serial FLASH,
|
||||
|
@ -64,12 +64,8 @@
|
||||
#endif
|
||||
|
||||
/* Should we initialize the touchscreen for the NxWM (CONFIG_NXWM=y)? This
|
||||
* is done if we have a touchscreen (CONFIG_INPUT_STMPE811=y), NxWM uses the
|
||||
* touchscreen (CONFIG_NXWM_TOUCHSCREEN=y), and if we were asked to
|
||||
* initialize the touchscreen for NxWM (NXWM_TOUCHSCREEN_DEVINIT=n). This
|
||||
* combination of settings is normally only used in the kernel build mode
|
||||
* (CONFIG_BUILD_PROTECTED) when NxWidgets is unable to initialize NX from
|
||||
* user-space.
|
||||
* is done if we have a touchscreen (CONFIG_INPUT_STMPE811=y) and NxWM uses the
|
||||
* touchscreen (CONFIG_NXWM_TOUCHSCREEN=y).
|
||||
*/
|
||||
|
||||
#undef HAVE_TCINIT
|
||||
@ -78,14 +74,10 @@
|
||||
# if !defined(CONFIG_NXWM_TOUCHSCREEN_DEVNO)
|
||||
# error CONFIG_NXWM_TOUCHSCREEN_DEVNO is not defined
|
||||
# elif defined(CONFIG_INPUT_STMPE811)
|
||||
# if !defined(CONFIG_NXWM_TOUCHSCREEN_DEVINIT)
|
||||
# define HAVE_TCINIT
|
||||
# include <nuttx/input/touchscreen.h>
|
||||
# endif
|
||||
# define HAVE_TCINIT 1
|
||||
# include <nuttx/input/touchscreen.h>
|
||||
# else
|
||||
# if !defined(CONFIG_NXWM_TOUCHSCREEN_DEVINIT) && defined(CONFIG_BUILD_PROTECTED)
|
||||
# error CONFIG_INPUT_STMPE811=y is needed
|
||||
# endif
|
||||
# error CONFIG_INPUT_STMPE811=y is needed
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@ -143,10 +135,7 @@ static int board_initthread(int argc, char *argv[])
|
||||
{
|
||||
int ret;
|
||||
|
||||
/* Perform NSH initialization here instead of from the NSH. This
|
||||
* alternative NSH initialization is necessary when NSH is ran in user-space
|
||||
* but the initialization function must run in kernel space.
|
||||
*/
|
||||
/* Perform the board initialization on an initialization thread */
|
||||
|
||||
ret = stm32_bringup();
|
||||
if (ret < 0)
|
||||
@ -154,26 +143,6 @@ static int board_initthread(int argc, char *argv[])
|
||||
gerr("ERROR: stm32_bringup failed: %d\n", ret);
|
||||
}
|
||||
|
||||
#ifdef HAVE_NXSTART
|
||||
/* Initialize the NX server */
|
||||
|
||||
ret = nx_start();
|
||||
if (ret < 0)
|
||||
{
|
||||
gerr("ERROR: nx_start failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_TCINIT
|
||||
/* Initialize the touchscreen */
|
||||
|
||||
ret = board_tsc_setup(CONFIG_NXWM_TOUCHSCREEN_DEVNO);
|
||||
if (ret < 0)
|
||||
{
|
||||
gerr("ERROR: board_tsc_setup failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
@ -257,6 +226,11 @@ void board_initialize(void)
|
||||
NULL);
|
||||
ASSERT(server > 0);
|
||||
#else
|
||||
/* Perform the board initialization on the start-up thread. Some
|
||||
* initializations may fail in this case due to the limited capability of
|
||||
* the start-up thread.
|
||||
*/
|
||||
|
||||
(void)stm32_bringup();
|
||||
#endif
|
||||
}
|
||||
|
@ -354,6 +354,26 @@ int stm32_bringup(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NXSTART
|
||||
/* Initialize the NX server */
|
||||
|
||||
ret = nx_start();
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: nx_start failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_TCINIT
|
||||
/* Initialize the touchscreen */
|
||||
|
||||
ret = stm32_tsc_setup(CONFIG_NXWM_TOUCHSCREEN_DEVNO);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: stm32_tsc_setup failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PWM
|
||||
/* Initialize PWM and register the PWM device. */
|
||||
|
||||
|
@ -264,13 +264,12 @@ static void stmpe811_clear(FAR struct stmpe811_config_s *state)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup
|
||||
* Name: stm32_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 function is called by board-bringup 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
|
||||
@ -281,7 +280,7 @@ static void stmpe811_clear(FAR struct stmpe811_config_s *state)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_tsc_setup(int minor)
|
||||
int stm32_tsc_setup(int minor)
|
||||
{
|
||||
#ifndef CONFIG_STMPE811_TSC_DISABLE
|
||||
FAR struct i2c_master_s *dev;
|
||||
|
@ -13,7 +13,6 @@ CONFIG_ARCH_STACKDUMP=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_BOARD_INITIALIZE=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=16717
|
||||
CONFIG_BOARDCTL_TSCTEST=y
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_DEBUG_CUSTOMOPT=y
|
||||
CONFIG_DEBUG_SYMBOLS=y
|
||||
|
@ -68,12 +68,8 @@
|
||||
#endif
|
||||
|
||||
/* Should we initialize the touchscreen for the NxWM (CONFIG_NXWM=y)? This
|
||||
* is done if we have a touchscreen (CONFIG_INPUT_STMPE811=y), NxWM uses the
|
||||
* touchscreen (CONFIG_NXWM_TOUCHSCREEN=y), and if we were asked to
|
||||
* initialize the touchscreen for NxWM (NXWM_TOUCHSCREEN_DEVINIT=n). This
|
||||
* combination of settings is normally only used in the kernel build mode
|
||||
* (CONFIG_BUILD_PROTECTED) when NxWidgets is unable to initialize NX from
|
||||
* user-space.
|
||||
* is done if we have a touchscreen (CONFIG_INPUT_STMPE811=y) and NxWM uses the
|
||||
* touchscreen (CONFIG_NXWM_TOUCHSCREEN=y).
|
||||
*/
|
||||
|
||||
#undef HAVE_TCINIT
|
||||
@ -82,14 +78,10 @@
|
||||
# if !defined(CONFIG_NXWM_TOUCHSCREEN_DEVNO)
|
||||
# error CONFIG_NXWM_TOUCHSCREEN_DEVNO is not defined
|
||||
# elif defined(CONFIG_INPUT_STMPE811)
|
||||
# if !defined(CONFIG_NXWM_TOUCHSCREEN_DEVINIT)
|
||||
# define HAVE_TCINIT
|
||||
# include <nuttx/input/touchscreen.h>
|
||||
# endif
|
||||
# define HAVE_TCINIT
|
||||
# include <nuttx/input/touchscreen.h>
|
||||
# else
|
||||
# if !defined(CONFIG_NXWM_TOUCHSCREEN_DEVINIT) && defined(CONFIG_BUILD_PROTECTED)
|
||||
# error CONFIG_INPUT_STMPE811=y is needed
|
||||
# endif
|
||||
# error CONFIG_INPUT_STMPE811=y is needed
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* config/stm32f429i-disco/src/stm32_bringup.c
|
||||
*
|
||||
* Copyright (C) 2012, 2015-2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012, 2015-2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -345,6 +345,16 @@ int stm32_bringup(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_INPUT_STMPE811
|
||||
/* Initialize the touchscreen */
|
||||
|
||||
ret = stm32_tsc_setup(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: stm32_tsc_setup failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SENSORS_L3GD20
|
||||
ret = stm32_l3gd20initialize("/dev/gyr0");
|
||||
if (ret != OK)
|
||||
|
@ -267,13 +267,12 @@ static void stmpe811_clear(FAR struct stmpe811_config_s *state)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup
|
||||
* Name: stm32_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 function is called by board-bringup 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
|
||||
@ -284,7 +283,7 @@ static void stmpe811_clear(FAR struct stmpe811_config_s *state)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_tsc_setup(int minor)
|
||||
int stm32_tsc_setup(int minor)
|
||||
{
|
||||
#ifndef CONFIG_STMPE811_TSC_DISABLE
|
||||
FAR struct i2c_master_s *dev;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* configs/stm32f429i-disco/src/stm32f429i-disco.h
|
||||
*
|
||||
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2011-2012, 2018 Gregory Nutt. All rights reserved.
|
||||
* Authors: Gregory Nutt <gnutt@nuttx.org>
|
||||
* Marco Krahl <ocram.lhark@gmail.com>
|
||||
*
|
||||
@ -230,8 +230,8 @@ void weak_function stm32_spidev_initialize(void);
|
||||
* Name: stm32_usbinitialize
|
||||
*
|
||||
* Description:
|
||||
* Called from stm32_usbinitialize very early in inialization to setup USB-related
|
||||
* GPIO pins for the STM32F429Discovery board.
|
||||
* Called from stm32_usbinitialize very early in inialization to setup USB-
|
||||
* related GPIO pins for the STM32F429Discovery board.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
@ -253,6 +253,27 @@ void weak_function stm32_usbinitialize(void);
|
||||
int stm32_usbhost_initialize(void);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* This function is called by board-bringup 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_INPUT_STMPE811
|
||||
int stm32_tsc_setup(int minor);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
* Name: stm32_enablefsmc
|
||||
@ -352,7 +373,6 @@ FAR struct ili9341_lcd_s *stm32_ili93414ws_initialize(void);
|
||||
FAR struct spi_dev_s *stm32_spi5initialize(void);
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_l3gd20initialize()
|
||||
*
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* config/viewtool-stm32f107/src/stm32_bringup.c
|
||||
*
|
||||
* Copyright (C) 2013, 2016-2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2013, 2016-2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -165,6 +165,16 @@ int stm32_bringup(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_INPUT_ADS7843E
|
||||
/* Initialize the touchscreen */
|
||||
|
||||
ret = stm32_tsc_setup(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: stm32_tsc_setup failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CAN
|
||||
/* Initialize CAN and register the CAN driver. */
|
||||
|
||||
|
@ -239,13 +239,12 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup
|
||||
* Name: stm32_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 function is called by board-bringup 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
|
||||
@ -256,7 +255,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_tsc_setup(int minor)
|
||||
int stm32_tsc_setup(int minor)
|
||||
{
|
||||
FAR struct spi_dev_s *dev;
|
||||
static bool initialized = false;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* configs/viewtool-stm32f107/src/viewtool_stm32f107.h
|
||||
*
|
||||
* Copyright (C) 2013-2014, 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2013-2014, 2016, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -348,8 +348,8 @@ void stm32_led_initialize(void);
|
||||
* Name: stm32_usbdev_initialize
|
||||
*
|
||||
* Description:
|
||||
* Called from stm32_usbdev_initialize very early in initialization to setup USB-related
|
||||
* GPIO pins for the Viewtool STM32F107 board.
|
||||
* Called from stm32_usbdev_initialize very early in initialization to
|
||||
* setup USB-related GPIO pins for the Viewtool STM32F107 board.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
@ -357,6 +357,27 @@ void stm32_led_initialize(void);
|
||||
void weak_function stm32_usbdev_initialize(void);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* This function is called by board-bringup 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_INPUT_ADS7843E
|
||||
int stm32_tsc_setup(int minor);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_sdinitialize
|
||||
*
|
||||
|
@ -285,33 +285,6 @@ int board_composite_initialize(int port);
|
||||
FAR void *board_composite_connect(int port, int configid);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* 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 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_graphics_setup
|
||||
*
|
||||
|
@ -114,12 +114,6 @@
|
||||
* ARG: None
|
||||
* CONFIGURATION: CONFIG_NX
|
||||
* DEPENDENCIES: Base graphics logic provides nx_start()
|
||||
*
|
||||
* CMD: BOARDIOC_TSCTEST_SETUP
|
||||
* DESCRIPTION: Touchscreen controller test configuration
|
||||
* ARG: Touch controller device minor number
|
||||
* CONFIGURATION: CONFIG_LIB_BOARDCTL && CONFIG_BOARDCTL_TSCTEST
|
||||
* DEPENDENCIES: Board logic must provide board_tsc_setup()
|
||||
*/
|
||||
|
||||
#define BOARDIOC_INIT _BOARDIOC(0x0001)
|
||||
@ -130,7 +124,6 @@
|
||||
#define BOARDIOC_OS_SYMTAB _BOARDIOC(0x0006)
|
||||
#define BOARDIOC_USBDEV_CONTROL _BOARDIOC(0x0007)
|
||||
#define BOARDIOC_NX_START _BOARDIOC(0x0008)
|
||||
#define BOARDIOC_TSCTEST_SETUP _BOARDIOC(0x0009)
|
||||
|
||||
/* If CONFIG_BOARDCTL_IOCTL=y, then board-specific commands will be support.
|
||||
* In this case, all commands not recognized by boardctl() will be forwarded
|
||||
@ -139,7 +132,7 @@
|
||||
* User defined board commands may begin with this value:
|
||||
*/
|
||||
|
||||
#define BOARDIOC_USER _BOARDIOC(0x000a)
|
||||
#define BOARDIOC_USER _BOARDIOC(0x0009)
|
||||
|
||||
/****************************************************************************
|
||||
* Public Type Definitions
|
||||
|
Loading…
Reference in New Issue
Block a user