Index: rts/beagleboneblack/ads7846.c
===================================================================
--- ports/beagleboneblack/ads7846.c	(revision 470b252f311437c7f25d773f74e493c3957ebd44)
+++ 	(revision )
@@ -1,180 +1,0 @@
-//==========================================================================
-//
-//      ads7846.c
-//
-// Author(s):   Michael Kelly - Cogent Computer Systems, Inc.
-// Date:        03/06/03
-// Description:	ADS7846 Interface routines for CSB740
-//				Modified from MC9328mxl version to use SPI1 
-//
-//==========================================================================
-
-#include "config.h"
-#include "cpuio.h"
-#include "genlib.h"
-#include "stddefs.h"
-#include "omap3530.h"
-#include "cpu_gpio.h"
-#include "ads7846.h"
-#include "cli.h"
-#include "umongpio.h"
-
-//--------------------------------------------------------------------------
-// function prototypes
-//
-int ads_init(void);
-int ads_rd(uchar ads_ctl);
-
-extern void udelay(int delay);
-
-//--------------------------------------------------------------------------
-// ads_init()
-//
-// This routine sets up the OMAP3530 SPI3 port in Microwire mode
-// (8 bit control, 16 bit data, 24 bit total).  It also turns on
-// the ADS7843 pen interrupt via a dummy read.  Note that we assume
-// that PERCLK2 is 12Mhz (HCLK/4). We are using CS0 on SPI3.  
-//
-int ads_init()
-{
-	volatile uchar temp;
-
-
-	SPI3_REG(SPI_CH0_CTRL) = 0x00;				// Disable SPI3 Channel 0
-
-	SPI3_REG(SPI_CH0_CONF) = SPI_CH_CONF_CLKG
-					   | SPI_CH_CONF_DPE0	// no transmission on SPI3_MISO
-					   | SPI_CH_CONF_WL(7)	 	// 8-bit data mode
-					   | SPI_CH_CONF_EPOL	  	// CS is active low
-//					   | SPI_CH_CONF_SB_POL	  	// 
-//					   | SPI_CH_CONF_SBE	  	// 
-					   | SPI_CH_CONF_CLKD(9);	// divide by 512 = 93Khz
-//					   | SPI_CH_CONF_PHA;		// Data is latched on even numbered edges
-//					   | SPI_CH_CONF_POL;	  	// SPI clock is active low
-
-	SPI3_REG(SPI_MODULCTRL) = 0x0;				// Functional mode, Master, and auto CS generation
-
-	SPI3_REG(SPI_CH0_CTRL) = 0x01;				// Enable SPI3 Channel 0
-
-	// enable the ADS7846 so it can generate a touch interrupt.
-	// this consists of reading any channel, but setting the
-	// power down mode in the control byte to 00b.  note we
-	// flush the returned data
-	//ads_rd(ADS7846E_S | ADS7846E_PD_ADC | ADS7846E_ADD_DFR_X);
-	ads_rd(ADS7846E_S | ADS7846E_PD_ADC | ADS7846E_8BIT | ADS7846E_ADD_DFR_Y);
-//	ads_rd(ADS7846E_S | ADS7846E_PD_ADC | ADS7846E_ADD_DFR_Y);
-	temp = SPI3_REG(SPI_RXD0);
-
-	return 0;
-}
-
-//--------------------------------------------------------------------------
-int ads_rd(uchar ads_ctl)
-{
-	int timeout = 100;
-	volatile uchar temp0, temp1;
-
-	// the OMAP3530 only handles up to 16-bits per transfer
-	// so we send 8-bits at a time to get our total of 24
-
-//	SPI3_REG(SPI_TXD0) = ads_ctl;
-//	udelay(10);
-//	while (!(SPI3_REG(SPI_IRQSTATUS) & SPI_TX0_EMPTY));
-//	while (!(SPI3_REG(SPI_IRQSTATUS) & SPI_RX0_FULL));
-//	temp0 = SPI3_REG(SPI_RXD0);
-//
-//	SPI3_REG(SPI_TXD0) = 0;
-//	udelay(10);
-//	while (!(SPI3_REG(SPI_IRQSTATUS) & SPI_TX0_EMPTY));
-//	while (!(SPI3_REG(SPI_IRQSTATUS) & SPI_RX0_FULL));
-//	temp0 = SPI3_REG(SPI_RXD0);
-//
-//	SPI3_REG(SPI_TXD0) = 0;
-//	udelay(10);
-//	while (!(SPI3_REG(SPI_IRQSTATUS) & SPI_TX0_EMPTY));
-//	while (!(SPI3_REG(SPI_IRQSTATUS) & SPI_RX0_FULL));
-//	temp1 = SPI3_REG(SPI_RXD0);
-
-	SPI3_REG(SPI_TXD0) = ads_ctl;
-	udelay(10);
-	while (!(SPI3_REG(SPI_CH0_STAT) & SPI_CH_TX0_EMPTY));
-	while (!(SPI3_REG(SPI_CH0_STAT) & SPI_CH_RX0_FULL));
-	temp0 = SPI3_REG(SPI_RXD0);
-
-	SPI3_REG(SPI_TXD0) = 0;
-	udelay(10);
-	while (!(SPI3_REG(SPI_CH0_STAT) & SPI_CH_TX0_EMPTY));
-	while (!(SPI3_REG(SPI_CH0_STAT) & SPI_CH_RX0_FULL));
-	temp0 = SPI3_REG(SPI_RXD0);
-
-//	SPI3_REG(SPI_TXD0) = 0;
-//	udelay(10);
-//	while (!(SPI3_REG(SPI_CH0_STAT) & SPI_CH_TX0_EMPTY));
-//	while (!(SPI3_REG(SPI_CH0_STAT) & SPI_CH_RX0_FULL));
-//	temp1 = SPI3_REG(SPI_RXD0);
-	temp1 = 0;
-	return ((temp0 << 8) | temp1);
-}
-
-//--------------------------------------------------------------------------
-char *adsHelp[] = {
-	"Screen touch demo using ADS7846 and OMAP3530 SPI port.",
-	"",
-	0
-};
-
-int ads(int argc, char *argv[])
-{
-	uchar c;
-	int pen, i;
-	int average_x, average_y;
-
-	// init the SPI and ADS7846
-	if (ads_init() == -1)
-	{
-		printf("Error intializing ADS7846!\n");
-		return (CMD_FAILURE);
-	}
-
-	printf("Waiting for Touch (Press \'X\' to end test)...\n");
-
-	pen = 0;
-	while (1)
-	{
-		if (gotachar())
-		{
-			c = getchar();
-			if ((c == 'X') || (c == 'x')) goto done;
-		}
-		if (GPIO_tst(PIRQ) == 0)
-		{
-			printf("Pen Down....\n");
-			pen = 1;
-			while(GPIO_tst(PIRQ) == 0) // keep reading until touch goes away
-			{
-				average_x = 0;
-				average_y = 0;
-
-				// display every 256 samples (less if pen is down a short time)
-				for (i = 0; i < 256 ; i++)
-				{
-//					average_x += ads_rd(ADS7846E_S | ADS7846E_PD_ADC | ADS7846E_ADD_DFR_X);
-//					average_y += ads_rd(ADS7846E_S | ADS7846E_PD_ADC | ADS7846E_ADD_DFR_Y);
-					average_x += ads_rd(ADS7846E_S | ADS7846E_PD_ADC | ADS7846E_8BIT | ADS7846E_ADD_DFR_X);
-					average_y += ads_rd(ADS7846E_S | ADS7846E_PD_ADC | ADS7846E_8BIT | ADS7846E_ADD_DFR_Y);
-				}
-				printf("X = %04d, Y = %04d\n", average_x/i, average_y/i);
-
-			} // while pen is down
-		}
-		if (pen)
-		{
-			printf("Pen Up....\n");
-			pen = 0;
-		}
-
-	}
-
-done:		
-	return(CMD_SUCCESS);
-}
Index: rts/beagleboneblack/ads7846.h
===================================================================
--- ports/beagleboneblack/ads7846.h	(revision 470b252f311437c7f25d773f74e493c3957ebd44)
+++ 	(revision )
@@ -1,56 +1,0 @@
-//==========================================================================
-//
-// ads7846.h
-//
-// Author(s):    Michael Kelly, Cogent Computer Systems, Inc.
-// Contributors: 
-// Date:         03/06/03
-// Description:  This file contains register offsets and bit defines
-//				 for the TI ADS7846 Touch Screen Controller
-//
-
-//
-// Bit positions for ADS7846E Control byte
-//
-#define ADS7846E_S				0x80	    // Start bit, always 1
-#define ADS7846E_8BIT			0x08	    // 0 = 12-bit conversion, 1 = 8-bits
-#define ADS7846E_SER			0x04	    // 0 = Differential, 1 = Single ended
-
-//
-// Address select defines for single ended mode (or'ed with the single ended select bit)
-//
-// USE FOR ADS7846
-//#define ADS7846E_ADD_SER_TEMP0	(ADS7846E_SER | (0x0 << 4))	// temperature measurement 1
-//#define ADS7846E_ADD_SER_Y		(ADS7846E_SER | (0x1 << 4))	// Y position measurement
-//#define ADS7846E_ADD_SER_BAT	(ADS7846E_SER | (0x2 << 4))	// battery input measurement
-//#define ADS7846E_ADD_SER_Z1		(ADS7846E_SER | (0x3 << 4))	// pressure measurement 1
-//#define ADS7846E_ADD_SER_Z2		(ADS7846E_SER | (0x4 << 4))	// pressure measurement 2
-//#define ADS7846E_ADD_SER_X		(ADS7846E_SER | (0x5 << 4))	// X position measurement
-//#define ADS7846E_ADD_SER_AUX	(ADS7846E_SER | (0x6 << 4))	// auxillary input measurement
-//#define ADS7846E_ADD_SER_TEMP1	(ADS7846E_SER | (0x7 << 4))	// temperature measurement 2
-
-// USE FOR ADS7843
-//#define ADS7846E_ADD_SER_TEMP0	(ADS7846E_SER | (0x0 << 4))	// temperature measurement 1
-#define ADS7846E_ADD_SER_Y		(ADS7846E_SER | (0x1 << 4))	// Y position measurement
-//#define ADS7846E_ADD_SER_BAT	(ADS7846E_SER | (0x2 << 4))	// battery input measurement
-//#define ADS7846E_ADD_SER_Z1		(ADS7846E_SER | (0x2 << 4))	// pressure measurement 1
-//#define ADS7846E_ADD_SER_Z2		(ADS7846E_SER | (0x6 << 4))	// pressure measurement 2
-#define ADS7846E_ADD_SER_X		(ADS7846E_SER | (0x5 << 4))	// X position measurement
-//#define ADS7846E_ADD_SER_AUX	(ADS7846E_SER | (0x6 << 4))	// auxillary input measurement
-//#define ADS7846E_ADD_SER_TEMP1	(ADS7846E_SER | (0x7 << 4))	// temperature measurement 2
-
-//
-// Address select defines for differential mode
-//
-#define ADS7846E_ADD_DFR_X		(0x1 << 4)	// Y position measurement
-//#define ADS7846E_ADD_DFR_Z1		(0x2 << 4)	// pressure measurement 1
-//#define ADS7846E_ADD_DFR_Z2		(0x6 << 4)	// pressure measurement 2
-#define ADS7846E_ADD_DFR_Y		(0x5 << 4)	// X position measurement
-
-//
-// Power Down Modes
-//
-#define ADS7846E_PD_LPWR		0x0			// low-power mode, no power-up delay, *IRQ is enabled
-#define ADS7846E_PD_REF			0x1			// 2.5V reference off, ADC on, requires delay before conversion
-#define ADS7846E_PD_ADC			0x2			// ADC off, REF on, no delay required
-#define ADS7846E_PD_IRQ			0x3			// device on, but *IRQ is disabled
