aboutsummaryrefslogtreecommitdiff
path: root/embassy-net-wiznet
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2024-06-07 23:00:56 +0000
committerGitHub <[email protected]>2024-06-07 23:00:56 +0000
commite5495b51b43f71cdc489e92f4deb0cbc0e27e6aa (patch)
tree3514edf08ca79828d81c7db61f725b65c5334093 /embassy-net-wiznet
parent4a4b8c9b8de8eaf874372f6239dc1a220f172318 (diff)
parentab31a02e17b812a965842c1b14dc44b96a57932a (diff)
Merge pull request #3057 from dvdsk/docs-net-size
Document w5500 State and add w5500 example for stmf4
Diffstat (limited to 'embassy-net-wiznet')
-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}