pub struct W5500<SPI, CS> { /* private fields */ }
Available on crate feature eh0 only.
Expand description

W5500 blocking variable data length implementation.

Implementations§

source§

impl<SPI, CS, SpiError> W5500<SPI, CS>where SPI: Transfer<u8, Error = SpiError> + Write<u8, Error = SpiError>, CS: OutputPin<Error = Infallible>,

source

pub fn new(spi: SPI, cs: CS) -> Self

Creates a new W5500 driver from a SPI peripheral and a chip select digital I/O pin.

Safety

The chip select pin must be high before being passed to this function.

Example
use eh0::digital::v2::OutputPin;
use w5500_ll::eh0::vdm_infallible_gpio::W5500;

pin.set_high().unwrap();
let mut w5500: W5500<_, _> = W5500::new(spi, pin);
source

pub fn free(self) -> (SPI, CS)

Free the SPI bus and CS pin from the W5500.

Example
use w5500_ll::eh0::vdm_infallible_gpio::W5500;

let mut w5500 = W5500::new(spi, pin);
let (mut spi, pin) = w5500.free();

Trait Implementations§

source§

impl<SPI: Debug, CS: Debug> Debug for W5500<SPI, CS>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<SPI, CS> Format for W5500<SPI, CS>where SPI: Format, CS: Format,

source§

fn format(&self, f: Formatter<'_>)

Writes the defmt representation of self to fmt.
source§

impl<SPI, CS, SpiError> Registers for W5500<SPI, CS>where SPI: Transfer<u8, Error = SpiError> + Write<u8, Error = SpiError>, CS: OutputPin<Error = Infallible>,

§

type Error = SpiError

SPI IO error type.

source§

fn read( &mut self, address: u16, block: u8, data: &mut [u8] ) -> Result<(), Self::Error>

Read from the W5500.

source§

fn write( &mut self, address: u16, block: u8, data: &[u8] ) -> Result<(), Self::Error>

Write to the W5500.

source§

fn mr(&mut self) -> Result<Mode, Self::Error>

Get the mode register. Read more
source§

fn set_mr(&mut self, mode: Mode) -> Result<(), Self::Error>

Set the mode register. Read more
source§

fn gar(&mut self) -> Result<Ipv4Addr, Self::Error>

Get the gateway IP address. Read more
source§

fn set_gar(&mut self, gar: &Ipv4Addr) -> Result<(), Self::Error>

Set the gateway IP address. Read more
source§

fn subr(&mut self) -> Result<Ipv4Addr, Self::Error>

Get the subnet mask. Read more
source§

fn set_subr(&mut self, subr: &Ipv4Addr) -> Result<(), Self::Error>

Set the subnet mask. Read more
source§

fn shar(&mut self) -> Result<Eui48Addr, Self::Error>

Get the source hardware address. Read more
source§

fn set_shar(&mut self, shar: &Eui48Addr) -> Result<(), Self::Error>

Set the source hardware address. Read more
source§

fn sipr(&mut self) -> Result<Ipv4Addr, Self::Error>

Get the source (client) IP address. Read more
source§

fn set_sipr(&mut self, sipr: &Ipv4Addr) -> Result<(), Self::Error>

Set the source (client) IP address. Read more
source§

fn intlevel(&mut self) -> Result<u16, Self::Error>

Get the interrupt low level time. Read more
source§

fn set_intlevel(&mut self, intlevel: u16) -> Result<(), Self::Error>

Set the interrupt low level time. Read more
source§

fn ir(&mut self) -> Result<Interrupt, Self::Error>

Get the interrupt status. Read more
source§

fn set_ir(&mut self, interrupt: Interrupt) -> Result<(), Self::Error>

Set the interrupt status. Read more
source§

fn imr(&mut self) -> Result<Interrupt, Self::Error>

Get the interrupt mask. Read more
source§

fn set_imr(&mut self, mask: Interrupt) -> Result<(), Self::Error>

Set the interrupt mask. Read more
source§

fn sir(&mut self) -> Result<u8, Self::Error>

Get the socket interrupt status. Read more
source§

fn simr(&mut self) -> Result<u8, Self::Error>

Get the socket interrupt mask. Read more
source§

fn set_simr(&mut self, simr: u8) -> Result<(), Self::Error>

Set the socket interrupt mask. Read more
source§

fn rtr(&mut self) -> Result<u16, Self::Error>

Get the retry time. Read more
source§

fn set_rtr(&mut self, rtr: u16) -> Result<(), Self::Error>

Set the retry time. Read more
source§

fn rcr(&mut self) -> Result<u8, Self::Error>

Get the retry count. Read more
source§

fn set_rcr(&mut self, rcr: u8) -> Result<(), Self::Error>

Set the retry count. Read more
source§

fn ptimer(&mut self) -> Result<u8, Self::Error>

Get the PPP link control protocol request timer. Read more
source§

fn set_ptimer(&mut self, ptimer: u8) -> Result<(), Self::Error>

Set the PPP link control protocol request timer. Read more
source§

fn pmagic(&mut self) -> Result<u8, Self::Error>

Get the PPP link control protocol magic number. Read more
source§

fn set_pmagic(&mut self, pmagic: u8) -> Result<(), Self::Error>

Set the PPP link control protocol magic number. Read more
source§

fn phar(&mut self) -> Result<Eui48Addr, Self::Error>

Get the destination hardware address in PPPoE mode. Read more
source§

fn set_phar(&mut self, phar: &Eui48Addr) -> Result<(), Self::Error>

Set the destination hardware address in PPPoE mode. Read more
source§

fn psid(&mut self) -> Result<u16, Self::Error>

Get the session ID in PPPoE mode. Read more
source§

fn set_psid(&mut self, psid: u16) -> Result<(), Self::Error>

Set the session ID in PPPoE mode. Read more
source§

fn pmru(&mut self) -> Result<u16, Self::Error>

Get the maximum receive unit in PPPoE mode. Read more
source§

fn set_pmru(&mut self, pmru: u16) -> Result<(), Self::Error>

Set the maximum receive unit in PPPoE mode. Read more
source§

fn uipr(&mut self) -> Result<Ipv4Addr, Self::Error>

Get the unreachable IP address. Read more
source§

fn uportr(&mut self) -> Result<u16, Self::Error>

Get the unreachable port. Read more
source§

fn phycfgr(&mut self) -> Result<PhyCfg, Self::Error>

Get the PHY configuration. Read more
source§

fn set_phycfgr(&mut self, phycfg: PhyCfg) -> Result<(), Self::Error>

Set the PHY configuration. Read more
source§

fn version(&mut self) -> Result<u8, Self::Error>

Get the version. Read more
source§

fn sn_mr(&mut self, sn: Sn) -> Result<SocketMode, Self::Error>

Get the socket mode. Read more
source§

fn set_sn_mr(&mut self, sn: Sn, mode: SocketMode) -> Result<(), Self::Error>

Set the socket mode. Read more
source§

fn sn_cr(&mut self, sn: Sn) -> Result<u8, Self::Error>

Get the socket command. Read more
source§

fn set_sn_cr(&mut self, sn: Sn, cmd: SocketCommand) -> Result<(), Self::Error>

Set the socket command. Read more
source§

fn sn_ir(&mut self, sn: Sn) -> Result<SocketInterrupt, Self::Error>

Get the socket interrupt status. Read more
source§

fn set_sn_ir<T: Into<u8>>( &mut self, sn: Sn, sn_ir: T ) -> Result<(), Self::Error>

Set the socket interrupt status. Read more
source§

fn sn_sr(&mut self, sn: Sn) -> Result<Result<SocketStatus, u8>, Self::Error>

Get the socket status. Read more
source§

fn sn_port(&mut self, sn: Sn) -> Result<u16, Self::Error>

Get the socket source port. Read more
source§

fn set_sn_port(&mut self, sn: Sn, port: u16) -> Result<(), Self::Error>

Set the socket source port. Read more
source§

fn sn_dhar(&mut self, sn: Sn) -> Result<Eui48Addr, Self::Error>

Get the socket destination hardware address. Read more
source§

fn set_sn_dhar(&mut self, sn: Sn, dhar: &Eui48Addr) -> Result<(), Self::Error>

Set the socket destination hardware address. Read more
source§

fn sn_dipr(&mut self, sn: Sn) -> Result<Ipv4Addr, Self::Error>

Get the socket destination IP address. Read more
source§

fn set_sn_dipr(&mut self, sn: Sn, dipr: &Ipv4Addr) -> Result<(), Self::Error>

Set the socket destination IP address. Read more
source§

fn sn_dport(&mut self, sn: Sn) -> Result<u16, Self::Error>

Get the socket destination port. Read more
source§

fn set_sn_dport(&mut self, sn: Sn, port: u16) -> Result<(), Self::Error>

Set the socket destination port. Read more
source§

fn sn_dest(&mut self, sn: Sn) -> Result<SocketAddrV4, Self::Error>

Get the socket destination IPv4 and port. Read more
source§

fn set_sn_dest( &mut self, sn: Sn, addr: &SocketAddrV4 ) -> Result<(), Self::Error>

Set the socket destination IPv4 and port. Read more
source§

fn sn_mssr(&mut self, sn: Sn) -> Result<u16, Self::Error>

Get the socket maximum segment size. Read more
source§

fn set_sn_mssr(&mut self, sn: Sn, mssr: u16) -> Result<(), Self::Error>

Set the socket maximum segment size. Read more
source§

fn sn_tos(&mut self, sn: Sn) -> Result<u8, Self::Error>

Get the IP type of service. Read more
source§

fn set_sn_tos(&mut self, sn: Sn, tos: u8) -> Result<(), Self::Error>

Set the IP type of service. Read more
source§

fn sn_ttl(&mut self, sn: Sn) -> Result<u8, Self::Error>

Get the time to live. Read more
source§

fn set_sn_ttl(&mut self, sn: Sn, ttl: u8) -> Result<(), Self::Error>

Set the time to live. Read more
source§

fn sn_rxbuf_size( &mut self, sn: Sn ) -> Result<Result<BufferSize, u8>, Self::Error>

Get the socket RX buffer size. Read more
source§

fn set_sn_rxbuf_size( &mut self, sn: Sn, size: BufferSize ) -> Result<(), Self::Error>

Set the socket RX buffer size. Read more
source§

fn sn_txbuf_size( &mut self, sn: Sn ) -> Result<Result<BufferSize, u8>, Self::Error>

Get the socket TX buffer size. Read more
source§

fn set_sn_txbuf_size( &mut self, sn: Sn, size: BufferSize ) -> Result<(), Self::Error>

Set the socket TX buffer size. Read more
source§

fn sn_tx_fsr(&mut self, sn: Sn) -> Result<u16, Self::Error>

Get transmit buffer free size. Read more
source§

fn sn_tx_rd(&mut self, sn: Sn) -> Result<u16, Self::Error>

Get the socket TX read pointer. Read more
source§

fn sn_tx_wr(&mut self, sn: Sn) -> Result<u16, Self::Error>

Get the socket TX write pointer. Read more
source§

fn set_sn_tx_wr(&mut self, sn: Sn, ptr: u16) -> Result<(), Self::Error>

Set the socket TX write pointer. Read more
source§

fn sn_tx_ptrs(&mut self, sn: Sn) -> Result<TxPtrs, Self::Error>

Get the socket TX free size and write pointer Read more
source§

fn sn_rx_rsr(&mut self, sn: Sn) -> Result<u16, Self::Error>

Get the socket received data size. Read more
source§

fn sn_rx_rd(&mut self, sn: Sn) -> Result<u16, Self::Error>

Get the socket read data pointer. Read more
source§

fn set_sn_rx_rd(&mut self, sn: Sn, ptr: u16) -> Result<(), Self::Error>

Set the socket read data pointer. Read more
source§

fn sn_rx_wr(&mut self, sn: Sn) -> Result<u16, Self::Error>

Get the socket RX write pointer. Read more
source§

fn sn_rx_ptrs(&mut self, sn: Sn) -> Result<RxPtrs, Self::Error>

Get the socket RX recieved size size and write pointer Read more
source§

fn sn_imr(&mut self, sn: Sn) -> Result<SocketInterruptMask, Self::Error>

Get the socket interrupt mask. Read more
source§

fn set_sn_imr( &mut self, sn: Sn, mask: SocketInterruptMask ) -> Result<(), Self::Error>

Set the socket interrupt mask. Read more
source§

fn sn_frag(&mut self, sn: Sn) -> Result<u16, Self::Error>

Get the socket fragment. Read more
source§

fn set_sn_frag(&mut self, sn: Sn, frag: u16) -> Result<(), Self::Error>

Set the socket fragment. Read more
source§

fn sn_kpalvtr(&mut self, sn: Sn) -> Result<u8, Self::Error>

Get the socket keep alive time. Read more
source§

fn set_sn_kpalvtr(&mut self, sn: Sn, kpalvtr: u8) -> Result<(), Self::Error>

Set the socket keep alive time. Read more
source§

fn set_sn_tx_buf( &mut self, sn: Sn, ptr: u16, buf: &[u8] ) -> Result<(), Self::Error>

Write the socket TX buffer. Read more
source§

fn sn_tx_buf( &mut self, sn: Sn, ptr: u16, buf: &mut [u8] ) -> Result<(), Self::Error>

Read the socket TX buffer. Read more
source§

fn sn_rx_buf( &mut self, sn: Sn, ptr: u16, buf: &mut [u8] ) -> Result<(), Self::Error>

Read the socket RX buffer. Read more
source§

fn set_sn_rx_buf( &mut self, sn: Sn, ptr: u16, buf: &[u8] ) -> Result<(), Self::Error>

Write the socket RX buffer. Read more

Auto Trait Implementations§

§

impl<SPI, CS> RefUnwindSafe for W5500<SPI, CS>where CS: RefUnwindSafe, SPI: RefUnwindSafe,

§

impl<SPI, CS> Send for W5500<SPI, CS>where CS: Send, SPI: Send,

§

impl<SPI, CS> Sync for W5500<SPI, CS>where CS: Sync, SPI: Sync,

§

impl<SPI, CS> Unpin for W5500<SPI, CS>where CS: Unpin, SPI: Unpin,

§

impl<SPI, CS> UnwindSafe for W5500<SPI, CS>where CS: UnwindSafe, SPI: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.