Skip to main content

EmacError

Enum EmacError 

Source
#[non_exhaustive]
pub enum EmacError {
Show 15 variants Timeout, DmaResetTimeout, DmaError, InvalidConfig, InvalidPhyAddress, InvalidLength, FrameTooLarge, NoDescriptorsAvailable, DescriptorBusy, NoFrameAvailable, FrameError, BufferTooSmall, NotInitialized, AlreadyInitialized, TxFlushTimeout,
}
Expand description

EMAC driver error.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Timeout

MDIO operation timed out (no PHY response within the SMI window).

§

DmaResetTimeout

DMA software reset (DMABUSMODE.SWR) did not self-clear within the crate::reset::ResetController timeout. Distinct from Self::Timeout so callers can tell SMI-bus errors apart from DMA-controller stuckness.

§

DmaError

DMA descriptor or buffer error.

§

InvalidConfig

Invalid configuration (bad pin, clock, etc.).

§

InvalidPhyAddress

PHY address out of range (must be 0-31).

§

InvalidLength

Frame length is zero or otherwise invalid.

§

FrameTooLarge

Frame too large for available descriptors/buffers.

§

NoDescriptorsAvailable

No TX descriptors available (ring full).

§

DescriptorBusy

Descriptor is still owned by DMA.

§

NoFrameAvailable

No received frame available.

§

FrameError

Received frame has errors (CRC, overflow, etc.).

§

BufferTooSmall

Caller-provided buffer too small for the received frame.

§

NotInitialized

DMA engine not initialized.

§

AlreadyInitialized

init() was called twice.

§

TxFlushTimeout

stop() could not flush the TX FIFO within TX_FIFO_FLUSH_TIMEOUT_US. Teardown still proceeded — the driver state is back to crate::EmacState::Initialized and MAC/DMA are quiesced — but at least one in-flight TX frame may have been truncated on the wire. The caller decides whether to treat this as a recoverable warning (sample, log, start() again — the engine is ready) or as terminal: there is no in-crate “re-init” path because crate::Emac::init is one-shot, so a hard recovery means a peripheral / SoC reset from the application layer.

Trait Implementations§

Source§

impl Clone for EmacError

Source§

fn clone(&self) -> EmacError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EmacError

Source§

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

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

impl Format for EmacError

Source§

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

Writes the defmt representation of self to fmt.
Source§

impl From<ResetError> for EmacError

Source§

fn from(e: ResetError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for EmacError

Source§

fn eq(&self, other: &EmacError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for EmacError

Source§

impl Eq for EmacError

Source§

impl StructuralPartialEq for EmacError

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.