From b2c869d1f414dc5db6604e675b1c56cdd19065ba Mon Sep 17 00:00:00 2001 From: follower Date: Mon, 5 Nov 2007 11:16:40 +0000 Subject: [PATCH] Remove initial pre-driver-port code that configured the module via SPI with a network configuration to enable a ping test. Includes code to communicate via SPI and to read address/register/memory locations. Remove associated code credit for spi_transfer from playground. All these functions are now implemented within the driver itself. TODO: Could we implement the driver SPI comms in a more efficient manner? git-svn-id: svn+ssh://oldsvn/home/mlalondesvn/svn/cral@59 3ee9b42a-b53c-0410-a25e-f0b6218d5d5b --- .../wiz810mj/src/demo/WizDemo1/WizDemo1.pde | 82 ------------------- 1 file changed, 82 deletions(-) diff --git a/branches/follower/wiz810mj/src/demo/WizDemo1/WizDemo1.pde b/branches/follower/wiz810mj/src/demo/WizDemo1/WizDemo1.pde index 900666e..b7f9e46 100644 --- a/branches/follower/wiz810mj/src/demo/WizDemo1/WizDemo1.pde +++ b/branches/follower/wiz810mj/src/demo/WizDemo1/WizDemo1.pde @@ -34,8 +34,6 @@ LGPL - (Although note spi_transfer comes from the Playground originally.) - Version: 20071106-0005 @@ -112,41 +110,6 @@ void setup () { //delay(10); Serial.println("Reset triggered..."); - /* - Serial.println("Configure device..."); - - // default gateway - writeAddressValue(0x00, 0x01, 0xC0); - writeAddressValue(0x00, 0x02, 0xA8); - writeAddressValue(0x00, 0x03, 0x02); - writeAddressValue(0x00, 0x04, 0x65); - - // subnet mask - writeAddressValue(0x00, 0x05, 0xFF); - writeAddressValue(0x00, 0x06, 0xFF); - writeAddressValue(0x00, 0x07, 0xFF); - writeAddressValue(0x00, 0x08, 0x00); - - // source hardware address (MAC?) - writeAddressValue(0x00, 0x09, 0x00); - writeAddressValue(0x00, 0x0A, 0xDE); - writeAddressValue(0x00, 0x0B, 0xAD); - writeAddressValue(0x00, 0x0C, 0xBE); - writeAddressValue(0x00, 0x0D, 0xEF); - writeAddressValue(0x00, 0x0E, 0x00); - - // source ip address - - writeAddressValue(0x00, 0x0F, 0xC0); - writeAddressValue(0x00, 0x10, 0xA8); - writeAddressValue(0x00, 0x11, 0x02); - writeAddressValue(0x00, 0x12, 0x69); - - - // Serial.println("SKIP: source ip address"); - - Serial.println("End configure device..."); - */ // driver chip init (Might be redundant with the above reset.) Serial.println("Call iinchip_init..."); @@ -185,51 +148,6 @@ void setup () { } -byte readAddressValue(byte addressHiByte, byte addressLowByte) { - // TODO: use a word for the address instead - - byte data = 0x00; - - digitalWrite(PIN_SLAVE_SELECT, LOW); // Enable slave - - // TODO: Check response values? e.g. 0x00, 0x01, 0x02 - spi_transfer(WIZNET_OPCODE_READ); - spi_transfer(addressHiByte); - spi_transfer(addressLowByte); - - data = spi_transfer(DUMMY_DATA); - - digitalWrite(PIN_SLAVE_SELECT, HIGH); // Disable slave - - return data; -} - - -void writeAddressValue(byte addressHiByte, byte addressLowByte, byte targetValue) { - // TODO: use a word for the address instead - - digitalWrite(PIN_SLAVE_SELECT, LOW); // Enable slave - - // TODO: Check response values? e.g. 0x00, 0x01, 0x02 - spi_transfer(WIZNET_OPCODE_WRITE); - spi_transfer(addressHiByte); - spi_transfer(addressLowByte); - - spi_transfer(targetValue); - - digitalWrite(PIN_SLAVE_SELECT, HIGH); // Disable slave -} - -// From Playground -char spi_transfer(volatile char data) -{ - SPDR = data; // Start the transmission - while (!(SPSR & (1<