Skip to content

Commit

Permalink
w5200: Allow selecting maximum fixed buffer size for MACRAW.
Browse files Browse the repository at this point in the history
Enabling WIZCHIP_USE_MAX_BUFFER will make the TX/RX buffers the maximum
available size, for use with MACRAW mode.

Adapted from original version by @dpgeorge at:
micropython/micropython@cd9de63
  • Loading branch information
pi-anl committed Apr 26, 2022
1 parent 0fb14c8 commit 0803fc5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Ethernet/W5200/w5200.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,23 @@
#include "w5200.h"

#if (_WIZCHIP_ == 5200)

#if WIZCHIP_USE_MAX_BUFFER
// This option is intended to be used when MACRAW mode is enabled, to allow
// the single raw socket to use all the available buffer space.
#undef getSn_TxMASK
#define getSn_TxMASK(sn) (16 * 1024 - 1) /* tx buffer mask */

#undef getSn_TxMAX
#define getSn_TxMAX(sn) (16 * 1024) /* max tx buffer size */

#undef getSn_RxMASK
#define getSn_RxMASK(sn) (16 * 1024 - 1) /* rx buffer mask */

#undef getSn_RxMAX
#define getSn_RxMAX(sn) (16 * 1024) /* max rx buffer size */
#endif

/**
@brief This function writes the data into W5200 registers.
*/
Expand Down

0 comments on commit 0803fc5

Please sign in to comment.