- Timestamp:
- 12/08/07 01:15:56 (13 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/follower/wiz810mj/src/demo/WizDemo4/WizDemo4.pde
r89 r90 99 99 /* ------ WIZ810MJ ------ */ 100 100 101 class Wiz810M J{101 class Wiz810MjDevice { 102 102 103 103 public: 104 Wiz810M J(int resetPin);104 Wiz810MjDevice(int resetPin); 105 105 106 106 private: 107 void _init(void); 108 107 109 int _resetPin; 108 110 }; 109 111 110 Wiz810MJ::Wiz810MJ(int resetPin) { 112 113 Wiz810MjDevice::Wiz810MjDevice(int resetPin) { 111 114 // TODO: We should really allow the chip-select pin to be set here? 112 115 // Or require that it's defined. (Currently in the library file 'types.h'.) 113 116 _resetPin = resetPin; 114 } 115 116 /* ----------------------- */ 117 118 119 // #define PIN_RESET 9 // WIZnet module /RESET 120 121 #define PIN_RESET 8 // WIZnet module /RESET 122 123 SOCKET testSocket; 124 byte ip[6]; 125 126 127 void initModule() { 117 118 _init(); 119 } 120 121 122 void Wiz810MjDevice::_init(void) { 128 123 /* 129 124 … … 139 134 seems not to be the case.) 140 135 */ 141 pinMode( PIN_RESET, OUTPUT);136 pinMode(_resetPin, OUTPUT); 142 137 143 138 // We rely on the time between function calls to 144 139 // be long enough for the chip to recognise the 145 140 // reset. 146 digitalWrite( PIN_RESET, HIGH);147 digitalWrite( PIN_RESET, LOW); // reset148 digitalWrite( PIN_RESET, HIGH);141 digitalWrite(_resetPin, HIGH); 142 digitalWrite(_resetPin, LOW); // reset 143 digitalWrite(_resetPin, HIGH); 149 144 150 145 // Chip initialisation by driver … … 157 152 // internally by the driver--even if the default chip 158 153 // configuration is used.) 159 sysinit(0x55, 0x55); 160 161 } 154 sysinit(0x55, 0x55); 155 } 156 157 /* ----------------------- */ 158 159 160 // #define PIN_RESET 9 // WIZnet module /RESET 161 162 #define PIN_RESET 8 // WIZnet module /RESET 163 164 SOCKET testSocket; 165 byte ip[6]; 166 162 167 163 168 #define PIN_LED 2 … … 169 174 SPI.begin(); 170 175 171 initModule();176 Wiz810MjDevice WIZ810MJ = Wiz810MjDevice(PIN_RESET); 172 177 173 178 Serial.println("Test W5100 configuration...");