Removed the active/inactive concept, and changed bus to use blocking traits to allow users to use shared-bus

This commit is contained in:
Jonah Dahlquist 2021-02-15 20:52:26 -08:00
commit ca8268ab31
13 changed files with 127 additions and 239 deletions

View file

@ -33,8 +33,10 @@ of the SPI implementation. It must be set up to work as the W5500 chip requires
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(
let device = UninitializedDevice::new(FourWire::new(spi, cs));
let device = device.initialize_manual(MacAddress::new(0, 1, 2, 3, 4, 5), Ipv4Addr::new(192, 168, 86, 79), Mode::default()).unwrap();
let socket = interface.socket();
socket.connect(
SocketAddr::new(IpAddr::V4(Ipv4Addr::new(192, 168, 86, 38)), 8000),
).unwrap();
block!(interface.send(&mut socket, &[104, 101, 108, 108, 111, 10]));