[−][src]Struct stm32_eth::Eth
Ethernet driver for STM32 chips with a LAN8742
Phy like they're found on STM Nucleo-144
boards.
Methods
impl<'rx, 'tx> Eth<'rx, 'tx>[src]
pub fn new(
eth_mac: ETHERNET_MAC,
eth_dma: ETHERNET_DMA,
rx_buffer: &'rx mut [RingEntry<RxDescriptor>],
tx_buffer: &'tx mut [RingEntry<TxDescriptor>]
) -> Self[src]
eth_mac: ETHERNET_MAC,
eth_dma: ETHERNET_DMA,
rx_buffer: &'rx mut [RingEntry<RxDescriptor>],
tx_buffer: &'tx mut [RingEntry<TxDescriptor>]
) -> Self
Initialize and start tx and rx DMA engines.
You must call setup() before to initialize
the hardware!
Make sure that the buffers reside in a memory region that is accessible by the peripheral. Core-Coupled Memory (CCM) is usually not.
Other than that, initializes and starts the Ethernet hardware
so that you can send() and
recv_next().
pub fn enable_interrupt(&self, nvic: &mut NVIC)[src]
Enable RX and TX interrupts
In your handler you must call
eth_interrupt_handler() to
clear interrupt pending bits. Otherwise the interrupt will
reoccur immediately.
pub fn interrupt_handler(&self)[src]
Calls eth_interrupt_handler()
pub fn get_phy<'a>(&'a self) -> Phy<'a>[src]
Construct a PHY driver
pub fn status(&self) -> PhyStatus[src]
Obtain PHY status
pub fn rx_is_running(&self) -> bool[src]
Is Rx DMA currently running?
It stops if the ring is full. Call recv_next() to free an
entry and to demand poll from the hardware.
pub fn recv_next(&mut self) -> Result<RxPacket, RxError>[src]
Receive the next packet (if any is ready), or return None
immediately.
pub fn tx_is_running(&self) -> bool[src]
Is Tx DMA currently running?
pub fn send<F: FnOnce(&mut [u8]) -> R, R>(
&mut self,
length: usize,
f: F
) -> Result<R, TxError>[src]
&mut self,
length: usize,
f: F
) -> Result<R, TxError>
Send a packet
Trait Implementations
impl<'a, 'rx, 'tx, 'b> Device<'a> for &'b mut Eth<'rx, 'tx>[src]
Use this Ethernet driver with smoltcp
type RxToken = EthRxToken<'a>
type TxToken = EthTxToken<'a>
fn capabilities(&self) -> DeviceCapabilities[src]
fn receive(&mut self) -> Option<(Self::RxToken, Self::TxToken)>[src]
fn transmit(&mut self) -> Option<Self::TxToken>[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From for T[src]
impl<T, U> TryFrom 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 for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Same for T
type Output = T
Should always be Self