aboutsummaryrefslogtreecommitdiff
path: root/embassy-net-wiznet/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-net-wiznet/src/lib.rs')
-rw-r--r--embassy-net-wiznet/src/lib.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/embassy-net-wiznet/src/lib.rs b/embassy-net-wiznet/src/lib.rs
index da70d22bd..90102196a 100644
--- a/embassy-net-wiznet/src/lib.rs
+++ b/embassy-net-wiznet/src/lib.rs
@@ -17,12 +17,22 @@ use embedded_hal_async::spi::SpiDevice;
17use crate::chip::Chip; 17use crate::chip::Chip;
18use crate::device::WiznetDevice; 18use crate::device::WiznetDevice;
19 19
20// If you change this update the docs of State
20const MTU: usize = 1514; 21const MTU: usize = 1514;
21 22
22/// Type alias for the embassy-net driver. 23/// Type alias for the embassy-net driver.
23pub type Device<'d> = embassy_net_driver_channel::Device<'d, MTU>; 24pub type Device<'d> = embassy_net_driver_channel::Device<'d, MTU>;
24 25
25/// Internal state for the embassy-net integration. 26/// Internal state for the embassy-net integration.
27///
28/// The two generic arguments `N_RX` and `N_TX` set the size of the receive and
29/// send packet queue. With a the ethernet MTU of _1514_ this takes up `N_RX +
30/// NTX * 1514` bytes. While setting these both to 1 is the minimum this might
31/// hurt performance as a packet can not be received while processing another.
32///
33/// # Warning
34/// On devices with a small amount of ram (think ~64k) watch out with the size
35/// of there parameters. They will quickly use too much RAM.
26pub struct State<const N_RX: usize, const N_TX: usize> { 36pub struct State<const N_RX: usize, const N_TX: usize> {
27 ch_state: ch::State<MTU, N_RX, N_TX>, 37 ch_state: ch::State<MTU, N_RX, N_TX>,
28} 38}