aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32f7
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-02-11 23:11:12 +0000
committerGitHub <[email protected]>2022-02-11 23:11:12 +0000
commit5ae4e20f8654bdc129d152b5364b6864457c2e02 (patch)
tree684ad8ac522778cbb0322decab3806c5b1eb7fd0 /examples/stm32f7
parent621a280042c76786a7832382a6fe8b78acac6d34 (diff)
parentb99ab3d5d9d8fdee135956dcbc2111b00abd1d72 (diff)
Merge #607
607: stm32: Add standard crate-wide macros for pin/dma traits r=Dirbaio a=Dirbaio All drivers will declare the traits using these macros. This has a few implications: - ALL drivers will have an Instance trait, even for drivers that usually have only one instance (for example crc, eth) - It's no longer possible to have a fn configure() in pin traits, drivers will have to do that some other way In the future, build.rs will generate all the impls instead of macrotables. Pin/Dma traits are no longer explicitly sealed, since gpio::Pin and dma::Channel are already sealed, which has the same effect. This means the `af_num()` and `request()` funcs are now public, but IMO that's okay, they're unlikely to change. Co-authored-by: Dario Nieuwenhuis <[email protected]>
Diffstat (limited to 'examples/stm32f7')
-rw-r--r--examples/stm32f7/src/bin/eth.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/stm32f7/src/bin/eth.rs b/examples/stm32f7/src/bin/eth.rs
index 521b031e3..15169d2dc 100644
--- a/examples/stm32f7/src/bin/eth.rs
+++ b/examples/stm32f7/src/bin/eth.rs
@@ -4,6 +4,7 @@
4 4
5#[path = "../example_common.rs"] 5#[path = "../example_common.rs"]
6mod example_common; 6mod example_common;
7use embassy_stm32::peripherals::ETH;
7use example_common::config; 8use example_common::config;
8 9
9use cortex_m_rt::entry; 10use cortex_m_rt::entry;
@@ -27,7 +28,7 @@ use peripherals::RNG;
27 28
28#[embassy::task] 29#[embassy::task]
29async fn main_task( 30async fn main_task(
30 device: &'static mut Ethernet<'static, LAN8742A, 4, 4>, 31 device: &'static mut Ethernet<'static, ETH, LAN8742A, 4, 4>,
31 config: &'static mut StaticConfigurator, 32 config: &'static mut StaticConfigurator,
32 spawner: Spawner, 33 spawner: Spawner,
33) { 34) {
@@ -82,8 +83,8 @@ fn _embassy_rand(buf: &mut [u8]) {
82static mut RNG_INST: Option<Rng<RNG>> = None; 83static mut RNG_INST: Option<Rng<RNG>> = None;
83 84
84static EXECUTOR: Forever<Executor> = Forever::new(); 85static EXECUTOR: Forever<Executor> = Forever::new();
85static STATE: Forever<State<'static, 4, 4>> = Forever::new(); 86static STATE: Forever<State<'static, ETH, 4, 4>> = Forever::new();
86static ETH: Forever<Ethernet<'static, LAN8742A, 4, 4>> = Forever::new(); 87static ETH: Forever<Ethernet<'static, ETH, LAN8742A, 4, 4>> = Forever::new();
87static CONFIG: Forever<StaticConfigurator> = Forever::new(); 88static CONFIG: Forever<StaticConfigurator> = Forever::new();
88static NET_RESOURCES: Forever<StackResources<1, 2, 8>> = Forever::new(); 89static NET_RESOURCES: Forever<StackResources<1, 2, 8>> = Forever::new();
89 90