[−][src]Struct w5500::ActiveW5500
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]
&mut self,
wol: OnWakeOnLan,
ping: OnPingRequest,
mode: ConnectionType,
arp: ArpResponses
) -> Result<(), TransferError<SpiError, ChipSelectError>>
Set up the basic configuration of the W5500 chip
pub fn set_gateway(
&mut self,
gateway: IpAddress
) -> Result<(), TransferError<SpiError, ChipSelectError>>
[src]
&mut self,
gateway: IpAddress
) -> Result<(), TransferError<SpiError, ChipSelectError>>
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]
&mut self,
subnet: IpAddress
) -> Result<(), TransferError<SpiError, ChipSelectError>>
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]
&mut self,
mac: MacAddress
) -> Result<(), TransferError<SpiError, ChipSelectError>>
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]
&mut self,
ip: IpAddress
) -> Result<(), TransferError<SpiError, ChipSelectError>>
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]
&mut self,
register: Register
) -> Result<IpAddress, TransferError<SpiError, ChipSelectError>>
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]
&mut self
) -> Result<(), TransferError<SpiError, ChipSelectError>>
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]
&mut self,
socket: Socket,
interrupt: Interrupt
) -> Result<(), TransferError<SpiError, ChipSelectError>>
TODO document
Auto Trait Implementations
impl<'a, 'b, ChipSelect, Spi> Send for ActiveW5500<'a, 'b, ChipSelect, Spi> where
ChipSelect: Send,
Spi: Send,
ChipSelect: Send,
Spi: Send,
impl<'a, 'b, ChipSelect, Spi> Sync for ActiveW5500<'a, 'b, ChipSelect, Spi> where
ChipSelect: Sync,
Spi: Sync,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,