diff options
Diffstat (limited to 'embassy-net-wiznet/src/lib.rs')
| -rw-r--r-- | embassy-net-wiznet/src/lib.rs | 10 |
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; | |||
| 17 | use crate::chip::Chip; | 17 | use crate::chip::Chip; |
| 18 | use crate::device::WiznetDevice; | 18 | use crate::device::WiznetDevice; |
| 19 | 19 | ||
| 20 | // If you change this update the docs of State | ||
| 20 | const MTU: usize = 1514; | 21 | const MTU: usize = 1514; |
| 21 | 22 | ||
| 22 | /// Type alias for the embassy-net driver. | 23 | /// Type alias for the embassy-net driver. |
| 23 | pub type Device<'d> = embassy_net_driver_channel::Device<'d, MTU>; | 24 | pub 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. | ||
| 26 | pub struct State<const N_RX: usize, const N_TX: usize> { | 36 | pub 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 | } |
