Lpcxpresso-Lpc54618 and FT5x06 driver. Some improvements in configuration and the touchscreen driver improves the behavior some. Now I get the calibration screen and detect touches (but no un-touches).
This commit is contained in:
parent
ead23dca30
commit
d9997846b6
@ -201,6 +201,11 @@ Configurations
|
||||
pressure : 0
|
||||
etc.
|
||||
|
||||
NOTE that the touchscreen controlled must run in a polled mode! The
|
||||
FT5x06 interrupt GPIO is on P4.0 and, as far as I know, GPIO
|
||||
interrupts are not supported on P4. So polled mode only for this
|
||||
puppy.
|
||||
|
||||
nsh:
|
||||
|
||||
Configures the NuttShell (nsh) application located at examples/nsh.
|
||||
@ -314,24 +319,30 @@ Configurations
|
||||
nxwm:
|
||||
|
||||
This is a special configuration setup for the NxWM window manager
|
||||
UnitTest. The NxWM window manager can be found here:
|
||||
UnitTest. This builds on top of the features that were unit tested in
|
||||
by the fb configuration.
|
||||
|
||||
nuttx-code/NxWidgets/nxwm
|
||||
The NxWM window manager can be found here:
|
||||
|
||||
<nuttx-code>/NxWidgets/nxwm
|
||||
|
||||
The NxWM unit test can be found at:
|
||||
|
||||
nuttx-code/NxWidgets/UnitTests/nxwm
|
||||
<nuttx-code>/NxWidgets/UnitTests/nxwm
|
||||
|
||||
Documentation for installing the NxWM unit test can be found here:
|
||||
|
||||
nuttx-code/NxWidgets/UnitTests/README.txt
|
||||
<nuttx-code>/NxWidgets/UnitTests/README.txt
|
||||
|
||||
Where <nuttx-code> is whatever path you have select to install
|
||||
NuttX.
|
||||
|
||||
Here is the quick summary of the build steps (Assuming that all of
|
||||
the required packages are available in a directory ~/nuttx-code):
|
||||
the required packages are available in a directory ~/<nuttx-code>):
|
||||
|
||||
1. Install the nxwm configuration
|
||||
|
||||
$ cd ~/nuttx-code/nuttx
|
||||
$ cd ~/<nuttx-code>/nuttx
|
||||
$ tools/configure.sh [OPTIONS] lpcxpresso-lpc54628/nxwm
|
||||
|
||||
Use the -l option with the configure.sh script if you are using a
|
||||
@ -344,24 +355,24 @@ Configurations
|
||||
|
||||
3. Install the nxwm unit test
|
||||
|
||||
$ cd ~/nuttx-code/NxWidgets
|
||||
$ tools/install.sh ~/nuttx-code/apps nxwm
|
||||
$ cd ~/<nuttx-code>/NxWidgets
|
||||
$ tools/install.sh ~/<nuttx-code>/apps nxwm
|
||||
Creating symbolic link
|
||||
- To ~/nuttx-code/NxWidgets/UnitTests/nxwm
|
||||
- At ~/nuttx-code/apps/external
|
||||
- To ~/<nuttx-code>/NxWidgets/UnitTests/nxwm
|
||||
- At ~/<nuttx-code>/apps/external
|
||||
|
||||
4. Build the NxWidgets library
|
||||
|
||||
$ cd ~/nuttx-code/NxWidgets/libnxwidgets
|
||||
$ make TOPDIR=~/nuttx-code/nuttx
|
||||
$ cd ~/<nuttx-code>/NxWidgets/libnxwidgets
|
||||
$ make TOPDIR=~/<nuttx-code>/nuttx
|
||||
|
||||
5. Build the NxWM library
|
||||
|
||||
$ cd ~/nuttx-code/NxWidgets/nxwm
|
||||
$ make TOPDIR=~/nuttx-code/nuttx
|
||||
$ cd ~/<nuttx-code>/NxWidgets/nxwm
|
||||
$ make TOPDIR=~/<nuttx-code>/nuttx
|
||||
|
||||
6. Built NuttX with the installed unit test as the application
|
||||
|
||||
$ cd ~/nuttx-code/nuttx
|
||||
$ cd ~/<nuttx-code>/nuttx
|
||||
$ make
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
# 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
|
||||
@ -9,6 +10,7 @@ CONFIG_ARCH_CHIP_LPC54XX=y
|
||||
CONFIG_ARCH_STACKDUMP=y
|
||||
CONFIG_ARCH_STDARG_H=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_BOARD_INITIALIZE=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=18535
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_FAT_LCNAMES=y
|
||||
@ -20,7 +22,6 @@ CONFIG_FT5X06_SINGLEPOINT=y
|
||||
CONFIG_FT5X06_SWAPXY=y
|
||||
CONFIG_HAVE_CXX=y
|
||||
CONFIG_HAVE_CXXINITIALIZE=y
|
||||
CONFIG_I2CTOOL_MAXBUS=9
|
||||
CONFIG_INPUT_FT5X06=y
|
||||
CONFIG_INPUT=y
|
||||
CONFIG_LIB_BOARDCTL=y
|
||||
@ -43,6 +44,7 @@ CONFIG_LPC54_USART0=y
|
||||
CONFIG_MAX_TASKS=16
|
||||
CONFIG_MAX_WDOGPARMS=2
|
||||
CONFIG_MM_REGIONS=2
|
||||
CONFIG_MQ_MAXMSGSIZE=64
|
||||
CONFIG_NFILE_DESCRIPTORS=8
|
||||
CONFIG_NFILE_STREAMS=8
|
||||
CONFIG_NSH_BUILTIN_APPS=y
|
||||
@ -95,8 +97,6 @@ CONFIG_SDCLONE_DISABLE=y
|
||||
CONFIG_START_DAY=18
|
||||
CONFIG_START_MONTH=12
|
||||
CONFIG_SYMTAB_ORDEREDBYNAME=y
|
||||
CONFIG_SYSTEM_I2CTOOL=y
|
||||
CONFIG_SYSTEM_RAMTEST=y
|
||||
CONFIG_TASK_NAME_SIZE=0
|
||||
CONFIG_USART0_SERIAL_CONSOLE=y
|
||||
CONFIG_USER_ENTRYPOINT="nxwm_main"
|
||||
|
@ -275,7 +275,6 @@ static void ft5x06_data_worker(FAR void *arg)
|
||||
FAR struct ft5x06_touch_data_s *sample;
|
||||
struct i2c_msg_s msg[2];
|
||||
uint8_t regaddr;
|
||||
uint8_t ntouches;
|
||||
int ret;
|
||||
|
||||
/* Get a pointer the callbacks for convenience */
|
||||
@ -307,7 +306,7 @@ static void ft5x06_data_worker(FAR void *arg)
|
||||
|
||||
/* Set up the data read operation.
|
||||
*
|
||||
* REVISIT: If CONFIG_FT5X06_SINGLEPOINT is selected, we we not just
|
||||
* REVISIT: If CONFIG_FT5X06_SINGLEPOINT is selected, could we not just
|
||||
* set the length for one sample? Or is there some reason why we have to
|
||||
* read all of the points?
|
||||
*/
|
||||
@ -319,34 +318,43 @@ static void ft5x06_data_worker(FAR void *arg)
|
||||
msg[1].length = FT5x06_TOUCH_DATA_LEN;
|
||||
|
||||
ret = I2C_TRANSFER(priv->i2c, msg, 2);
|
||||
|
||||
sample = (FAR struct ft5x06_touch_data_s *)priv->touchbuf;
|
||||
ntouches = sample->tdstatus;
|
||||
|
||||
if (ret >= 0 && ntouches > 0)
|
||||
if (ret >= 0)
|
||||
{
|
||||
/* Notify any waiters that new FT5x06 data is available */
|
||||
/* In polled mode, we may read invalid touch data. If there is
|
||||
* no touch data, the FT5x06 returns all 0xff.
|
||||
*/
|
||||
|
||||
sample = (FAR struct ft5x06_touch_data_s *)priv->touchbuf;
|
||||
|
||||
/* Notify waiters (only if we ready some valid data) */
|
||||
|
||||
if (sample->tdstatus <= FT5x06_MAX_TOUCHES)
|
||||
{
|
||||
/* Notify any waiters that new FT5x06 data is available */
|
||||
|
||||
priv->valid = true;
|
||||
ft5x06_notify(priv);
|
||||
}
|
||||
|
||||
priv->valid = true;
|
||||
ft5x06_notify(priv);
|
||||
}
|
||||
#ifdef CONFIG_FT5X06_POLLMODE
|
||||
else
|
||||
{
|
||||
ntouches = 0;
|
||||
}
|
||||
|
||||
/* Update the poll rate */
|
||||
|
||||
if (ntouches > 0)
|
||||
{
|
||||
priv->delay = POLL_MINDELAY;
|
||||
}
|
||||
else if (priv->delay < POLL_MAXDELAY)
|
||||
{
|
||||
priv->delay += POLL_INCREMENT;
|
||||
/* Update the poll rate */
|
||||
|
||||
if (sample->tdstatus > 0 && sample->tdstatus <= FT5x06_MAX_TOUCHES)
|
||||
{
|
||||
/* Keep it at the minimum if touches are detected. */
|
||||
|
||||
priv->delay = POLL_MINDELAY;
|
||||
}
|
||||
else if (priv->delay < POLL_MAXDELAY)
|
||||
{
|
||||
/* Let it rise gradually to the maximum if there is no touch */
|
||||
|
||||
priv->delay += POLL_INCREMENT;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_FT5X06_POLLMODE
|
||||
/* Exit, re-starting the poll (unless there is no longer any task waiting
|
||||
* for touch data).
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user