nanogui: Setting up TouchScreen for AT91SAM9261-EK


Previous by date: 23 Jan 2007 16:16:18 +0000 Re: Compiling the libttf for arm, Gil Glass
Next by date: 23 Jan 2007 16:16:18 +0000 ViewML development, David T. L. Wong
Previous in thread: 23 Jan 2007 16:16:18 +0000 Setting up TouchScreen for AT91SAM9261-EK, Kelvin Xu
Next in thread: 23 Jan 2007 16:16:18 +0000 Re: Setting up TouchScreen for AT91SAM9261-EK, Uwe Klatt

Subject: RE: [nanogui] Setting up TouchScreen for AT91SAM9261-EK
From: "Kelvin Xu" ####@####.####
Date: 23 Jan 2007 16:16:18 +0000
Message-Id: <BAY117-F76A156C6B604F6E297222BFAD0@phx.gbl>

Hi,

I try searching through the forums but did find any answers.
I have tried using the ADSMOUSE but it returned the following error 
continously:
Wrong number of bytes 0 read from touch panel (expected 6)

I also tried using ADS7846MOUSE but it returned the following error for each 
tap on the screen:
Wrong number of bytes 8 read from touch panel (expected 16)

I tried adding a new driver to the config, following the instructions in 
moc_touchscreen.c
Below is the header file for my touchscreen driver:

/*
* drivers/input/touchscreen/at91_ads7843e_ts.h
*
* Definitions for ADS7843E touch screen.
* Copyright (C) 2005, M. Amine SAYA, ATMEL Rousset, France.
*
*/

#ifndef _AT91_ADS7843E_TS_H
#define _AT91_ADS7843E_TS_H


#define PWR_MODE_ACTIVE		0
#define PWR_MODE_SUSPEND	1
#define PEN_UP                      2
#define PEN_DOWN                    3

#define X_AXIS_MAX		3830
#define X_AXIS_MIN		150
#define Y_AXIS_MAX		3830
#define Y_AXIS_MIN		190
#define PRESSURE_MIN		0
#define PRESSURE_MAX		15000

/* ADS784X Touch Screen Controller Controll Byte bit definitions */
#define ADS_CTRL_PD0		(1 << 0)	/* PD0 */
#define ADS_CTRL_PD1		(1 << 1)	/* PD1 */
#define ADS_CTRL_DFR		(1 << 2)	/* SER/DFR */
#define ADS_CTRL_EIGHT_BITS_MOD	(1 << 3)	/* Mode */
#define ADS_CTRL_START		(1 << 7)	/* Start Bit */

#define ADS_CTRL_SWITCH_SHIFT	 4	        /* Address setting */


struct ts_event {
  short pressure;
  short x;
  short y;
};

struct ts_device {
  char phys[32];
  int irq;
  struct input_dev input;
  struct work_struct work;
  struct ts_event tc;
  int pendown;
  int power_mode;
};


// SPI transfer function
extern unsigned long at91_tsc_spi_sendrecv(unsigned char);
extern void at91sam9261_clear_irq(unsigned int);

#endif  /* _AT91_ADS7843E_TS_H*/

I tried commenting out, to go round the compilation error of not define 
input and work
   struct input_dev input;
   struct work_struct work;

The console reporting the following error continously when i touched on the 
screen
Wrong number of bytes 0 read from touch panel (expected 6).

Thank you for all help granted.

Regardsm
Kelvin


>From: "Kelvin Xu" ####@####.####
>To: ####@####.####
>Subject: [nanogui] Setting up TouchScreen for AT91SAM9261-EK
>Date: Fri, 19 Jan 2007 16:14:35 +0800
>
>Hi,
>
>I am running Nano-X on ATMEL AT91SAM9261-EK board.
>I am wondering how to set up the touchscreen my board. Below is the 
>initialisation of my Linux kernel on the board:
>
>mice: PS/2 mouse device common for all mice
>ts: Compaq touchscreen protocol output
>input: SAM926x Touchscreen as /class/input/input1
>ts ts.0: AT91SAM9261 Touch Screen Registered
>
>There is a /dev/ts0 entry in my RFS.
>
>I attempted to set up the Nano-X config with ADSMOUSE=Y. However, it report 
>the following error:
>mou_touchscreen.c:50:2: error: #error "You didn't define a device for the 
>generic touchscreen driver"
>
>Otherwise, the compilation completes. But i am unable to get any response 
>from the demos on the screen.
>
>Regards,
>Kelvin
>
>_________________________________________________________________
>Find singles online in your area with MSN Dating and Match.com! 
>http://cp.intl.match.com/eng/msn/msnsg/wbc/wbc.html
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: ####@####.####
>For additional commands, e-mail: ####@####.####
>

_________________________________________________________________
Find just what you are after with the more precise, more powerful new 
Windows Live Search. http://search.msn.com.sg/ Try it now.


Previous by date: 23 Jan 2007 16:16:18 +0000 Re: Compiling the libttf for arm, Gil Glass
Next by date: 23 Jan 2007 16:16:18 +0000 ViewML development, David T. L. Wong
Previous in thread: 23 Jan 2007 16:16:18 +0000 Setting up TouchScreen for AT91SAM9261-EK, Kelvin Xu
Next in thread: 23 Jan 2007 16:16:18 +0000 Re: Setting up TouchScreen for AT91SAM9261-EK, Uwe Klatt


Powered by ezmlm-browse 0.20.