circuitpython/ports
Damien George 7d86ac6c01 stm32: Add network driver for Wiznet5k using MACRAW mode and lwIP.
The Wiznet5k series of chips support a MACRAW mode which allows the host to
send and receive Ethernet frames directly.  This can be hooked into the
lwIP stack to provide a full "socket" implementation using this Wiznet
Ethernet device.  This patch adds support for this feature.

To enable the feature one must add the following to mpconfigboard.mk, or
mpconfigport.mk:

    MICROPY_PY_WIZNET5K = 5500

and the following to mpconfigboard.h, or mpconfigport.h:

    #define MICROPY_PY_LWIP (1)

After wiring up the module (X5=CS, X4=RST), usage on a pyboard is:

    import time, network
    nic = network.WIZNET5K(pyb.SPI(1), pyb.Pin.board.X5, pyb.Pin.board.X4)
    nic.active(1)
    while not nic.isconnected():
        time.sleep_ms(50) # needed to poll the NIC
    print(nic.ifconfig())

Then use the socket module as usual.

Compared to using the built-in TCP/IP stack on the Wiznet module, some
performance is lost in MACRAW mode: with a lot of memory allocated to lwIP
buffers, lwIP gives Around 750,000 bytes/sec max TCP download, compared
with 1M/sec when using the TCP/IP stack on the Wiznet module.
2018-06-01 14:21:38 +10:00
..
bare-arm ports/{bare-arm,minimal}/Makefile: Only build with core source files. 2018-02-22 12:48:51 +11:00
cc3200 py/stream: Switch stream close operation from method to ioctl. 2018-04-10 13:41:32 +10:00
esp32 esp32: Silence ESP-IDF log messages when in raw REPL mode. 2018-05-28 20:15:08 +10:00
esp8266 ports: Enable MICROPY_PY_BUILTINS_ROUND_INT on selected ports. 2018-05-22 14:18:16 +10:00
minimal minimal/main: Allow to compile without GC enabled. 2018-05-21 13:13:21 +10:00
pic16bit all: Update Makefiles and others to build with new ports/ dir layout. 2017-09-06 14:09:13 +10:00
qemu-arm qemu-arm/test_main: Include setjmp.h because it's used by gc_collect. 2017-12-20 15:42:06 +11:00
stm32 stm32: Add network driver for Wiznet5k using MACRAW mode and lwIP. 2018-06-01 14:21:38 +10:00
teensy stm32/pin: In pin AF object, remove union of periph ptr types. 2018-04-11 16:14:58 +10:00
unix ports: Enable MICROPY_PY_BUILTINS_ROUND_INT on selected ports. 2018-05-22 14:18:16 +10:00
windows ports: Enable ucollections.deque on relevant ports. 2018-02-21 22:55:13 +11:00
zephyr zephyr/Makefile: Add kobj_types_h_target to Z_EXPORTS. 2018-05-21 10:35:16 +10:00