mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
The STMPE11/touchscreen is now fully functional on the STM3240G-EVAL
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4715 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
+8
-2
@@ -792,6 +792,8 @@ defconfig -- This is a configuration file similar to the Linux
|
||||
Enables support for the I2C interface
|
||||
CONFIG_STMPE11_MULTIPLE
|
||||
Can be defined to support multiple STMPE11 devices on board.
|
||||
CONFIG_STMPE11_ACTIVELOW
|
||||
Interrupt is generated by an active low signal.
|
||||
CONFIG_STMPE11_NPOLLWAITERS
|
||||
Maximum number of threads that can be waiting on poll() (ignored if
|
||||
CONFIG_DISABLE_POLL is set).
|
||||
@@ -802,10 +804,14 @@ defconfig -- This is a configuration file similar to the Linux
|
||||
CONFIG_STMPE11_GPIO_DISABLE
|
||||
Disable driver GPIO functionlaity.
|
||||
CONFIG_STMPE11_GPIOINT_DISABLE
|
||||
Disable driver GPIO interrupt functionlality (ignored if GPIO
|
||||
Disable driver GPIO interrupt functionality (ignored if GPIO
|
||||
functionality is disabled).
|
||||
CONFIG_STMPE11_SWAPXY
|
||||
Reverse the meaning of X and Y to handle different LCD orientations.
|
||||
CONFIG_STMPE11_TEMP_DISABLE
|
||||
Disable driver temperature sensor functionlaity.
|
||||
Disable driver temperature sensor functionality.
|
||||
CONFIG_STMPE11_REGDEBUG
|
||||
Enabled very low register-level debug output. Requires CONFIG_DEBUG.
|
||||
|
||||
Analog Devices
|
||||
|
||||
|
||||
@@ -967,6 +967,8 @@ CONFIG_INPUT_TSC2007=n
|
||||
# Enables support for the I2C interface
|
||||
# CONFIG_STMPE11_MULTIPLE
|
||||
# Can be defined to support multiple STMPE11 devices on board.
|
||||
# CONFIG_STMPE11_ACTIVELOW
|
||||
# Interrupt is generated by an active low signal.
|
||||
# CONFIG_STMPE11_NPOLLWAITERS
|
||||
# Maximum number of threads that can be waiting on poll() (ignored if
|
||||
# CONFIG_DISABLE_POLL is set).
|
||||
@@ -975,23 +977,31 @@ CONFIG_INPUT_TSC2007=n
|
||||
# CONFIG_STMPE11_ADC_DISABLE
|
||||
# Disable driver ADC functionality.
|
||||
# CONFIG_STMPE11_GPIO_DISABLE
|
||||
# Disable driver GPIO functionlaity.
|
||||
# Disable driver GPIO functionality.
|
||||
# CONFIG_STMPE11_GPIOINT_DISABLE
|
||||
# Disable driver GPIO interrupt functionlality (ignored if GPIO functionality is
|
||||
# Disable driver GPIO interrupt functionality (ignored if GPIO functionality is
|
||||
# disabled).
|
||||
# CONFIG_STMPE11_SWAPXY
|
||||
# Reverse the meaning of X and Y to handle different LCD orientations.
|
||||
# For the STM3240G-EVAL, X and Y should be swapped in PORTRAIT modes
|
||||
# CONFIG_STMPE11_TEMP_DISABLE
|
||||
# Disable driver temperature sensor functionlaity.
|
||||
# Disable driver temperature sensor functionality.
|
||||
# CONFIG_STMPE11_REGDBUG
|
||||
# Enabled very low register-level debug output. Requires CONFIG_DEBUG.
|
||||
#
|
||||
CONFIG_INPUT_STMPE11=n
|
||||
CONFIG_STMPE11_SPI=n
|
||||
CONFIG_STMPE11_I2C=y
|
||||
CONFIG_STMPE11_MULTIPLE=y
|
||||
CONFIG_STMPE11_ACTIVELOW=y
|
||||
#CONFIG_STMPE11_NPOLLWAITERS
|
||||
CONFIG_STMPE11_TSC_DISABLE=n
|
||||
CONFIG_STMPE11_ADC_DISABLE=y
|
||||
CONFIG_STMPE11_GPIO_DISABLE=y
|
||||
CONFIG_STMPE11_GPIOINT_DISABLE=y
|
||||
CONFIG_STMPE11_SWAPXY=y
|
||||
CONFIG_STMPE11_TEMP_DISABLE=y
|
||||
CONFIG_STMPE11_REGDEBUG=n
|
||||
|
||||
#
|
||||
# USB Device Configuration
|
||||
@@ -1128,11 +1138,11 @@ CONFIG_USBMSC_REMOVABLE=y
|
||||
# CONFIG_NXTK_BORDERWIDTH
|
||||
# Specifies with with of the border (in pixels) used with
|
||||
# framed windows. The default is 4.
|
||||
# CONFIG_NXTK_BORDERCOLOR1 and CONFIG_NXTK_BORDERCOLOR2
|
||||
# CONFIG_NXTK_BORDERCOLOR1, CONFIG_NXTK_BORDERCOLOR2, CONFIG_NXTK_BORDERCOLOR3
|
||||
# Specify the colors of the border used with framed windows.
|
||||
# CONFIG_NXTK_BORDERCOLOR2 is the shadow side color and so
|
||||
# is normally darker. The default is medium and dark grey,
|
||||
# respectively
|
||||
# CONFIG_NXTK_BORDERCOLOR2 is the shadow side color and so is normally darker.
|
||||
# CONFIG_NXTK_BORDERCOLOR3 is the shiny side color and so is normally brighter.
|
||||
# The default is mediumdark grey, and light grey, respectively
|
||||
# CONFIG_NXTK_AUTORAISE
|
||||
# If set, a window will be raised to the top if the mouse position
|
||||
# is over a visible portion of the window. Default: A mouse
|
||||
@@ -1313,7 +1323,7 @@ CONFIG_LCD_RPORTRAIT=y
|
||||
# STM3240G-EVAL specific LCD settings
|
||||
#
|
||||
CONFIG_STM32_ILI9320_DISABLE=n
|
||||
CONFIG_STM32_ILI9325_DISABLE=n
|
||||
CONFIG_STM32_ILI9325_DISABLE=y
|
||||
|
||||
#
|
||||
# Settings for examples/uip
|
||||
|
||||
@@ -967,6 +967,8 @@ CONFIG_INPUT_TSC2007=n
|
||||
# Enables support for the I2C interface
|
||||
# CONFIG_STMPE11_MULTIPLE
|
||||
# Can be defined to support multiple STMPE11 devices on board.
|
||||
# CONFIG_STMPE11_ACTIVELOW
|
||||
# Interrupt is generated by an active low signal.
|
||||
# CONFIG_STMPE11_NPOLLWAITERS
|
||||
# Maximum number of threads that can be waiting on poll() (ignored if
|
||||
# CONFIG_DISABLE_POLL is set).
|
||||
@@ -975,23 +977,31 @@ CONFIG_INPUT_TSC2007=n
|
||||
# CONFIG_STMPE11_ADC_DISABLE
|
||||
# Disable driver ADC functionality.
|
||||
# CONFIG_STMPE11_GPIO_DISABLE
|
||||
# Disable driver GPIO functionlaity.
|
||||
# Disable driver GPIO functionality.
|
||||
# CONFIG_STMPE11_GPIOINT_DISABLE
|
||||
# Disable driver GPIO interrupt functionlality (ignored if GPIO functionality is
|
||||
# Disable driver GPIO interrupt functionality (ignored if GPIO functionality is
|
||||
# disabled).
|
||||
# CONFIG_STMPE11_SWAPXY
|
||||
# Reverse the meaning of X and Y to handle different LCD orientations.
|
||||
# For the STM3240G-EVAL, X and Y should be swapped in PORTRAIT modes
|
||||
# CONFIG_STMPE11_TEMP_DISABLE
|
||||
# Disable driver temperature sensor functionlaity.
|
||||
# Disable driver temperature sensor functionality.
|
||||
# CONFIG_STMPE11_REGDBUG
|
||||
# Enabled very low register-level debug output. Requires CONFIG_DEBUG.
|
||||
#
|
||||
CONFIG_INPUT_STMPE11=n
|
||||
CONFIG_STMPE11_SPI=n
|
||||
CONFIG_STMPE11_I2C=y
|
||||
CONFIG_STMPE11_MULTIPLE=y
|
||||
CONFIG_STMPE11_ACTIVELOW=y
|
||||
#CONFIG_STMPE11_NPOLLWAITERS
|
||||
CONFIG_STMPE11_TSC_DISABLE=n
|
||||
CONFIG_STMPE11_ADC_DISABLE=y
|
||||
CONFIG_STMPE11_GPIO_DISABLE=y
|
||||
CONFIG_STMPE11_GPIOINT_DISABLE=y
|
||||
CONFIG_STMPE11_SWAPXY=n
|
||||
CONFIG_STMPE11_TEMP_DISABLE=y
|
||||
CONFIG_STMPE11_REGDEBUG=n
|
||||
|
||||
#
|
||||
# USB Device Configuration
|
||||
|
||||
@@ -181,7 +181,7 @@ static struct stm32_stmpe11config_s g_stmpe11config =
|
||||
#ifdef CONFIG_STMPE11_MULTIPLE
|
||||
.irq = STM32_IRQ_EXTI2,
|
||||
#endif
|
||||
.ctrl1 = (ADC_CTRL1_SAMPLE_TIME_80|ADC_CTRL1_MOD_12B|ADC_CTRL1_REF_SEL),
|
||||
.ctrl1 = (ADC_CTRL1_SAMPLE_TIME_80 | ADC_CTRL1_MOD_12B),
|
||||
.ctrl2 = ADC_CTRL2_ADC_FREQ_3p25,
|
||||
|
||||
.attach = stmpe11_attach,
|
||||
@@ -262,39 +262,44 @@ int arch_tcinitialize(void)
|
||||
FAR struct i2c_dev_s *dev;
|
||||
int ret;
|
||||
|
||||
ivdbg("Initializing\n");
|
||||
/* Check if we are already initialized */
|
||||
|
||||
/* Configure and enable the STMPE11 interrupt pin as an input */
|
||||
|
||||
(void)stm32_configgpio(GPIO_IO_EXPANDER);
|
||||
|
||||
/* Get an instance of the I2C interface */
|
||||
|
||||
dev = up_i2cinitialize(CONFIG_STMPE11_I2CDEV);
|
||||
if (!dev)
|
||||
{
|
||||
idbg("Failed to initialize I2C bus %d\n", CONFIG_STMPE11_I2CDEV);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Instantiate the STMPE11 driver */
|
||||
|
||||
g_stmpe11config.handle =
|
||||
stmpe11_instantiate(dev, (FAR struct stmpe11_config_s *)&g_stmpe11config);
|
||||
if (!g_stmpe11config.handle)
|
||||
{
|
||||
idbg("Failed to instantiate the STMPE11 driver\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
ivdbg("Initializing\n");
|
||||
|
||||
/* Initialize and register the I2C touschscreen device */
|
||||
/* Configure the STMPE11 interrupt pin as an input */
|
||||
|
||||
ret = stmpe11_register(dev, CONFIG_STMPE11_DEVMINOR);
|
||||
if (ret < 0)
|
||||
{
|
||||
idbg("Failed to register STMPE driver: %d\n", ret);
|
||||
/* up_i2cuninitialize(dev); */
|
||||
return -ENODEV;
|
||||
(void)stm32_configgpio(GPIO_IO_EXPANDER);
|
||||
|
||||
/* Get an instance of the I2C interface */
|
||||
|
||||
dev = up_i2cinitialize(CONFIG_STMPE11_I2CDEV);
|
||||
if (!dev)
|
||||
{
|
||||
idbg("Failed to initialize I2C bus %d\n", CONFIG_STMPE11_I2CDEV);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Instantiate the STMPE11 driver */
|
||||
|
||||
g_stmpe11config.handle =
|
||||
stmpe11_instantiate(dev, (FAR struct stmpe11_config_s *)&g_stmpe11config);
|
||||
if (!g_stmpe11config.handle)
|
||||
{
|
||||
idbg("Failed to instantiate the STMPE11 driver\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Initialize and register the I2C touchscreen device */
|
||||
|
||||
ret = stmpe11_register(g_stmpe11config.handle, CONFIG_STMPE11_DEVMINOR);
|
||||
if (ret < 0)
|
||||
{
|
||||
idbg("Failed to register STMPE driver: %d\n", ret);
|
||||
/* up_i2cuninitialize(dev); */
|
||||
return -ENODEV;
|
||||
}
|
||||
}
|
||||
|
||||
return OK;
|
||||
|
||||
Reference in New Issue
Block a user