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, PinError> W5500<SPI, CS>where
SPI: Transfer<u8, Error = SpiError> + Write<u8, Error = SpiError>,
CS: OutputPin<Error = PinError>,
impl<SPI, CS, SpiError, PinError> W5500<SPI, CS>where SPI: Transfer<u8, Error = SpiError> + Write<u8, Error = SpiError>, CS: OutputPin<Error = PinError>,
sourcepub fn new(spi: SPI, cs: CS) -> Self
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::W5500;
pin.set_high()?;
let mut w5500: W5500<_, _> = W5500::new(spi, pin);
Trait Implementations§
source§impl<SPI, CS, SpiError, PinError> Registers for W5500<SPI, CS>where
SPI: Transfer<u8, Error = SpiError> + Write<u8, Error = SpiError>,
CS: OutputPin<Error = PinError>,
impl<SPI, CS, SpiError, PinError> Registers for W5500<SPI, CS>where SPI: Transfer<u8, Error = SpiError> + Write<u8, Error = SpiError>, CS: OutputPin<Error = PinError>,
source§fn read(
&mut self,
address: u16,
block: u8,
data: &mut [u8]
) -> Result<(), Self::Error>
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>
fn write( &mut self, address: u16, block: u8, data: &[u8] ) -> Result<(), Self::Error>
Write to the W5500.
source§fn set_gar(&mut self, gar: &Ipv4Addr) -> Result<(), Self::Error>
fn set_gar(&mut self, gar: &Ipv4Addr) -> Result<(), Self::Error>
Set the gateway IP address. Read more
source§fn set_subr(&mut self, subr: &Ipv4Addr) -> Result<(), Self::Error>
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>
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>
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>
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>
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>
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>
fn set_intlevel(&mut self, intlevel: u16) -> Result<(), Self::Error>
Set the interrupt low level time. Read more
source§fn set_ir(&mut self, interrupt: Interrupt) -> Result<(), Self::Error>
fn set_ir(&mut self, interrupt: Interrupt) -> Result<(), Self::Error>
Set the interrupt status. Read more
source§fn set_imr(&mut self, mask: Interrupt) -> Result<(), Self::Error>
fn set_imr(&mut self, mask: Interrupt) -> Result<(), Self::Error>
Set the interrupt mask. Read more
source§fn set_simr(&mut self, simr: u8) -> Result<(), Self::Error>
fn set_simr(&mut self, simr: u8) -> Result<(), Self::Error>
Set the socket interrupt mask. Read more
source§fn ptimer(&mut self) -> Result<u8, Self::Error>
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>
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>
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>
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>
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>
fn set_phar(&mut self, phar: &Eui48Addr) -> Result<(), Self::Error>
Set the destination hardware address in PPPoE mode. Read more
source§fn set_psid(&mut self, psid: u16) -> Result<(), Self::Error>
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>
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>
fn set_pmru(&mut self, pmru: u16) -> Result<(), Self::Error>
Set the maximum receive unit in PPPoE mode. Read more
source§fn set_phycfgr(&mut self, phycfg: PhyCfg) -> Result<(), Self::Error>
fn set_phycfgr(&mut self, phycfg: PhyCfg) -> Result<(), Self::Error>
Set the PHY configuration. Read more
source§fn set_sn_mr(&mut self, sn: Sn, mode: SocketMode) -> Result<(), Self::Error>
fn set_sn_mr(&mut self, sn: Sn, mode: SocketMode) -> Result<(), Self::Error>
Set the socket mode. Read more
source§fn set_sn_cr(&mut self, sn: Sn, cmd: SocketCommand) -> Result<(), Self::Error>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
fn set_sn_mssr(&mut self, sn: Sn, mssr: u16) -> Result<(), Self::Error>
Set the socket maximum segment size. Read more
source§fn set_sn_tos(&mut self, sn: Sn, tos: u8) -> Result<(), Self::Error>
fn set_sn_tos(&mut self, sn: Sn, tos: u8) -> Result<(), Self::Error>
Set the IP type of service. Read more
source§fn set_sn_ttl(&mut self, sn: Sn, ttl: u8) -> Result<(), Self::Error>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
fn set_sn_imr( &mut self, sn: Sn, mask: SocketInterruptMask ) -> Result<(), Self::Error>
Set the socket interrupt mask. Read more
source§fn set_sn_frag(&mut self, sn: Sn, frag: u16) -> Result<(), Self::Error>
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>
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>
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>
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>
fn sn_tx_buf( &mut self, sn: Sn, ptr: u16, buf: &mut [u8] ) -> Result<(), Self::Error>
Read the socket TX 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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more