Enum w5500_ll::BufferSize[][src]

#[repr(u8)]
pub enum BufferSize {
    KB0,
    KB1,
    KB2,
    KB4,
    KB8,
    KB16,
}
Expand description

RX and TX buffer sizes.

This is an argument of Registers::set_sn_rxbuf_size and Registers::set_sn_txbuf_size.

Variants

KB0

0 KiB

KB1

1 KiB

KB2

2 KiB

KB4

4 KiB

KB8

8 KiB

KB16

16 KiB

Implementations

Get the buffer size in bytes.

Example
use w5500_ll::BufferSize;

assert_eq!(BufferSize::KB0.size_in_bytes(), 0);
assert_eq!(BufferSize::KB1.size_in_bytes(), 1 * 1024);
assert_eq!(BufferSize::KB2.size_in_bytes(), 2 * 1024);
assert_eq!(BufferSize::KB4.size_in_bytes(), 4 * 1024);
assert_eq!(BufferSize::KB8.size_in_bytes(), 8 * 1024);
assert_eq!(BufferSize::KB16.size_in_bytes(), 16 * 1024);

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Default buffer size.

Example
use w5500_ll::BufferSize;

assert_eq!(BufferSize::default(), BufferSize::KB2);

Writes the defmt representation of self to fmt.

Get the register value from a buffer size.

Example
use w5500_ll::BufferSize;

assert_eq!(u8::from(BufferSize::KB0), 0);
assert_eq!(u8::from(BufferSize::KB1), 1);
assert_eq!(u8::from(BufferSize::KB2), 2);
assert_eq!(u8::from(BufferSize::KB4), 4);
assert_eq!(u8::from(BufferSize::KB8), 8);
assert_eq!(u8::from(BufferSize::KB16), 16);

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Get the buffer size given the register value.

Example
use w5500_ll::BufferSize;

assert_eq!(BufferSize::try_from(0), Ok(BufferSize::KB0));
assert_eq!(BufferSize::try_from(1), Ok(BufferSize::KB1));
assert_eq!(BufferSize::try_from(2), Ok(BufferSize::KB2));
assert_eq!(BufferSize::try_from(4), Ok(BufferSize::KB4));
assert_eq!(BufferSize::try_from(8), Ok(BufferSize::KB8));
assert_eq!(BufferSize::try_from(16), Ok(BufferSize::KB16));
assert_eq!(BufferSize::try_from(17), Err(17));

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.