Rust W5100 Ethernet driver
Find a file
2021-02-18 19:24:06 -08:00
.github Different clippy lint allowed 2021-02-18 19:23:28 -08:00
src Removed refcell container from Interface 2021-02-18 19:24:06 -08:00
.gitignore Remove Cargo.lock 2020-08-09 15:48:04 -07:00
.gitlab-ci.yml Add gitlab mirror script 2018-03-18 20:48:15 +01:00
Cargo.toml Updated to latest embedded-nal 2021-02-18 19:24:06 -08:00
CHANGELOG.md Add CHANGELOG for upcoming 0.3.0 release 2020-06-10 17:29:38 +02:00
driver_state_machine_diagram.svg Added state-machine diagram SVG 2021-02-18 19:12:57 -08:00
LICENSE-APACHE GH-3: Clarify licensing 2019-02-12 17:25:17 +01:00
LICENSE-MIT GH-3: Clarify licensing 2019-02-12 17:25:17 +01:00
README.md Removed implementation description from README, updated example to work with latest embedded-nal interface, removed completed TODOs 2021-02-18 19:23:28 -08:00

W5500 Driver

This crate is a driver for the WIZnet W5500 chip. The W5500 chip is a hardwired TCP/IP embedded Ethernet controller that enables embedded systems using SPI (Serial Peripheral Interface) to access the LAN. It is one of the more popular ethernet modules on Arduino platforms.

Build Status License Crates.io Documentation PRs Welcome

Embedded-HAL

Embedded-HAL is a standard set of traits meant to permit communication between MCU implementations and hardware drivers like this one. Any microcontroller that implements the spi::FullDuplex<u8> interface can use this driver.

Example Usage

Below is a basic example of sending UDP packets to a remote host. An important thing to confirm is the configuration of the SPI implementation. It must be set up to work as the W5500 chip requires. That configuration is as follows:

  • Data Order: Most significant bit first
  • Clock Polarity: Idle low
  • Clock Phase: Sample leading edge
  • Clock speed: 33MHz maximum
    let mut spi = ...; // SPI interface to use
    let mut cs : OutputPin = ...; // chip select

    let interface = Interface::setup(spi, cs, MacAddress::new(0, 1, 2, 3, 4, 5), Ipv4Addr::new(192, 168, 86, 79)).unwrap();
    let socket = interface.connect(
        SocketAddr::new(IpAddr::V4(Ipv4Addr::new(192, 168, 86, 38)), 8000),
    ).unwrap();
    block!(interface.send(&mut socket, &[104, 101, 108, 108, 111, 10]));
    interface.close(socket);

Todo

In no particular order, things to do to improve this driver.

  • Add support for TCP
  • Add support for DHCP