|
|
@ -95,25 +95,31 @@ void initModule() {
|
|
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
// I thought this wasn't needed but seems like it is.
|
|
|
|
/*
|
|
|
|
Serial.println("Triggering reset...");
|
|
|
|
Initialise the W5100 chip
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(Originally I thought it was possible for the chip
|
|
|
|
|
|
|
|
to function without a hardware reset but it
|
|
|
|
|
|
|
|
seems not to be the case.)
|
|
|
|
|
|
|
|
*/
|
|
|
|
pinMode(PIN_RESET, OUTPUT);
|
|
|
|
pinMode(PIN_RESET, OUTPUT);
|
|
|
|
|
|
|
|
|
|
|
|
digitalWrite(PIN_RESET, HIGH); // no reset
|
|
|
|
// We rely on the time between function calls to
|
|
|
|
//delay(10); // Pretty arbitrary length -- do we need it?
|
|
|
|
// be long enough for the chip to recognise the
|
|
|
|
|
|
|
|
// reset.
|
|
|
|
|
|
|
|
digitalWrite(PIN_RESET, HIGH);
|
|
|
|
digitalWrite(PIN_RESET, LOW); // reset
|
|
|
|
digitalWrite(PIN_RESET, LOW); // reset
|
|
|
|
//delay(10);
|
|
|
|
digitalWrite(PIN_RESET, HIGH);
|
|
|
|
digitalWrite(PIN_RESET, HIGH); // no reset
|
|
|
|
|
|
|
|
//delay(10);
|
|
|
|
|
|
|
|
Serial.println("Reset triggered...");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Chip initialisation by driver
|
|
|
|
// driver chip init (Might be redundant with the above reset.)
|
|
|
|
// Might be redundant following the above reset,
|
|
|
|
Serial.println("Call iinchip_init...");
|
|
|
|
// as this performs a software reset.
|
|
|
|
iinchip_init();
|
|
|
|
iinchip_init();
|
|
|
|
|
|
|
|
|
|
|
|
// driver sysinit
|
|
|
|
// Initialise driver
|
|
|
|
Serial.println("Call sysinit...");
|
|
|
|
// (This is required to configure some variables used
|
|
|
|
|
|
|
|
// internally by the driver--even if the default chip
|
|
|
|
|
|
|
|
// configuration is used.)
|
|
|
|
sysinit(0x55, 0x55);
|
|
|
|
sysinit(0x55, 0x55);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|