w6100_driver.c
Go to the documentation of this file.
1 /**
2  * @file w6100_driver.c
3  * @brief WIZnet W6100 Ethernet controller
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneTCP Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.4.4
29  **/
30 
31 //Switch to the appropriate trace level
32 #define TRACE_LEVEL NIC_TRACE_LEVEL
33 
34 //Dependencies
35 #include "core/net.h"
37 #include "debug.h"
38 
39 
40 /**
41  * @brief W6100 driver
42  **/
43 
45 {
47  ETH_MTU,
48  w6100Init,
49  w6100Tick,
55  NULL,
56  NULL,
57  NULL,
58  TRUE,
59  TRUE,
60  TRUE,
61  TRUE
62 };
63 
64 
65 /**
66  * @brief W6100 controller initialization
67  * @param[in] interface Underlying network interface
68  * @return Error code
69  **/
70 
72 {
73  uint_t i;
74  uint8_t value;
75 
76  //Debug message
77  TRACE_INFO("Initializing W6100 Ethernet controller...\r\n");
78 
79  //Initialize SPI interface
80  interface->spiDriver->init();
81 
82  //Initialize external interrupt line driver
83  if(interface->extIntDriver != NULL)
84  {
85  interface->extIntDriver->init();
86  }
87 
88  //Wait for the SPI interface to be ready
89  do
90  {
91  //Read chip identification register
93 
94  //Check chip identifier
95  } while(value != W6100_CIDR0_DEFAULT);
96 
97  //Unlock access to chip configuration registers
100 
101  //Perform software reset
103  //Wait for reset completion
104  sleep(10);
105 
106  //Unlock access to network configuration registers
109 
110  //Set the MAC address of the station
112  interface->macAddr.b[0]);
114  interface->macAddr.b[1]);
116  interface->macAddr.b[2]);
118  interface->macAddr.b[3]);
120  interface->macAddr.b[4]);
122  interface->macAddr.b[5]);
123 
124  //Set TX and RX buffer size for socket 0
129 
130  //Sockets 1 to 7 are not used
131  for(i = 1; i <= 7; i++)
132  {
135 
138  }
139 
140  //Configure socket 0 in MACRAW mode
143 
144  //Open socket 0
147 
148  //Wait for command completion
149  do
150  {
151  //Read status register
153 
154  //Check the status of the socket
155  } while(value != W6100_Sn_SR_SOCK_MACRAW);
156 
157  //Configure socket 0 interrupts
160 
161  //Enable socket 0 interrupts
164 
165  //Disable unused interrupts
167 
168  //Enable interrupt pin
171 
172  //Perform custom configuration
173  w6100InitHook(interface);
174 
175  //Dump registers for debugging purpose
176  w6100DumpReg(interface);
177 
178  //Accept any packets from the upper layer
179  osSetEvent(&interface->nicTxEvent);
180 
181  //Force the TCP/IP stack to poll the link state at startup
182  interface->nicEvent = TRUE;
183  //Notify the TCP/IP stack of the event
185 
186  //Successful initialization
187  return NO_ERROR;
188 }
189 
190 
191 /**
192  * @brief W6100 custom configuration
193  * @param[in] interface Underlying network interface
194  **/
195 
196 __weak_func void w6100InitHook(NetInterface *interface)
197 {
198 }
199 
200 
201 /**
202  * @brief W6100 timer handler
203  * @param[in] interface Underlying network interface
204  **/
205 
206 void w6100Tick(NetInterface *interface)
207 {
208  uint8_t value;
209  bool_t linkState;
210 
211  //Read PHY status register
213  //Retrieve current link state
214  linkState = (value & W6100_PHYSR_LNK) ? TRUE : FALSE;
215 
216  //Check link state
217  if(linkState && !interface->linkState)
218  {
219  //Get current speed
220  if((value & W6100_PHYSR_SPD) != 0)
221  {
222  interface->linkSpeed = NIC_LINK_SPEED_10MBPS;
223  }
224  else
225  {
226  interface->linkSpeed = NIC_LINK_SPEED_100MBPS;
227  }
228 
229  //Determine the new duplex mode
230  if((value & W6100_PHYSR_DPX) != 0)
231  {
232  interface->duplexMode = NIC_HALF_DUPLEX_MODE;
233  }
234  else
235  {
236  interface->duplexMode = NIC_FULL_DUPLEX_MODE;
237  }
238 
239  //Link is up
240  interface->linkState = TRUE;
241  //Process link state change event
242  nicNotifyLinkChange(interface);
243  }
244  else if(!linkState && interface->linkState)
245  {
246  //Link is down
247  interface->linkState = FALSE;
248  //Process link state change event
249  nicNotifyLinkChange(interface);
250  }
251  else
252  {
253  //No link change detected
254  }
255 }
256 
257 
258 /**
259  * @brief Enable interrupts
260  * @param[in] interface Underlying network interface
261  **/
262 
263 void w6100EnableIrq(NetInterface *interface)
264 {
265  //Enable interrupts
266  if(interface->extIntDriver != NULL)
267  {
268  interface->extIntDriver->enableIrq();
269  }
270 }
271 
272 
273 /**
274  * @brief Disable interrupts
275  * @param[in] interface Underlying network interface
276  **/
277 
279 {
280  //Disable interrupts
281  if(interface->extIntDriver != NULL)
282  {
283  interface->extIntDriver->disableIrq();
284  }
285 }
286 
287 
288 /**
289  * @brief W6100 interrupt service routine
290  * @param[in] interface Underlying network interface
291  * @return TRUE if a higher priority task must be woken. Else FALSE is returned
292  **/
293 
295 {
296  bool_t flag;
297  uint16_t n;
298  uint8_t isr;
299 
300  //This flag will be set if a higher priority task must be woken
301  flag = FALSE;
302 
303  //Read socket interrupt register
305  //Disable interrupts to release the interrupt line
307 
308  //Socket 0 interrupt?
309  if((isr & W6100_SIR_S0_INT) != 0)
310  {
311  //Read socket 0 interrupt register
313 
314  //Packet transmission complete?
315  if((isr & W6100_Sn_IR_SENDOK) != 0)
316  {
317  //Get the amount of free memory available in the TX buffer
319 
320  //Check whether the TX buffer is available for writing
321  if(n >= ETH_MAX_FRAME_SIZE)
322  {
323  //The transmitter can accept another packet
324  osSetEvent(&interface->nicTxEvent);
325  }
326  }
327 
328  //Packet received?
329  if((isr & W6100_Sn_IR_RECV) != 0)
330  {
331  //Set event flag
332  interface->nicEvent = TRUE;
333  //Notify the TCP/IP stack of the event
334  flag |= osSetEventFromIsr(&netEvent);
335  }
336 
337  //Clear interrupt flags
340  }
341 
342  //Re-enable interrupts once the interrupt has been serviced
345 
346  //A higher priority task must be woken?
347  return flag;
348 }
349 
350 
351 /**
352  * @brief W6100 event handler
353  * @param[in] interface Underlying network interface
354  **/
355 
357 {
358  error_t error;
359 
360  //Process all pending packets
361  do
362  {
363  //Read incoming packet
364  error = w6100ReceivePacket(interface);
365 
366  //No more data in the receive buffer?
367  } while(error != ERROR_BUFFER_EMPTY);
368 }
369 
370 
371 /**
372  * @brief Send a packet
373  * @param[in] interface Underlying network interface
374  * @param[in] buffer Multi-part buffer containing the data to send
375  * @param[in] offset Offset to the first data byte
376  * @param[in] ancillary Additional options passed to the stack along with
377  * the packet
378  * @return Error code
379  **/
380 
382  const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
383 {
384  static uint8_t temp[W6100_ETH_TX_BUFFER_SIZE];
385  uint16_t n;
386  uint16_t p;
387  size_t length;
388 
389  //Retrieve the length of the packet
390  length = netBufferGetLength(buffer) - offset;
391 
392  //Check the frame length
394  {
395  //The transmitter can accept another packet
396  osSetEvent(&interface->nicTxEvent);
397  //Report an error
398  return ERROR_INVALID_LENGTH;
399  }
400 
401  //Get the amount of free memory available in the TX buffer
403 
404  //Make sure the TX buffer is available for writing
405  if(n < length)
406  return ERROR_FAILURE;
407 
408  //Copy user data
409  netBufferRead(temp, buffer, offset, length);
410 
411  //Get TX write pointer
413 
414  //Write TX buffer
416 
417  //Increment TX write pointer
419  p + length);
420 
421  //Start packet transmission
424 
425  //Get the amount of free memory available in the TX buffer
427 
428  //Check whether the TX buffer is available for writing
429  if(n >= ETH_MAX_FRAME_SIZE)
430  {
431  //The transmitter can accept another packet
432  osSetEvent(&interface->nicTxEvent);
433  }
434 
435  //Successful processing
436  return NO_ERROR;
437 }
438 
439 
440 /**
441  * @brief Receive a packet
442  * @param[in] interface Underlying network interface
443  * @return Error code
444  **/
445 
447 {
448  static uint8_t temp[W6100_ETH_RX_BUFFER_SIZE];
449  error_t error;
450  uint16_t p;
451  size_t length;
452 
453  //Get the amount of data in the RX buffer
455 
456  //Any packet pending in the receive buffer?
457  if(length > 0)
458  {
459  //Get RX read pointer
461 
462  //Read packet header
463  w6100ReadBuffer(interface, W6100_CTRL_BSB_S0_RX_BUFFER, p, temp, 2);
464 
465  //Retrieve the length of the received packet
466  length = LOAD16BE(temp);
467 
468  //Ensure the packet size is acceptable
469  if(length >= 2 && length <= (ETH_MAX_FRAME_SIZE + 2))
470  {
471  //Calculate the length of the packet data
472  length -= 2;
473 
474  //Read packet data
475  w6100ReadBuffer(interface, W6100_CTRL_BSB_S0_RX_BUFFER, p + 2, temp,
476  length);
477 
478  //Increment RX read pointer
480  p + length + 2);
481 
482  //Complete the processing of the receive data
485 
486  //Successful processing
487  error = NO_ERROR;
488  }
489  else
490  {
491  //The packet length is not valid
492  error = ERROR_INVALID_LENGTH;
493  }
494  }
495  else
496  {
497  //No more data in the receive buffer
498  error = ERROR_BUFFER_EMPTY;
499  }
500 
501  //Check whether a valid packet has been received
502  if(!error)
503  {
504  NetRxAncillary ancillary;
505 
506  //Additional options can be passed to the stack along with the packet
507  ancillary = NET_DEFAULT_RX_ANCILLARY;
508 
509  //Pass the packet to the upper layer
510  nicProcessPacket(interface, temp, length, &ancillary);
511  }
512 
513  //Return status code
514  return error;
515 }
516 
517 
518 /**
519  * @brief Configure MAC address filtering
520  * @param[in] interface Underlying network interface
521  * @return Error code
522  **/
523 
525 {
526  //Not implemented
527  return NO_ERROR;
528 }
529 
530 
531 /**
532  * @brief Write 8-bit register
533  * @param[in] interface Underlying network interface
534  * @param[in] control Control byte
535  * @param[in] address Register address
536  * @param[in] data Register value
537  **/
538 
539 void w6100WriteReg8(NetInterface *interface, uint8_t control,
540  uint16_t address, uint8_t data)
541 {
542  //Pull the CS pin low
543  interface->spiDriver->assertCs();
544 
545  //Address phase
546  interface->spiDriver->transfer(MSB(address));
547  interface->spiDriver->transfer(LSB(address));
548 
549  //Control phase
550  interface->spiDriver->transfer(control | W6100_CTRL_RWB_WRITE |
552 
553  //Data phase
554  interface->spiDriver->transfer(data);
555 
556  //Terminate the operation by raising the CS pin
557  interface->spiDriver->deassertCs();
558 }
559 
560 
561 /**
562  * @brief Read 8-bit register
563  * @param[in] interface Underlying network interface
564  * @param[in] control Control byte
565  * @param[in] address Register address
566  * @return Register value
567  **/
568 
569 uint8_t w6100ReadReg8(NetInterface *interface, uint8_t control,
570  uint16_t address)
571 {
572  uint8_t data;
573 
574  //Pull the CS pin low
575  interface->spiDriver->assertCs();
576 
577  //Address phase
578  interface->spiDriver->transfer(MSB(address));
579  interface->spiDriver->transfer(LSB(address));
580 
581  //Control phase
582  interface->spiDriver->transfer(control | W6100_CTRL_RWB_READ |
584 
585  //Data phase
586  data = interface->spiDriver->transfer(0x00);
587 
588  //Terminate the operation by raising the CS pin
589  interface->spiDriver->deassertCs();
590 
591  //Return register value
592  return data;
593 }
594 
595 
596 /**
597  * @brief Write 16-bit register
598  * @param[in] interface Underlying network interface
599  * @param[in] control Control byte
600  * @param[in] address Register address
601  * @param[in] data Register value
602  **/
603 
604 void w6100WriteReg16(NetInterface *interface, uint8_t control,
605  uint16_t address, uint16_t data)
606 {
607  //Pull the CS pin low
608  interface->spiDriver->assertCs();
609 
610  //Address phase
611  interface->spiDriver->transfer(MSB(address));
612  interface->spiDriver->transfer(LSB(address));
613 
614  //Control phase
615  interface->spiDriver->transfer(control | W6100_CTRL_RWB_WRITE |
617 
618  //Data phase
619  interface->spiDriver->transfer(MSB(data));
620  interface->spiDriver->transfer(LSB(data));
621 
622  //Terminate the operation by raising the CS pin
623  interface->spiDriver->deassertCs();
624 }
625 
626 
627 /**
628  * @brief Read 16-bit register
629  * @param[in] interface Underlying network interface
630  * @param[in] control Control byte
631  * @param[in] address Register address
632  * @return Register value
633  **/
634 
635 uint16_t w6100ReadReg16(NetInterface *interface, uint8_t control,
636  uint16_t address)
637 {
638  uint16_t data;
639 
640  //Pull the CS pin low
641  interface->spiDriver->assertCs();
642 
643  //Address phase
644  interface->spiDriver->transfer(MSB(address));
645  interface->spiDriver->transfer(LSB(address));
646 
647  //Control phase
648  interface->spiDriver->transfer(control | W6100_CTRL_RWB_READ |
650 
651  //Data phase
652  data = interface->spiDriver->transfer(0x00) << 8;
653  data |= interface->spiDriver->transfer(0x00);
654 
655  //Terminate the operation by raising the CS pin
656  interface->spiDriver->deassertCs();
657 
658  //Return register value
659  return data;
660 }
661 
662 
663 /**
664  * @brief Write TX buffer
665  * @param[in] interface Underlying network interface
666  * @param[in] control Control byte
667  * @param[in] address Buffer address
668  * @param[in] data Pointer to the data being written
669  * @param[in] length Number of data to write
670  **/
671 
672 void w6100WriteBuffer(NetInterface *interface, uint8_t control,
673  uint16_t address, const uint8_t *data, size_t length)
674 {
675  size_t i;
676 
677  //Pull the CS pin low
678  interface->spiDriver->assertCs();
679 
680  //Address phase
681  interface->spiDriver->transfer(MSB(address));
682  interface->spiDriver->transfer(LSB(address));
683 
684  //Control phase
685  interface->spiDriver->transfer(control | W6100_CTRL_RWB_WRITE |
687 
688  //Data phase
689  for(i = 0; i < length; i++)
690  {
691  interface->spiDriver->transfer(data[i]);
692  }
693 
694  //Terminate the operation by raising the CS pin
695  interface->spiDriver->deassertCs();
696 }
697 
698 
699 /**
700  * @brief Read RX buffer
701  * @param[in] interface Underlying network interface
702  * @param[in] control Control byte
703  * @param[in] address Buffer address
704  * @param[out] data Buffer where to store the incoming data
705  * @param[in] length Number of data to read
706  **/
707 
708 void w6100ReadBuffer(NetInterface *interface, uint8_t control,
709  uint16_t address, uint8_t *data, size_t length)
710 {
711  size_t i;
712 
713  //Pull the CS pin low
714  interface->spiDriver->assertCs();
715 
716  //Address phase
717  interface->spiDriver->transfer(MSB(address));
718  interface->spiDriver->transfer(LSB(address));
719 
720  //Control phase
721  interface->spiDriver->transfer(control | W6100_CTRL_RWB_READ |
723 
724  //Data phase
725  for(i = 0; i < length; i++)
726  {
727  data[i] = interface->spiDriver->transfer(0x00);
728  }
729 
730  //Terminate the operation by raising the CS pin
731  interface->spiDriver->deassertCs();
732 }
733 
734 
735 /**
736  * @brief Dump registers for debugging purpose
737  * @param[in] interface Underlying network interface
738  **/
739 
740 void w6100DumpReg(NetInterface *interface)
741 {
742  uint16_t i;
743 
744  //Loop through registers
745  for(i = 0; i < 4; i++)
746  {
747  //Display current host MAC register
748  TRACE_DEBUG("%02" PRIX16 ": 0x%02" PRIX8 "\r\n", i,
750  }
751 
752  //Terminate with a line feed
753  TRACE_DEBUG("\r\n");
754 }
bool_t osSetEventFromIsr(OsEvent *event)
Set an event object to the signaled state from an interrupt service routine.
void nicNotifyLinkChange(NetInterface *interface)
Process link state change notification.
Definition: nic.c:559
void w6100WriteBuffer(NetInterface *interface, uint8_t control, uint16_t address, const uint8_t *data, size_t length)
Write TX buffer.
Definition: w6100_driver.c:672
#define W6100_SHAR0
Definition: w6100_driver.h:134
#define W6100_CIDR0
Definition: w6100_driver.h:88
#define W6100_CTRL_BSB_Sn_REG(n)
Definition: w6100_driver.h:667
int bool_t
Definition: compiler_port.h:53
#define W6100_SHAR1
Definition: w6100_driver.h:135
#define netEvent
Definition: net_legacy.h:196
error_t w6100ReceivePacket(NetInterface *interface)
Receive a packet.
Definition: w6100_driver.c:446
#define W6100_SYCR0
Definition: w6100_driver.h:93
#define W6100_CTRL_BSB_S0_REG
Definition: w6100_driver.h:54
@ NIC_FULL_DUPLEX_MODE
Definition: nic.h:125
size_t netBufferRead(void *dest, const NetBuffer *src, size_t srcOffset, size_t length)
Read data from a multi-part buffer.
Definition: net_mem.c:690
#define W6100_SIR
Definition: w6100_driver.h:99
#define W6100_SIMR
Definition: w6100_driver.h:103
uint8_t control
Definition: ethernet.h:234
uint8_t p
Definition: ndp.h:300
Structure describing a buffer that spans multiple chunks.
Definition: net_mem.h:89
#define W6100_Sn_TX_BSR_0KB
Definition: w6100_driver.h:651
void w6100DumpReg(NetInterface *interface)
Dump registers for debugging purpose.
Definition: w6100_driver.c:740
#define TRUE
Definition: os_port.h:50
#define W6100_ETH_RX_BUFFER_SIZE
Definition: w6100_driver.h:46
#define W6100_CTRL_BSB_S0_TX_BUFFER
Definition: w6100_driver.h:55
uint8_t data[]
Definition: ethernet.h:222
#define sleep(delay)
Definition: os_port.h:307
#define ETH_MAX_FRAME_SIZE
Definition: ethernet.h:110
#define W6100_PHYSR_DPX
Definition: w6100_driver.h:491
#define W6100_CTRL_OM_FDM2
Definition: w6100_driver.h:84
__weak_func void w6100InitHook(NetInterface *interface)
W6100 custom configuration.
Definition: w6100_driver.c:196
#define W6100_IMR
Definition: w6100_driver.h:101
bool_t w6100IrqHandler(NetInterface *interface)
W6100 interrupt service routine.
Definition: w6100_driver.c:294
void w6100WriteReg8(NetInterface *interface, uint8_t control, uint16_t address, uint8_t data)
Write 8-bit register.
Definition: w6100_driver.c:539
#define W6100_Sn_IRCLR
Definition: w6100_driver.h:312
#define W6100_CTRL_BSB_COMMON_REG
Definition: w6100_driver.h:53
void nicProcessPacket(NetInterface *interface, uint8_t *packet, size_t length, NetRxAncillary *ancillary)
Handle a packet received by the network controller.
Definition: nic.c:392
#define W6100_Sn_CR_RECV
Definition: w6100_driver.h:594
#define W6100_Sn_TX_WR0
Definition: w6100_driver.h:362
#define W6100_Sn_TX_BSR
Definition: w6100_driver.h:357
error_t w6100Init(NetInterface *interface)
W6100 controller initialization.
Definition: w6100_driver.c:71
#define FALSE
Definition: os_port.h:46
#define W6100_CHPLCKR
Definition: w6100_driver.h:295
#define W6100_SHAR2
Definition: w6100_driver.h:136
void w6100EventHandler(NetInterface *interface)
W6100 event handler.
Definition: w6100_driver.c:356
#define W6100_CIDR0_DEFAULT
Definition: w6100_driver.h:373
error_t
Error codes.
Definition: error.h:43
WIZnet W6100 Ethernet controller.
uint8_t w6100ReadReg8(NetInterface *interface, uint8_t control, uint16_t address)
Read 8-bit register.
Definition: w6100_driver.c:569
#define W6100_Sn_TX_FSR0
Definition: w6100_driver.h:358
#define W6100_Sn_RX_BSR_16KB
Definition: w6100_driver.h:664
const NetRxAncillary NET_DEFAULT_RX_ANCILLARY
Definition: net_misc.c:104
@ ERROR_FAILURE
Generic error code.
Definition: error.h:45
#define W6100_Sn_CR
Definition: w6100_driver.h:309
#define W6100_NETLCKR_UNLOCK
Definition: w6100_driver.h:551
#define W6100_PHYSR_SPD
Definition: w6100_driver.h:492
#define NetRxAncillary
Definition: net_misc.h:40
#define NetInterface
Definition: net.h:36
@ NIC_LINK_SPEED_10MBPS
Definition: nic.h:111
void w6100ReadBuffer(NetInterface *interface, uint8_t control, uint16_t address, uint8_t *data, size_t length)
Read RX buffer.
Definition: w6100_driver.c:708
@ ERROR_INVALID_LENGTH
Definition: error.h:111
#define W6100_Sn_MR_MF
Definition: w6100_driver.h:560
#define W6100_Sn_IMR
Definition: w6100_driver.h:311
@ ERROR_BUFFER_EMPTY
Definition: error.h:141
#define NetTxAncillary
Definition: net_misc.h:36
#define W6100_Sn_RX_RSR0
Definition: w6100_driver.h:365
uint16_t w6100ReadReg16(NetInterface *interface, uint8_t control, uint16_t address)
Read 16-bit register.
Definition: w6100_driver.c:635
#define MSB(x)
Definition: os_port.h:59
error_t w6100UpdateMacAddrFilter(NetInterface *interface)
Configure MAC address filtering.
Definition: w6100_driver.c:524
#define TRACE_INFO(...)
Definition: debug.h:95
uint8_t length
Definition: tcp.h:368
#define W6100_Sn_CR_OPEN
Definition: w6100_driver.h:587
size_t netBufferGetLength(const NetBuffer *buffer)
Get the actual length of a multi-part buffer.
Definition: net_mem.c:297
#define LSB(x)
Definition: os_port.h:55
#define W6100_SIR_S0_INT
Definition: w6100_driver.h:413
#define W6100_Sn_IMR_SENDOK
Definition: w6100_driver.h:606
#define W6100_ETH_TX_BUFFER_SIZE
Definition: w6100_driver.h:39
#define W6100_Sn_RX_BSR_0KB
Definition: w6100_driver.h:659
#define TRACE_DEBUG(...)
Definition: debug.h:107
#define W6100_SYCR1
Definition: w6100_driver.h:94
#define W6100_NETLCKR
Definition: w6100_driver.h:296
#define W6100_Sn_IRCLR_RECV
Definition: w6100_driver.h:615
#define W6100_Sn_SR_SOCK_MACRAW
Definition: w6100_driver.h:633
#define ETH_MTU
Definition: ethernet.h:116
#define W6100_SHAR5
Definition: w6100_driver.h:139
uint8_t n
void w6100WriteReg16(NetInterface *interface, uint8_t control, uint16_t address, uint16_t data)
Write 16-bit register.
Definition: w6100_driver.c:604
#define W6100_CTRL_OM_FDM1
Definition: w6100_driver.h:83
#define W6100_Sn_CR_SEND
Definition: w6100_driver.h:592
Ipv6Addr address[]
Definition: ipv6.h:325
#define W6100_Sn_IMR_RECV
Definition: w6100_driver.h:608
#define W6100_Sn_IR_RECV
Definition: w6100_driver.h:601
@ NIC_HALF_DUPLEX_MODE
Definition: nic.h:124
#define W6100_CHPLCKR_UNLOCK
Definition: w6100_driver.h:548
uint8_t value[]
Definition: tcp.h:369
#define W6100_CTRL_BSB_S0_RX_BUFFER
Definition: w6100_driver.h:56
#define W6100_Sn_RX_RD0
Definition: w6100_driver.h:367
#define W6100_CTRL_RWB_WRITE
Definition: w6100_driver.h:80
#define W6100_Sn_IR_SENDOK
Definition: w6100_driver.h:599
void w6100EnableIrq(NetInterface *interface)
Enable interrupts.
Definition: w6100_driver.c:263
#define W6100_Sn_IRCLR_SENDOK
Definition: w6100_driver.h:613
void osSetEvent(OsEvent *event)
Set the specified event object to the signaled state.
#define W6100_CTRL_RWB_READ
Definition: w6100_driver.h:79
#define W6100_Sn_IR
Definition: w6100_driver.h:310
#define W6100_Sn_TX_BSR_16KB
Definition: w6100_driver.h:656
#define W6100_CTRL_OM_VDM
Definition: w6100_driver.h:82
error_t w6100SendPacket(NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
Send a packet.
Definition: w6100_driver.c:381
@ NIC_LINK_SPEED_100MBPS
Definition: nic.h:112
void w6100DisableIrq(NetInterface *interface)
Disable interrupts.
Definition: w6100_driver.c:278
#define W6100_Sn_MR_PROTOCOL_MACRAW
Definition: w6100_driver.h:574
#define W6100_Sn_SR
Definition: w6100_driver.h:313
#define W6100_SYCR1_IEN
Definition: w6100_driver.h:395
void w6100Tick(NetInterface *interface)
W6100 timer handler.
Definition: w6100_driver.c:206
const NicDriver w6100Driver
W6100 driver.
Definition: w6100_driver.c:44
unsigned int uint_t
Definition: compiler_port.h:50
#define W6100_PHYSR_LNK
Definition: w6100_driver.h:493
#define W6100_SIMR_S0_INT
Definition: w6100_driver.h:447
#define LOAD16BE(p)
Definition: cpu_endian.h:186
TCP/IP stack core.
#define W6100_Sn_RX_BSR
Definition: w6100_driver.h:364
NIC driver.
Definition: nic.h:286
#define W6100_Sn_MR
Definition: w6100_driver.h:307
#define W6100_SHAR4
Definition: w6100_driver.h:138
@ NO_ERROR
Success.
Definition: error.h:44
Debugging facilities.
#define W6100_PHYSR
Definition: w6100_driver.h:108
#define W6100_SHAR3
Definition: w6100_driver.h:137
@ NIC_TYPE_ETHERNET
Ethernet interface.
Definition: nic.h:83