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
|
Enables support for the I2C interface
|
||||||
CONFIG_STMPE11_MULTIPLE
|
CONFIG_STMPE11_MULTIPLE
|
||||||
Can be defined to support multiple STMPE11 devices on board.
|
Can be defined to support multiple STMPE11 devices on board.
|
||||||
|
CONFIG_STMPE11_ACTIVELOW
|
||||||
|
Interrupt is generated by an active low signal.
|
||||||
CONFIG_STMPE11_NPOLLWAITERS
|
CONFIG_STMPE11_NPOLLWAITERS
|
||||||
Maximum number of threads that can be waiting on poll() (ignored if
|
Maximum number of threads that can be waiting on poll() (ignored if
|
||||||
CONFIG_DISABLE_POLL is set).
|
CONFIG_DISABLE_POLL is set).
|
||||||
@@ -802,10 +804,14 @@ defconfig -- This is a configuration file similar to the Linux
|
|||||||
CONFIG_STMPE11_GPIO_DISABLE
|
CONFIG_STMPE11_GPIO_DISABLE
|
||||||
Disable driver GPIO functionlaity.
|
Disable driver GPIO functionlaity.
|
||||||
CONFIG_STMPE11_GPIOINT_DISABLE
|
CONFIG_STMPE11_GPIOINT_DISABLE
|
||||||
Disable driver GPIO interrupt functionlality (ignored if GPIO
|
Disable driver GPIO interrupt functionality (ignored if GPIO
|
||||||
functionality is disabled).
|
functionality is disabled).
|
||||||
|
CONFIG_STMPE11_SWAPXY
|
||||||
|
Reverse the meaning of X and Y to handle different LCD orientations.
|
||||||
CONFIG_STMPE11_TEMP_DISABLE
|
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
|
Analog Devices
|
||||||
|
|
||||||
|
|||||||
@@ -967,6 +967,8 @@ CONFIG_INPUT_TSC2007=n
|
|||||||
# Enables support for the I2C interface
|
# Enables support for the I2C interface
|
||||||
# CONFIG_STMPE11_MULTIPLE
|
# CONFIG_STMPE11_MULTIPLE
|
||||||
# Can be defined to support multiple STMPE11 devices on board.
|
# Can be defined to support multiple STMPE11 devices on board.
|
||||||
|
# CONFIG_STMPE11_ACTIVELOW
|
||||||
|
# Interrupt is generated by an active low signal.
|
||||||
# CONFIG_STMPE11_NPOLLWAITERS
|
# CONFIG_STMPE11_NPOLLWAITERS
|
||||||
# Maximum number of threads that can be waiting on poll() (ignored if
|
# Maximum number of threads that can be waiting on poll() (ignored if
|
||||||
# CONFIG_DISABLE_POLL is set).
|
# CONFIG_DISABLE_POLL is set).
|
||||||
@@ -975,23 +977,31 @@ CONFIG_INPUT_TSC2007=n
|
|||||||
# CONFIG_STMPE11_ADC_DISABLE
|
# CONFIG_STMPE11_ADC_DISABLE
|
||||||
# Disable driver ADC functionality.
|
# Disable driver ADC functionality.
|
||||||
# CONFIG_STMPE11_GPIO_DISABLE
|
# CONFIG_STMPE11_GPIO_DISABLE
|
||||||
# Disable driver GPIO functionlaity.
|
# Disable driver GPIO functionality.
|
||||||
# CONFIG_STMPE11_GPIOINT_DISABLE
|
# 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).
|
# 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
|
# 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_INPUT_STMPE11=n
|
||||||
CONFIG_STMPE11_SPI=n
|
CONFIG_STMPE11_SPI=n
|
||||||
CONFIG_STMPE11_I2C=y
|
CONFIG_STMPE11_I2C=y
|
||||||
CONFIG_STMPE11_MULTIPLE=y
|
CONFIG_STMPE11_MULTIPLE=y
|
||||||
|
CONFIG_STMPE11_ACTIVELOW=y
|
||||||
#CONFIG_STMPE11_NPOLLWAITERS
|
#CONFIG_STMPE11_NPOLLWAITERS
|
||||||
CONFIG_STMPE11_TSC_DISABLE=n
|
CONFIG_STMPE11_TSC_DISABLE=n
|
||||||
CONFIG_STMPE11_ADC_DISABLE=y
|
CONFIG_STMPE11_ADC_DISABLE=y
|
||||||
CONFIG_STMPE11_GPIO_DISABLE=y
|
CONFIG_STMPE11_GPIO_DISABLE=y
|
||||||
CONFIG_STMPE11_GPIOINT_DISABLE=y
|
CONFIG_STMPE11_GPIOINT_DISABLE=y
|
||||||
|
CONFIG_STMPE11_SWAPXY=y
|
||||||
CONFIG_STMPE11_TEMP_DISABLE=y
|
CONFIG_STMPE11_TEMP_DISABLE=y
|
||||||
|
CONFIG_STMPE11_REGDEBUG=n
|
||||||
|
|
||||||
#
|
#
|
||||||
# USB Device Configuration
|
# USB Device Configuration
|
||||||
@@ -1128,11 +1138,11 @@ CONFIG_USBMSC_REMOVABLE=y
|
|||||||
# CONFIG_NXTK_BORDERWIDTH
|
# CONFIG_NXTK_BORDERWIDTH
|
||||||
# Specifies with with of the border (in pixels) used with
|
# Specifies with with of the border (in pixels) used with
|
||||||
# framed windows. The default is 4.
|
# 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.
|
# Specify the colors of the border used with framed windows.
|
||||||
# CONFIG_NXTK_BORDERCOLOR2 is the shadow side color and so
|
# CONFIG_NXTK_BORDERCOLOR2 is the shadow side color and so is normally darker.
|
||||||
# is normally darker. The default is medium and dark grey,
|
# CONFIG_NXTK_BORDERCOLOR3 is the shiny side color and so is normally brighter.
|
||||||
# respectively
|
# The default is mediumdark grey, and light grey, respectively
|
||||||
# CONFIG_NXTK_AUTORAISE
|
# CONFIG_NXTK_AUTORAISE
|
||||||
# If set, a window will be raised to the top if the mouse position
|
# 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
|
# is over a visible portion of the window. Default: A mouse
|
||||||
@@ -1313,7 +1323,7 @@ CONFIG_LCD_RPORTRAIT=y
|
|||||||
# STM3240G-EVAL specific LCD settings
|
# STM3240G-EVAL specific LCD settings
|
||||||
#
|
#
|
||||||
CONFIG_STM32_ILI9320_DISABLE=n
|
CONFIG_STM32_ILI9320_DISABLE=n
|
||||||
CONFIG_STM32_ILI9325_DISABLE=n
|
CONFIG_STM32_ILI9325_DISABLE=y
|
||||||
|
|
||||||
#
|
#
|
||||||
# Settings for examples/uip
|
# Settings for examples/uip
|
||||||
|
|||||||
@@ -967,6 +967,8 @@ CONFIG_INPUT_TSC2007=n
|
|||||||
# Enables support for the I2C interface
|
# Enables support for the I2C interface
|
||||||
# CONFIG_STMPE11_MULTIPLE
|
# CONFIG_STMPE11_MULTIPLE
|
||||||
# Can be defined to support multiple STMPE11 devices on board.
|
# Can be defined to support multiple STMPE11 devices on board.
|
||||||
|
# CONFIG_STMPE11_ACTIVELOW
|
||||||
|
# Interrupt is generated by an active low signal.
|
||||||
# CONFIG_STMPE11_NPOLLWAITERS
|
# CONFIG_STMPE11_NPOLLWAITERS
|
||||||
# Maximum number of threads that can be waiting on poll() (ignored if
|
# Maximum number of threads that can be waiting on poll() (ignored if
|
||||||
# CONFIG_DISABLE_POLL is set).
|
# CONFIG_DISABLE_POLL is set).
|
||||||
@@ -975,23 +977,31 @@ CONFIG_INPUT_TSC2007=n
|
|||||||
# CONFIG_STMPE11_ADC_DISABLE
|
# CONFIG_STMPE11_ADC_DISABLE
|
||||||
# Disable driver ADC functionality.
|
# Disable driver ADC functionality.
|
||||||
# CONFIG_STMPE11_GPIO_DISABLE
|
# CONFIG_STMPE11_GPIO_DISABLE
|
||||||
# Disable driver GPIO functionlaity.
|
# Disable driver GPIO functionality.
|
||||||
# CONFIG_STMPE11_GPIOINT_DISABLE
|
# 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).
|
# 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
|
# 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_INPUT_STMPE11=n
|
||||||
CONFIG_STMPE11_SPI=n
|
CONFIG_STMPE11_SPI=n
|
||||||
CONFIG_STMPE11_I2C=y
|
CONFIG_STMPE11_I2C=y
|
||||||
CONFIG_STMPE11_MULTIPLE=y
|
CONFIG_STMPE11_MULTIPLE=y
|
||||||
|
CONFIG_STMPE11_ACTIVELOW=y
|
||||||
#CONFIG_STMPE11_NPOLLWAITERS
|
#CONFIG_STMPE11_NPOLLWAITERS
|
||||||
CONFIG_STMPE11_TSC_DISABLE=n
|
CONFIG_STMPE11_TSC_DISABLE=n
|
||||||
CONFIG_STMPE11_ADC_DISABLE=y
|
CONFIG_STMPE11_ADC_DISABLE=y
|
||||||
CONFIG_STMPE11_GPIO_DISABLE=y
|
CONFIG_STMPE11_GPIO_DISABLE=y
|
||||||
CONFIG_STMPE11_GPIOINT_DISABLE=y
|
CONFIG_STMPE11_GPIOINT_DISABLE=y
|
||||||
|
CONFIG_STMPE11_SWAPXY=n
|
||||||
CONFIG_STMPE11_TEMP_DISABLE=y
|
CONFIG_STMPE11_TEMP_DISABLE=y
|
||||||
|
CONFIG_STMPE11_REGDEBUG=n
|
||||||
|
|
||||||
#
|
#
|
||||||
# USB Device Configuration
|
# USB Device Configuration
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ static struct stm32_stmpe11config_s g_stmpe11config =
|
|||||||
#ifdef CONFIG_STMPE11_MULTIPLE
|
#ifdef CONFIG_STMPE11_MULTIPLE
|
||||||
.irq = STM32_IRQ_EXTI2,
|
.irq = STM32_IRQ_EXTI2,
|
||||||
#endif
|
#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,
|
.ctrl2 = ADC_CTRL2_ADC_FREQ_3p25,
|
||||||
|
|
||||||
.attach = stmpe11_attach,
|
.attach = stmpe11_attach,
|
||||||
@@ -262,9 +262,13 @@ int arch_tcinitialize(void)
|
|||||||
FAR struct i2c_dev_s *dev;
|
FAR struct i2c_dev_s *dev;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
/* Check if we are already initialized */
|
||||||
|
|
||||||
|
if (!g_stmpe11config.handle)
|
||||||
|
{
|
||||||
ivdbg("Initializing\n");
|
ivdbg("Initializing\n");
|
||||||
|
|
||||||
/* Configure and enable the STMPE11 interrupt pin as an input */
|
/* Configure the STMPE11 interrupt pin as an input */
|
||||||
|
|
||||||
(void)stm32_configgpio(GPIO_IO_EXPANDER);
|
(void)stm32_configgpio(GPIO_IO_EXPANDER);
|
||||||
|
|
||||||
@@ -287,15 +291,16 @@ int arch_tcinitialize(void)
|
|||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize and register the I2C touschscreen device */
|
/* Initialize and register the I2C touchscreen device */
|
||||||
|
|
||||||
ret = stmpe11_register(dev, CONFIG_STMPE11_DEVMINOR);
|
ret = stmpe11_register(g_stmpe11config.handle, CONFIG_STMPE11_DEVMINOR);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
idbg("Failed to register STMPE driver: %d\n", ret);
|
idbg("Failed to register STMPE driver: %d\n", ret);
|
||||||
/* up_i2cuninitialize(dev); */
|
/* up_i2cuninitialize(dev); */
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in New Issue
Block a user