[][src]Struct w5500::ActiveW5500

pub struct ActiveW5500<'a, 'b, ChipSelect: OutputPin, Spi: FullDuplex<u8>>(_, _);

This - by concept meant to be a temporary - instance allows to directly communicate with the w5500 device. The reference to the W5500 provides the chip-select OutputPin as well as its current state. The given SPI interface is borrowed for as long as this instance lives to communicate with the W5500 chip. Drop this instance to re-use the SPI bus for communication with another device.

Implementations

impl<'_, '_, ChipSelectError, ChipSelect: OutputPin<Error = ChipSelectError>, SpiError, Spi: FullDuplex<u8, Error = SpiError>> ActiveW5500<'_, '_, ChipSelect, Spi>[src]

pub fn take_socket(&mut self, socket: Socket) -> Option<UninitializedSocket>[src]

Returns the requested socket if it is not already taken. See W5500::take_socket

pub fn update_operation_mode(
    &mut self,
    wol: OnWakeOnLan,
    ping: OnPingRequest,
    mode: ConnectionType,
    arp: ArpResponses
) -> Result<(), TransferError<SpiError, ChipSelectError>>
[src]

Set up the basic configuration of the W5500 chip

pub fn set_gateway(
    &mut self,
    gateway: IpAddress
) -> Result<(), TransferError<SpiError, ChipSelectError>>
[src]

Sets the IP address of the network gateway (your router's address)

pub fn set_subnet(
    &mut self,
    subnet: IpAddress
) -> Result<(), TransferError<SpiError, ChipSelectError>>
[src]

Sets the subnet on the network (for example 255.255.255.0 for /24 subnets)

pub fn set_mac(
    &mut self,
    mac: MacAddress
) -> Result<(), TransferError<SpiError, ChipSelectError>>
[src]

Sets the MAC address of the W5500 device on the network. Consider using freely available private/locally administered mac addresses that match the following hex pattern:

 x2-xx-xx-xx-xx-xx
 x6-xx-xx-xx-xx-xx
 xA-xx-xx-xx-xx-xx
 xE-xx-xx-xx-xx-xx

"Universally administered and locally administered addresses are distinguished by setting the second-least-significant bit of the first octet of the address" Wikipedia

pub fn set_ip(
    &mut self,
    ip: IpAddress
) -> Result<(), TransferError<SpiError, ChipSelectError>>
[src]

Sets the IP address of the W5500 device. Must be within the range and permitted by the gateway or the device will not be accessible.

pub fn read_ip(
    &mut self,
    register: Register
) -> Result<IpAddress, TransferError<SpiError, ChipSelectError>>
[src]

Reads the 4 bytes from any ip register and returns the value as an IpAddress

pub unsafe fn reset(
    &mut self
) -> Result<(), TransferError<SpiError, ChipSelectError>>
[src]

Safety

This is unsafe because it cannot set taken Sockets back to be uninitialized It assumes, none of the old sockets will used beyond this call. Because the state of the Sockets is no longer in sync with the W5500, their usage might result in undefined behavior.

pub fn reset_interrupt(
    &mut self,
    socket: Socket,
    interrupt: Interrupt
) -> Result<(), TransferError<SpiError, ChipSelectError>>
[src]

TODO document

Auto Trait Implementations

impl<'a, 'b, ChipSelect, Spi> Send for ActiveW5500<'a, 'b, ChipSelect, Spi> where
    ChipSelect: Send,
    Spi: Send

impl<'a, 'b, ChipSelect, Spi> Sync for ActiveW5500<'a, 'b, ChipSelect, Spi> where
    ChipSelect: Sync,
    Spi: Sync

impl<'a, 'b, ChipSelect, Spi> Unpin for ActiveW5500<'a, 'b, ChipSelect, Spi>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.