diff options
| author | goueslati <[email protected]> | 2023-06-12 14:27:53 +0100 |
|---|---|---|
| committer | goueslati <[email protected]> | 2023-06-12 14:27:53 +0100 |
| commit | 2d89cfb18f00aefbfa108728dfea3398e80ea3e4 (patch) | |
| tree | 6485dacac7e61c4378ac522e709edb0a86bd7523 /examples | |
| parent | 2dd5ce83ec0421564e85b667f5dabd592f313e5c (diff) | |
| parent | ab86b060500ceda1c80e39f35af69cb08a7b63a2 (diff) | |
fix merge conflict
Diffstat (limited to 'examples')
49 files changed, 228 insertions, 110 deletions
diff --git a/examples/nrf52840-rtic/.cargo/config.toml b/examples/nrf52840-rtic/.cargo/config.toml new file mode 100644 index 000000000..3872e7189 --- /dev/null +++ b/examples/nrf52840-rtic/.cargo/config.toml | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | [target.'cfg(all(target_arch = "arm", target_os = "none"))'] | ||
| 2 | # replace nRF82840_xxAA with your chip as listed in `probe-rs-cli chip list` | ||
| 3 | runner = "probe-rs-cli run --chip nRF52840_xxAA" | ||
| 4 | |||
| 5 | [build] | ||
| 6 | target = "thumbv7em-none-eabi" | ||
| 7 | |||
| 8 | [env] | ||
| 9 | DEFMT_LOG = "trace" | ||
diff --git a/examples/nrf52840-rtic/Cargo.toml b/examples/nrf52840-rtic/Cargo.toml new file mode 100644 index 000000000..0f9048b0f --- /dev/null +++ b/examples/nrf52840-rtic/Cargo.toml | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | [package] | ||
| 2 | edition = "2021" | ||
| 3 | name = "embassy-nrf52840-rtic-examples" | ||
| 4 | version = "0.1.0" | ||
| 5 | license = "MIT OR Apache-2.0" | ||
| 6 | |||
| 7 | [dependencies] | ||
| 8 | rtic = { version = "2", features = ["thumbv7-backend"] } | ||
| 9 | |||
| 10 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | ||
| 11 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | ||
| 12 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["nightly", "unstable-traits", "defmt", "defmt-timestamp-uptime", "generic-queue"] } | ||
| 13 | embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["nightly", "unstable-traits", "defmt", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac", "time"] } | ||
| 14 | |||
| 15 | defmt = "0.3" | ||
| 16 | defmt-rtt = "0.4" | ||
| 17 | |||
| 18 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } | ||
| 19 | cortex-m-rt = "0.7.0" | ||
| 20 | panic-probe = { version = "0.3", features = ["print-defmt"] } | ||
| 21 | futures = { version = "0.3.17", default-features = false, features = ["async-await"] } | ||
diff --git a/examples/nrf52840-rtic/build.rs b/examples/nrf52840-rtic/build.rs new file mode 100644 index 000000000..30691aa97 --- /dev/null +++ b/examples/nrf52840-rtic/build.rs | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | //! This build script copies the `memory.x` file from the crate root into | ||
| 2 | //! a directory where the linker can always find it at build time. | ||
| 3 | //! For many projects this is optional, as the linker always searches the | ||
| 4 | //! project root directory -- wherever `Cargo.toml` is. However, if you | ||
| 5 | //! are using a workspace or have a more complicated build setup, this | ||
| 6 | //! build script becomes required. Additionally, by requesting that | ||
| 7 | //! Cargo re-run the build script whenever `memory.x` is changed, | ||
| 8 | //! updating `memory.x` ensures a rebuild of the application with the | ||
| 9 | //! new memory settings. | ||
| 10 | |||
| 11 | use std::env; | ||
| 12 | use std::fs::File; | ||
| 13 | use std::io::Write; | ||
| 14 | use std::path::PathBuf; | ||
| 15 | |||
| 16 | fn main() { | ||
| 17 | // Put `memory.x` in our output directory and ensure it's | ||
| 18 | // on the linker search path. | ||
| 19 | let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap()); | ||
| 20 | File::create(out.join("memory.x")) | ||
| 21 | .unwrap() | ||
| 22 | .write_all(include_bytes!("memory.x")) | ||
| 23 | .unwrap(); | ||
| 24 | println!("cargo:rustc-link-search={}", out.display()); | ||
| 25 | |||
| 26 | // By default, Cargo will re-run a build script whenever | ||
| 27 | // any file in the project changes. By specifying `memory.x` | ||
| 28 | // here, we ensure the build script is only re-run when | ||
| 29 | // `memory.x` is changed. | ||
| 30 | println!("cargo:rerun-if-changed=memory.x"); | ||
| 31 | |||
| 32 | println!("cargo:rustc-link-arg-bins=--nmagic"); | ||
| 33 | println!("cargo:rustc-link-arg-bins=-Tlink.x"); | ||
| 34 | println!("cargo:rustc-link-arg-bins=-Tdefmt.x"); | ||
| 35 | } | ||
diff --git a/examples/nrf52840-rtic/memory.x b/examples/nrf52840-rtic/memory.x new file mode 100644 index 000000000..9b04edec0 --- /dev/null +++ b/examples/nrf52840-rtic/memory.x | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | MEMORY | ||
| 2 | { | ||
| 3 | /* NOTE 1 K = 1 KiBi = 1024 bytes */ | ||
| 4 | /* These values correspond to the NRF52840 with Softdevices S140 7.0.1 */ | ||
| 5 | FLASH : ORIGIN = 0x00000000, LENGTH = 1024K | ||
| 6 | RAM : ORIGIN = 0x20000000, LENGTH = 256K | ||
| 7 | } | ||
diff --git a/examples/nrf52840-rtic/src/bin/blinky.rs b/examples/nrf52840-rtic/src/bin/blinky.rs new file mode 100644 index 000000000..a682c1932 --- /dev/null +++ b/examples/nrf52840-rtic/src/bin/blinky.rs | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | #![no_std] | ||
| 2 | #![no_main] | ||
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | |||
| 5 | use {defmt_rtt as _, panic_probe as _}; | ||
| 6 | |||
| 7 | #[rtic::app(device = embassy_nrf, peripherals = false, dispatchers = [SWI0_EGU0, SWI1_EGU1])] | ||
| 8 | mod app { | ||
| 9 | use defmt::info; | ||
| 10 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; | ||
| 11 | use embassy_nrf::peripherals; | ||
| 12 | use embassy_time::{Duration, Timer}; | ||
| 13 | |||
| 14 | #[shared] | ||
| 15 | struct Shared {} | ||
| 16 | |||
| 17 | #[local] | ||
| 18 | struct Local {} | ||
| 19 | |||
| 20 | #[init] | ||
| 21 | fn init(_: init::Context) -> (Shared, Local) { | ||
| 22 | info!("Hello World!"); | ||
| 23 | |||
| 24 | let p = embassy_nrf::init(Default::default()); | ||
| 25 | blink::spawn(p.P0_13).map_err(|_| ()).unwrap(); | ||
| 26 | |||
| 27 | (Shared {}, Local {}) | ||
| 28 | } | ||
| 29 | |||
| 30 | #[task(priority = 1)] | ||
| 31 | async fn blink(_cx: blink::Context, pin: peripherals::P0_13) { | ||
| 32 | let mut led = Output::new(pin, Level::Low, OutputDrive::Standard); | ||
| 33 | |||
| 34 | loop { | ||
| 35 | info!("off!"); | ||
| 36 | led.set_high(); | ||
| 37 | Timer::after(Duration::from_millis(300)).await; | ||
| 38 | info!("on!"); | ||
| 39 | led.set_low(); | ||
| 40 | Timer::after(Duration::from_millis(300)).await; | ||
| 41 | } | ||
| 42 | } | ||
| 43 | } | ||
diff --git a/examples/nrf52840/src/bin/multiprio.rs b/examples/nrf52840/src/bin/multiprio.rs index 851e189ea..aab819117 100644 --- a/examples/nrf52840/src/bin/multiprio.rs +++ b/examples/nrf52840/src/bin/multiprio.rs | |||
| @@ -57,14 +57,11 @@ | |||
| 57 | #![no_main] | 57 | #![no_main] |
| 58 | #![feature(type_alias_impl_trait)] | 58 | #![feature(type_alias_impl_trait)] |
| 59 | 59 | ||
| 60 | use core::mem; | ||
| 61 | |||
| 62 | use cortex_m::peripheral::NVIC; | ||
| 63 | use cortex_m_rt::entry; | 60 | use cortex_m_rt::entry; |
| 64 | use defmt::{info, unwrap}; | 61 | use defmt::{info, unwrap}; |
| 65 | use embassy_nrf::executor::{Executor, InterruptExecutor}; | 62 | use embassy_executor::{Executor, InterruptExecutor}; |
| 66 | use embassy_nrf::interrupt; | 63 | use embassy_nrf::interrupt; |
| 67 | use embassy_nrf::pac::Interrupt; | 64 | use embassy_nrf::interrupt::{InterruptExt, Priority}; |
| 68 | use embassy_time::{Duration, Instant, Timer}; | 65 | use embassy_time::{Duration, Instant, Timer}; |
| 69 | use static_cell::StaticCell; | 66 | use static_cell::StaticCell; |
| 70 | use {defmt_rtt as _, panic_probe as _}; | 67 | use {defmt_rtt as _, panic_probe as _}; |
| @@ -130,16 +127,15 @@ fn main() -> ! { | |||
| 130 | info!("Hello World!"); | 127 | info!("Hello World!"); |
| 131 | 128 | ||
| 132 | let _p = embassy_nrf::init(Default::default()); | 129 | let _p = embassy_nrf::init(Default::default()); |
| 133 | let mut nvic: NVIC = unsafe { mem::transmute(()) }; | ||
| 134 | 130 | ||
| 135 | // High-priority executor: SWI1_EGU1, priority level 6 | 131 | // High-priority executor: SWI1_EGU1, priority level 6 |
| 136 | unsafe { nvic.set_priority(Interrupt::SWI1_EGU1, 6 << 5) }; | 132 | interrupt::SWI1_EGU1.set_priority(Priority::P6); |
| 137 | let spawner = EXECUTOR_HIGH.start(Interrupt::SWI1_EGU1); | 133 | let spawner = EXECUTOR_HIGH.start(interrupt::SWI1_EGU1); |
| 138 | unwrap!(spawner.spawn(run_high())); | 134 | unwrap!(spawner.spawn(run_high())); |
| 139 | 135 | ||
| 140 | // Medium-priority executor: SWI0_EGU0, priority level 7 | 136 | // Medium-priority executor: SWI0_EGU0, priority level 7 |
| 141 | unsafe { nvic.set_priority(Interrupt::SWI0_EGU0, 7 << 5) }; | 137 | interrupt::SWI0_EGU0.set_priority(Priority::P7); |
| 142 | let spawner = EXECUTOR_MED.start(Interrupt::SWI0_EGU0); | 138 | let spawner = EXECUTOR_MED.start(interrupt::SWI0_EGU0); |
| 143 | unwrap!(spawner.spawn(run_med())); | 139 | unwrap!(spawner.spawn(run_med())); |
| 144 | 140 | ||
| 145 | // Low priority executor: runs in thread mode, using WFE/SEV | 141 | // Low priority executor: runs in thread mode, using WFE/SEV |
diff --git a/examples/nrf52840/src/bin/usb_ethernet.rs b/examples/nrf52840/src/bin/usb_ethernet.rs index 1065f5b5d..f527c0d7f 100644 --- a/examples/nrf52840/src/bin/usb_ethernet.rs +++ b/examples/nrf52840/src/bin/usb_ethernet.rs | |||
| @@ -97,12 +97,12 @@ async fn main(spawner: Spawner) { | |||
| 97 | let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(make_static!(NetState::new()), our_mac_addr); | 97 | let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(make_static!(NetState::new()), our_mac_addr); |
| 98 | unwrap!(spawner.spawn(usb_ncm_task(runner))); | 98 | unwrap!(spawner.spawn(usb_ncm_task(runner))); |
| 99 | 99 | ||
| 100 | let config = embassy_net::Config::Dhcp(Default::default()); | 100 | let config = embassy_net::Config::dhcpv4(Default::default()); |
| 101 | //let config = embassy_net::Config::Static(embassy_net::StaticConfig { | 101 | // let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 { |
| 102 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), | 102 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), |
| 103 | // dns_servers: Vec::new(), | 103 | // dns_servers: Vec::new(), |
| 104 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), | 104 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), |
| 105 | //}); | 105 | // }); |
| 106 | 106 | ||
| 107 | // Generate random seed | 107 | // Generate random seed |
| 108 | let mut rng = Rng::new(p.RNG, Irqs); | 108 | let mut rng = Rng::new(p.RNG, Irqs); |
diff --git a/examples/rp/Cargo.toml b/examples/rp/Cargo.toml index e946b481d..48f3a26bb 100644 --- a/examples/rp/Cargo.toml +++ b/examples/rp/Cargo.toml | |||
| @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" | |||
| 8 | [dependencies] | 8 | [dependencies] |
| 9 | embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal", features = ["defmt"] } | 9 | embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal", features = ["defmt"] } |
| 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["nightly", "unstable-traits", "defmt", "defmt-timestamp-uptime"] } | 12 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["nightly", "unstable-traits", "defmt", "defmt-timestamp-uptime"] } |
| 13 | embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-traits", "nightly", "unstable-pac", "time-driver", "critical-section-impl"] } | 13 | embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-traits", "nightly", "unstable-pac", "time-driver", "critical-section-impl"] } |
| 14 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 14 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
diff --git a/examples/rp/src/bin/ethernet_w5500_multisocket.rs b/examples/rp/src/bin/ethernet_w5500_multisocket.rs index 63e142e7d..82568254a 100644 --- a/examples/rp/src/bin/ethernet_w5500_multisocket.rs +++ b/examples/rp/src/bin/ethernet_w5500_multisocket.rs | |||
| @@ -64,7 +64,7 @@ async fn main(spawner: Spawner) { | |||
| 64 | // Init network stack | 64 | // Init network stack |
| 65 | let stack = &*make_static!(Stack::new( | 65 | let stack = &*make_static!(Stack::new( |
| 66 | device, | 66 | device, |
| 67 | embassy_net::Config::Dhcp(Default::default()), | 67 | embassy_net::Config::dhcpv4(Default::default()), |
| 68 | make_static!(StackResources::<3>::new()), | 68 | make_static!(StackResources::<3>::new()), |
| 69 | seed | 69 | seed |
| 70 | )); | 70 | )); |
| @@ -120,9 +120,9 @@ async fn listen_task(stack: &'static Stack<Device<'static>>, id: u8, port: u16) | |||
| 120 | } | 120 | } |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | async fn wait_for_config(stack: &'static Stack<Device<'static>>) -> embassy_net::StaticConfig { | 123 | async fn wait_for_config(stack: &'static Stack<Device<'static>>) -> embassy_net::StaticConfigV4 { |
| 124 | loop { | 124 | loop { |
| 125 | if let Some(config) = stack.config() { | 125 | if let Some(config) = stack.config_v4() { |
| 126 | return config.clone(); | 126 | return config.clone(); |
| 127 | } | 127 | } |
| 128 | yield_now().await; | 128 | yield_now().await; |
diff --git a/examples/rp/src/bin/ethernet_w5500_tcp_client.rs b/examples/rp/src/bin/ethernet_w5500_tcp_client.rs index a532de00d..d562defad 100644 --- a/examples/rp/src/bin/ethernet_w5500_tcp_client.rs +++ b/examples/rp/src/bin/ethernet_w5500_tcp_client.rs | |||
| @@ -67,7 +67,7 @@ async fn main(spawner: Spawner) { | |||
| 67 | // Init network stack | 67 | // Init network stack |
| 68 | let stack = &*make_static!(Stack::new( | 68 | let stack = &*make_static!(Stack::new( |
| 69 | device, | 69 | device, |
| 70 | embassy_net::Config::Dhcp(Default::default()), | 70 | embassy_net::Config::dhcpv4(Default::default()), |
| 71 | make_static!(StackResources::<2>::new()), | 71 | make_static!(StackResources::<2>::new()), |
| 72 | seed | 72 | seed |
| 73 | )); | 73 | )); |
| @@ -108,9 +108,9 @@ async fn main(spawner: Spawner) { | |||
| 108 | } | 108 | } |
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | async fn wait_for_config(stack: &'static Stack<Device<'static>>) -> embassy_net::StaticConfig { | 111 | async fn wait_for_config(stack: &'static Stack<Device<'static>>) -> embassy_net::StaticConfigV4 { |
| 112 | loop { | 112 | loop { |
| 113 | if let Some(config) = stack.config() { | 113 | if let Some(config) = stack.config_v4() { |
| 114 | return config.clone(); | 114 | return config.clone(); |
| 115 | } | 115 | } |
| 116 | yield_now().await; | 116 | yield_now().await; |
diff --git a/examples/rp/src/bin/ethernet_w5500_tcp_server.rs b/examples/rp/src/bin/ethernet_w5500_tcp_server.rs index 599f6b1e9..7f521cdb4 100644 --- a/examples/rp/src/bin/ethernet_w5500_tcp_server.rs +++ b/examples/rp/src/bin/ethernet_w5500_tcp_server.rs | |||
| @@ -65,7 +65,7 @@ async fn main(spawner: Spawner) { | |||
| 65 | // Init network stack | 65 | // Init network stack |
| 66 | let stack = &*make_static!(Stack::new( | 66 | let stack = &*make_static!(Stack::new( |
| 67 | device, | 67 | device, |
| 68 | embassy_net::Config::Dhcp(Default::default()), | 68 | embassy_net::Config::dhcpv4(Default::default()), |
| 69 | make_static!(StackResources::<2>::new()), | 69 | make_static!(StackResources::<2>::new()), |
| 70 | seed | 70 | seed |
| 71 | )); | 71 | )); |
| @@ -116,9 +116,9 @@ async fn main(spawner: Spawner) { | |||
| 116 | } | 116 | } |
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | async fn wait_for_config(stack: &'static Stack<Device<'static>>) -> embassy_net::StaticConfig { | 119 | async fn wait_for_config(stack: &'static Stack<Device<'static>>) -> embassy_net::StaticConfigV4 { |
| 120 | loop { | 120 | loop { |
| 121 | if let Some(config) = stack.config() { | 121 | if let Some(config) = stack.config_v4() { |
| 122 | return config.clone(); | 122 | return config.clone(); |
| 123 | } | 123 | } |
| 124 | yield_now().await; | 124 | yield_now().await; |
diff --git a/examples/rp/src/bin/ethernet_w5500_udp.rs b/examples/rp/src/bin/ethernet_w5500_udp.rs index ac5a65bb6..ada86ae55 100644 --- a/examples/rp/src/bin/ethernet_w5500_udp.rs +++ b/examples/rp/src/bin/ethernet_w5500_udp.rs | |||
| @@ -62,7 +62,7 @@ async fn main(spawner: Spawner) { | |||
| 62 | // Init network stack | 62 | // Init network stack |
| 63 | let stack = &*make_static!(Stack::new( | 63 | let stack = &*make_static!(Stack::new( |
| 64 | device, | 64 | device, |
| 65 | embassy_net::Config::Dhcp(Default::default()), | 65 | embassy_net::Config::dhcpv4(Default::default()), |
| 66 | make_static!(StackResources::<2>::new()), | 66 | make_static!(StackResources::<2>::new()), |
| 67 | seed | 67 | seed |
| 68 | )); | 68 | )); |
| @@ -95,9 +95,9 @@ async fn main(spawner: Spawner) { | |||
| 95 | } | 95 | } |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | async fn wait_for_config(stack: &'static Stack<Device<'static>>) -> embassy_net::StaticConfig { | 98 | async fn wait_for_config(stack: &'static Stack<Device<'static>>) -> embassy_net::StaticConfigV4 { |
| 99 | loop { | 99 | loop { |
| 100 | if let Some(config) = stack.config() { | 100 | if let Some(config) = stack.config_v4() { |
| 101 | return config.clone(); | 101 | return config.clone(); |
| 102 | } | 102 | } |
| 103 | yield_now().await; | 103 | yield_now().await; |
diff --git a/examples/rp/src/bin/multiprio.rs b/examples/rp/src/bin/multiprio.rs index 2f79ba49e..9ace4cd68 100644 --- a/examples/rp/src/bin/multiprio.rs +++ b/examples/rp/src/bin/multiprio.rs | |||
| @@ -57,14 +57,11 @@ | |||
| 57 | #![no_main] | 57 | #![no_main] |
| 58 | #![feature(type_alias_impl_trait)] | 58 | #![feature(type_alias_impl_trait)] |
| 59 | 59 | ||
| 60 | use core::mem; | ||
| 61 | |||
| 62 | use cortex_m::peripheral::NVIC; | ||
| 63 | use cortex_m_rt::entry; | 60 | use cortex_m_rt::entry; |
| 64 | use defmt::{info, unwrap}; | 61 | use defmt::{info, unwrap}; |
| 65 | use embassy_rp::executor::{Executor, InterruptExecutor}; | 62 | use embassy_executor::{Executor, InterruptExecutor}; |
| 66 | use embassy_rp::interrupt; | 63 | use embassy_rp::interrupt; |
| 67 | use embassy_rp::pac::Interrupt; | 64 | use embassy_rp::interrupt::{InterruptExt, Priority}; |
| 68 | use embassy_time::{Duration, Instant, Timer, TICK_HZ}; | 65 | use embassy_time::{Duration, Instant, Timer, TICK_HZ}; |
| 69 | use static_cell::StaticCell; | 66 | use static_cell::StaticCell; |
| 70 | use {defmt_rtt as _, panic_probe as _}; | 67 | use {defmt_rtt as _, panic_probe as _}; |
| @@ -130,18 +127,15 @@ fn main() -> ! { | |||
| 130 | info!("Hello World!"); | 127 | info!("Hello World!"); |
| 131 | 128 | ||
| 132 | let _p = embassy_rp::init(Default::default()); | 129 | let _p = embassy_rp::init(Default::default()); |
| 133 | let mut nvic: NVIC = unsafe { mem::transmute(()) }; | ||
| 134 | 130 | ||
| 135 | // High-priority executor: SWI_IRQ_1, priority level 2 | 131 | // High-priority executor: SWI_IRQ_1, priority level 2 |
| 136 | unsafe { nvic.set_priority(Interrupt::SWI_IRQ_1, 2 << 6) }; | 132 | interrupt::SWI_IRQ_1.set_priority(Priority::P2); |
| 137 | info!("bla: {}", NVIC::get_priority(Interrupt::SWI_IRQ_1)); | 133 | let spawner = EXECUTOR_HIGH.start(interrupt::SWI_IRQ_1); |
| 138 | let spawner = EXECUTOR_HIGH.start(Interrupt::SWI_IRQ_1); | ||
| 139 | unwrap!(spawner.spawn(run_high())); | 134 | unwrap!(spawner.spawn(run_high())); |
| 140 | 135 | ||
| 141 | // Medium-priority executor: SWI_IRQ_0, priority level 3 | 136 | // Medium-priority executor: SWI_IRQ_0, priority level 3 |
| 142 | unsafe { nvic.set_priority(Interrupt::SWI_IRQ_0, 3 << 6) }; | 137 | interrupt::SWI_IRQ_0.set_priority(Priority::P3); |
| 143 | info!("bla: {}", NVIC::get_priority(Interrupt::SWI_IRQ_0)); | 138 | let spawner = EXECUTOR_MED.start(interrupt::SWI_IRQ_0); |
| 144 | let spawner = EXECUTOR_MED.start(Interrupt::SWI_IRQ_0); | ||
| 145 | unwrap!(spawner.spawn(run_med())); | 139 | unwrap!(spawner.spawn(run_med())); |
| 146 | 140 | ||
| 147 | // Low priority executor: runs in thread mode, using WFE/SEV | 141 | // Low priority executor: runs in thread mode, using WFE/SEV |
diff --git a/examples/rp/src/bin/usb_ethernet.rs b/examples/rp/src/bin/usb_ethernet.rs index 16fbf5e91..91d1ec8e7 100644 --- a/examples/rp/src/bin/usb_ethernet.rs +++ b/examples/rp/src/bin/usb_ethernet.rs | |||
| @@ -86,8 +86,8 @@ async fn main(spawner: Spawner) { | |||
| 86 | let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(make_static!(NetState::new()), our_mac_addr); | 86 | let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(make_static!(NetState::new()), our_mac_addr); |
| 87 | unwrap!(spawner.spawn(usb_ncm_task(runner))); | 87 | unwrap!(spawner.spawn(usb_ncm_task(runner))); |
| 88 | 88 | ||
| 89 | let config = embassy_net::Config::Dhcp(Default::default()); | 89 | let config = embassy_net::Config::dhcpv4(Default::default()); |
| 90 | //let config = embassy_net::Config::Static(embassy_net::StaticConfig { | 90 | //let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 { |
| 91 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), | 91 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), |
| 92 | // dns_servers: Vec::new(), | 92 | // dns_servers: Vec::new(), |
| 93 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), | 93 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), |
diff --git a/examples/rp/src/bin/wifi_ap_tcp_server.rs b/examples/rp/src/bin/wifi_ap_tcp_server.rs index b27d3c9f8..e8197390c 100644 --- a/examples/rp/src/bin/wifi_ap_tcp_server.rs +++ b/examples/rp/src/bin/wifi_ap_tcp_server.rs | |||
| @@ -62,7 +62,7 @@ async fn main(spawner: Spawner) { | |||
| 62 | .await; | 62 | .await; |
| 63 | 63 | ||
| 64 | // Use a link-local address for communication without DHCP server | 64 | // Use a link-local address for communication without DHCP server |
| 65 | let config = Config::Static(embassy_net::StaticConfig { | 65 | let config = Config::ipv4_static(embassy_net::StaticConfigV4 { |
| 66 | address: embassy_net::Ipv4Cidr::new(embassy_net::Ipv4Address::new(169, 254, 1, 1), 16), | 66 | address: embassy_net::Ipv4Cidr::new(embassy_net::Ipv4Address::new(169, 254, 1, 1), 16), |
| 67 | dns_servers: heapless::Vec::new(), | 67 | dns_servers: heapless::Vec::new(), |
| 68 | gateway: None, | 68 | gateway: None, |
diff --git a/examples/rp/src/bin/wifi_tcp_server.rs b/examples/rp/src/bin/wifi_tcp_server.rs index 1a00bca96..026e056fa 100644 --- a/examples/rp/src/bin/wifi_tcp_server.rs +++ b/examples/rp/src/bin/wifi_tcp_server.rs | |||
| @@ -61,8 +61,8 @@ async fn main(spawner: Spawner) { | |||
| 61 | .set_power_management(cyw43::PowerManagementMode::PowerSave) | 61 | .set_power_management(cyw43::PowerManagementMode::PowerSave) |
| 62 | .await; | 62 | .await; |
| 63 | 63 | ||
| 64 | let config = Config::Dhcp(Default::default()); | 64 | let config = Config::dhcpv4(Default::default()); |
| 65 | //let config = embassy_net::Config::Static(embassy_net::Config { | 65 | //let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 { |
| 66 | // address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24), | 66 | // address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24), |
| 67 | // dns_servers: Vec::new(), | 67 | // dns_servers: Vec::new(), |
| 68 | // gateway: Some(Ipv4Address::new(192, 168, 69, 1)), | 68 | // gateway: Some(Ipv4Address::new(192, 168, 69, 1)), |
diff --git a/examples/std/src/bin/net.rs b/examples/std/src/bin/net.rs index b42bfc13b..3aadb029d 100644 --- a/examples/std/src/bin/net.rs +++ b/examples/std/src/bin/net.rs | |||
| @@ -42,13 +42,13 @@ async fn main_task(spawner: Spawner) { | |||
| 42 | 42 | ||
| 43 | // Choose between dhcp or static ip | 43 | // Choose between dhcp or static ip |
| 44 | let config = if opts.static_ip { | 44 | let config = if opts.static_ip { |
| 45 | Config::Static(embassy_net::StaticConfig { | 45 | Config::ipv4_static(embassy_net::StaticConfigV4 { |
| 46 | address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24), | 46 | address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24), |
| 47 | dns_servers: Vec::new(), | 47 | dns_servers: Vec::new(), |
| 48 | gateway: Some(Ipv4Address::new(192, 168, 69, 1)), | 48 | gateway: Some(Ipv4Address::new(192, 168, 69, 1)), |
| 49 | }) | 49 | }) |
| 50 | } else { | 50 | } else { |
| 51 | Config::Dhcp(Default::default()) | 51 | Config::dhcpv4(Default::default()) |
| 52 | }; | 52 | }; |
| 53 | 53 | ||
| 54 | // Generate random seed | 54 | // Generate random seed |
diff --git a/examples/std/src/bin/net_dns.rs b/examples/std/src/bin/net_dns.rs index 932ac5831..65b5a2cd9 100644 --- a/examples/std/src/bin/net_dns.rs +++ b/examples/std/src/bin/net_dns.rs | |||
| @@ -40,14 +40,14 @@ async fn main_task(spawner: Spawner) { | |||
| 40 | 40 | ||
| 41 | // Choose between dhcp or static ip | 41 | // Choose between dhcp or static ip |
| 42 | let config = if opts.static_ip { | 42 | let config = if opts.static_ip { |
| 43 | Config::Static(embassy_net::StaticConfig { | 43 | Config::ipv4_static(embassy_net::StaticConfigV4 { |
| 44 | address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 1), 24), | 44 | address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 1), 24), |
| 45 | dns_servers: Vec::from_slice(&[Ipv4Address::new(8, 8, 4, 4).into(), Ipv4Address::new(8, 8, 8, 8).into()]) | 45 | dns_servers: Vec::from_slice(&[Ipv4Address::new(8, 8, 4, 4).into(), Ipv4Address::new(8, 8, 8, 8).into()]) |
| 46 | .unwrap(), | 46 | .unwrap(), |
| 47 | gateway: Some(Ipv4Address::new(192, 168, 69, 100)), | 47 | gateway: Some(Ipv4Address::new(192, 168, 69, 100)), |
| 48 | }) | 48 | }) |
| 49 | } else { | 49 | } else { |
| 50 | Config::Dhcp(Default::default()) | 50 | Config::dhcpv4(Default::default()) |
| 51 | }; | 51 | }; |
| 52 | 52 | ||
| 53 | // Generate random seed | 53 | // Generate random seed |
diff --git a/examples/std/src/bin/net_udp.rs b/examples/std/src/bin/net_udp.rs index d89ec7643..3fc46156c 100644 --- a/examples/std/src/bin/net_udp.rs +++ b/examples/std/src/bin/net_udp.rs | |||
| @@ -38,13 +38,13 @@ async fn main_task(spawner: Spawner) { | |||
| 38 | 38 | ||
| 39 | // Choose between dhcp or static ip | 39 | // Choose between dhcp or static ip |
| 40 | let config = if opts.static_ip { | 40 | let config = if opts.static_ip { |
| 41 | Config::Static(embassy_net::StaticConfig { | 41 | Config::ipv4_static(embassy_net::StaticConfigV4 { |
| 42 | address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24), | 42 | address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24), |
| 43 | dns_servers: Vec::new(), | 43 | dns_servers: Vec::new(), |
| 44 | gateway: Some(Ipv4Address::new(192, 168, 69, 1)), | 44 | gateway: Some(Ipv4Address::new(192, 168, 69, 1)), |
| 45 | }) | 45 | }) |
| 46 | } else { | 46 | } else { |
| 47 | Config::Dhcp(Default::default()) | 47 | Config::dhcpv4(Default::default()) |
| 48 | }; | 48 | }; |
| 49 | 49 | ||
| 50 | // Generate random seed | 50 | // Generate random seed |
diff --git a/examples/std/src/bin/tcp_accept.rs b/examples/std/src/bin/tcp_accept.rs index 01695baea..df09986ac 100644 --- a/examples/std/src/bin/tcp_accept.rs +++ b/examples/std/src/bin/tcp_accept.rs | |||
| @@ -53,13 +53,13 @@ async fn main_task(spawner: Spawner) { | |||
| 53 | 53 | ||
| 54 | // Choose between dhcp or static ip | 54 | // Choose between dhcp or static ip |
| 55 | let config = if opts.static_ip { | 55 | let config = if opts.static_ip { |
| 56 | Config::Static(embassy_net::StaticConfig { | 56 | Config::ipv4_static(embassy_net::StaticConfigV4 { |
| 57 | address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24), | 57 | address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24), |
| 58 | dns_servers: Vec::new(), | 58 | dns_servers: Vec::new(), |
| 59 | gateway: Some(Ipv4Address::new(192, 168, 69, 1)), | 59 | gateway: Some(Ipv4Address::new(192, 168, 69, 1)), |
| 60 | }) | 60 | }) |
| 61 | } else { | 61 | } else { |
| 62 | Config::Dhcp(Default::default()) | 62 | Config::dhcpv4(Default::default()) |
| 63 | }; | 63 | }; |
| 64 | 64 | ||
| 65 | // Generate random seed | 65 | // Generate random seed |
diff --git a/examples/stm32c0/Cargo.toml b/examples/stm32c0/Cargo.toml index ad11fbd1c..43f432520 100644 --- a/examples/stm32c0/Cargo.toml +++ b/examples/stm32c0/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32c031c6", "memory-x", "unstable-pac", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32c031c6", "memory-x", "unstable-pac", "exti"] } |
| 12 | 12 | ||
diff --git a/examples/stm32f0/Cargo.toml b/examples/stm32f0/Cargo.toml index ff134bb0e..8d2248ed0 100644 --- a/examples/stm32f0/Cargo.toml +++ b/examples/stm32f0/Cargo.toml | |||
| @@ -13,7 +13,7 @@ defmt = "0.3" | |||
| 13 | defmt-rtt = "0.4" | 13 | defmt-rtt = "0.4" |
| 14 | panic-probe = "0.3" | 14 | panic-probe = "0.3" |
| 15 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 15 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 16 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } | 16 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } |
| 17 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 17 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 18 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "memory-x", "stm32f091rc", "time-driver-any", "exti", "unstable-pac"] } | 18 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "memory-x", "stm32f091rc", "time-driver-any", "exti", "unstable-pac"] } |
| 19 | static_cell = { version = "1.1", features = ["nightly"]} | 19 | static_cell = { version = "1.1", features = ["nightly"]} |
diff --git a/examples/stm32f0/src/bin/multiprio.rs b/examples/stm32f0/src/bin/multiprio.rs index 430a805fc..988ffeef1 100644 --- a/examples/stm32f0/src/bin/multiprio.rs +++ b/examples/stm32f0/src/bin/multiprio.rs | |||
| @@ -57,14 +57,11 @@ | |||
| 57 | #![no_main] | 57 | #![no_main] |
| 58 | #![feature(type_alias_impl_trait)] | 58 | #![feature(type_alias_impl_trait)] |
| 59 | 59 | ||
| 60 | use core::mem; | ||
| 61 | |||
| 62 | use cortex_m::peripheral::NVIC; | ||
| 63 | use cortex_m_rt::entry; | 60 | use cortex_m_rt::entry; |
| 64 | use defmt::*; | 61 | use defmt::*; |
| 65 | use embassy_executor::{Executor, InterruptExecutor}; | 62 | use embassy_executor::{Executor, InterruptExecutor}; |
| 66 | use embassy_stm32::interrupt; | 63 | use embassy_stm32::interrupt; |
| 67 | use embassy_stm32::pac::Interrupt; | 64 | use embassy_stm32::interrupt::{InterruptExt, Priority}; |
| 68 | use embassy_time::{Duration, Instant, Timer}; | 65 | use embassy_time::{Duration, Instant, Timer}; |
| 69 | use static_cell::StaticCell; | 66 | use static_cell::StaticCell; |
| 70 | use {defmt_rtt as _, panic_probe as _}; | 67 | use {defmt_rtt as _, panic_probe as _}; |
| @@ -129,16 +126,15 @@ unsafe fn USART2() { | |||
| 129 | fn main() -> ! { | 126 | fn main() -> ! { |
| 130 | // Initialize and create handle for devicer peripherals | 127 | // Initialize and create handle for devicer peripherals |
| 131 | let _p = embassy_stm32::init(Default::default()); | 128 | let _p = embassy_stm32::init(Default::default()); |
| 132 | let mut nvic: NVIC = unsafe { mem::transmute(()) }; | ||
| 133 | 129 | ||
| 134 | // High-priority executor: USART1, priority level 6 | 130 | // High-priority executor: USART1, priority level 6 |
| 135 | unsafe { nvic.set_priority(Interrupt::USART1, 6 << 4) }; | 131 | interrupt::USART1.set_priority(Priority::P6); |
| 136 | let spawner = EXECUTOR_HIGH.start(Interrupt::USART1); | 132 | let spawner = EXECUTOR_HIGH.start(interrupt::USART1); |
| 137 | unwrap!(spawner.spawn(run_high())); | 133 | unwrap!(spawner.spawn(run_high())); |
| 138 | 134 | ||
| 139 | // Medium-priority executor: USART2, priority level 7 | 135 | // Medium-priority executor: USART2, priority level 7 |
| 140 | unsafe { nvic.set_priority(Interrupt::USART2, 7 << 4) }; | 136 | interrupt::USART2.set_priority(Priority::P7); |
| 141 | let spawner = EXECUTOR_MED.start(Interrupt::USART2); | 137 | let spawner = EXECUTOR_MED.start(interrupt::USART2); |
| 142 | unwrap!(spawner.spawn(run_med())); | 138 | unwrap!(spawner.spawn(run_med())); |
| 143 | 139 | ||
| 144 | // Low priority executor: runs in thread mode, using WFE/SEV | 140 | // Low priority executor: runs in thread mode, using WFE/SEV |
diff --git a/examples/stm32f1/Cargo.toml b/examples/stm32f1/Cargo.toml index 345e948a6..d34fd439a 100644 --- a/examples/stm32f1/Cargo.toml +++ b/examples/stm32f1/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f103c8", "unstable-pac", "memory-x", "time-driver-any", "unstable-traits" ] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f103c8", "unstable-pac", "memory-x", "time-driver-any", "unstable-traits" ] } |
| 12 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 12 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
diff --git a/examples/stm32f2/Cargo.toml b/examples/stm32f2/Cargo.toml index e4f97a589..5e3e0d0f7 100644 --- a/examples/stm32f2/Cargo.toml +++ b/examples/stm32f2/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f207zg", "unstable-pac", "memory-x", "time-driver-any", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f207zg", "unstable-pac", "memory-x", "time-driver-any", "exti"] } |
| 12 | 12 | ||
diff --git a/examples/stm32f3/Cargo.toml b/examples/stm32f3/Cargo.toml index 0fe9cb122..29ab2009c 100644 --- a/examples/stm32f3/Cargo.toml +++ b/examples/stm32f3/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } | 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f303ze", "unstable-pac", "memory-x", "time-driver-any", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f303ze", "unstable-pac", "memory-x", "time-driver-any", "exti"] } |
| 12 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 12 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
diff --git a/examples/stm32f3/src/bin/multiprio.rs b/examples/stm32f3/src/bin/multiprio.rs index 5d010f799..80bf59deb 100644 --- a/examples/stm32f3/src/bin/multiprio.rs +++ b/examples/stm32f3/src/bin/multiprio.rs | |||
| @@ -57,14 +57,11 @@ | |||
| 57 | #![no_main] | 57 | #![no_main] |
| 58 | #![feature(type_alias_impl_trait)] | 58 | #![feature(type_alias_impl_trait)] |
| 59 | 59 | ||
| 60 | use core::mem; | ||
| 61 | |||
| 62 | use cortex_m::peripheral::NVIC; | ||
| 63 | use cortex_m_rt::entry; | 60 | use cortex_m_rt::entry; |
| 64 | use defmt::*; | 61 | use defmt::*; |
| 65 | use embassy_executor::{Executor, InterruptExecutor}; | 62 | use embassy_executor::{Executor, InterruptExecutor}; |
| 66 | use embassy_stm32::interrupt; | 63 | use embassy_stm32::interrupt; |
| 67 | use embassy_stm32::pac::Interrupt; | 64 | use embassy_stm32::interrupt::{InterruptExt, Priority}; |
| 68 | use embassy_time::{Duration, Instant, Timer}; | 65 | use embassy_time::{Duration, Instant, Timer}; |
| 69 | use static_cell::StaticCell; | 66 | use static_cell::StaticCell; |
| 70 | use {defmt_rtt as _, panic_probe as _}; | 67 | use {defmt_rtt as _, panic_probe as _}; |
| @@ -130,16 +127,15 @@ fn main() -> ! { | |||
| 130 | info!("Hello World!"); | 127 | info!("Hello World!"); |
| 131 | 128 | ||
| 132 | let _p = embassy_stm32::init(Default::default()); | 129 | let _p = embassy_stm32::init(Default::default()); |
| 133 | let mut nvic: NVIC = unsafe { mem::transmute(()) }; | ||
| 134 | 130 | ||
| 135 | // High-priority executor: UART4, priority level 6 | 131 | // High-priority executor: UART4, priority level 6 |
| 136 | unsafe { nvic.set_priority(Interrupt::UART4, 6 << 4) }; | 132 | interrupt::UART4.set_priority(Priority::P6); |
| 137 | let spawner = EXECUTOR_HIGH.start(Interrupt::UART4); | 133 | let spawner = EXECUTOR_HIGH.start(interrupt::UART4); |
| 138 | unwrap!(spawner.spawn(run_high())); | 134 | unwrap!(spawner.spawn(run_high())); |
| 139 | 135 | ||
| 140 | // Medium-priority executor: UART5, priority level 7 | 136 | // Medium-priority executor: UART5, priority level 7 |
| 141 | unsafe { nvic.set_priority(Interrupt::UART5, 7 << 4) }; | 137 | interrupt::UART5.set_priority(Priority::P7); |
| 142 | let spawner = EXECUTOR_MED.start(Interrupt::UART5); | 138 | let spawner = EXECUTOR_MED.start(interrupt::UART5); |
| 143 | unwrap!(spawner.spawn(run_med())); | 139 | unwrap!(spawner.spawn(run_med())); |
| 144 | 140 | ||
| 145 | // Low priority executor: runs in thread mode, using WFE/SEV | 141 | // Low priority executor: runs in thread mode, using WFE/SEV |
diff --git a/examples/stm32f4/Cargo.toml b/examples/stm32f4/Cargo.toml index 3a8efdd06..7ecb64fce 100644 --- a/examples/stm32f4/Cargo.toml +++ b/examples/stm32f4/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers", "arch-cortex-m", "executor-thread", "executor-interrupt"] } | 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers", "arch-cortex-m", "executor-thread", "executor-interrupt"] } |
| 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "unstable-traits", "defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-any", "exti", "embedded-sdmmc", "chrono"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "unstable-traits", "defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-any", "exti", "embedded-sdmmc", "chrono"] } |
| 12 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 12 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
diff --git a/examples/stm32f4/src/bin/multiprio.rs b/examples/stm32f4/src/bin/multiprio.rs index 5d010f799..80bf59deb 100644 --- a/examples/stm32f4/src/bin/multiprio.rs +++ b/examples/stm32f4/src/bin/multiprio.rs | |||
| @@ -57,14 +57,11 @@ | |||
| 57 | #![no_main] | 57 | #![no_main] |
| 58 | #![feature(type_alias_impl_trait)] | 58 | #![feature(type_alias_impl_trait)] |
| 59 | 59 | ||
| 60 | use core::mem; | ||
| 61 | |||
| 62 | use cortex_m::peripheral::NVIC; | ||
| 63 | use cortex_m_rt::entry; | 60 | use cortex_m_rt::entry; |
| 64 | use defmt::*; | 61 | use defmt::*; |
| 65 | use embassy_executor::{Executor, InterruptExecutor}; | 62 | use embassy_executor::{Executor, InterruptExecutor}; |
| 66 | use embassy_stm32::interrupt; | 63 | use embassy_stm32::interrupt; |
| 67 | use embassy_stm32::pac::Interrupt; | 64 | use embassy_stm32::interrupt::{InterruptExt, Priority}; |
| 68 | use embassy_time::{Duration, Instant, Timer}; | 65 | use embassy_time::{Duration, Instant, Timer}; |
| 69 | use static_cell::StaticCell; | 66 | use static_cell::StaticCell; |
| 70 | use {defmt_rtt as _, panic_probe as _}; | 67 | use {defmt_rtt as _, panic_probe as _}; |
| @@ -130,16 +127,15 @@ fn main() -> ! { | |||
| 130 | info!("Hello World!"); | 127 | info!("Hello World!"); |
| 131 | 128 | ||
| 132 | let _p = embassy_stm32::init(Default::default()); | 129 | let _p = embassy_stm32::init(Default::default()); |
| 133 | let mut nvic: NVIC = unsafe { mem::transmute(()) }; | ||
| 134 | 130 | ||
| 135 | // High-priority executor: UART4, priority level 6 | 131 | // High-priority executor: UART4, priority level 6 |
| 136 | unsafe { nvic.set_priority(Interrupt::UART4, 6 << 4) }; | 132 | interrupt::UART4.set_priority(Priority::P6); |
| 137 | let spawner = EXECUTOR_HIGH.start(Interrupt::UART4); | 133 | let spawner = EXECUTOR_HIGH.start(interrupt::UART4); |
| 138 | unwrap!(spawner.spawn(run_high())); | 134 | unwrap!(spawner.spawn(run_high())); |
| 139 | 135 | ||
| 140 | // Medium-priority executor: UART5, priority level 7 | 136 | // Medium-priority executor: UART5, priority level 7 |
| 141 | unsafe { nvic.set_priority(Interrupt::UART5, 7 << 4) }; | 137 | interrupt::UART5.set_priority(Priority::P7); |
| 142 | let spawner = EXECUTOR_MED.start(Interrupt::UART5); | 138 | let spawner = EXECUTOR_MED.start(interrupt::UART5); |
| 143 | unwrap!(spawner.spawn(run_med())); | 139 | unwrap!(spawner.spawn(run_med())); |
| 144 | 140 | ||
| 145 | // Low priority executor: runs in thread mode, using WFE/SEV | 141 | // Low priority executor: runs in thread mode, using WFE/SEV |
diff --git a/examples/stm32f4/src/bin/usb_ethernet.rs b/examples/stm32f4/src/bin/usb_ethernet.rs index d229cc3ef..953d99a45 100644 --- a/examples/stm32f4/src/bin/usb_ethernet.rs +++ b/examples/stm32f4/src/bin/usb_ethernet.rs | |||
| @@ -94,8 +94,8 @@ async fn main(spawner: Spawner) { | |||
| 94 | let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(make_static!(NetState::new()), our_mac_addr); | 94 | let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(make_static!(NetState::new()), our_mac_addr); |
| 95 | unwrap!(spawner.spawn(usb_ncm_task(runner))); | 95 | unwrap!(spawner.spawn(usb_ncm_task(runner))); |
| 96 | 96 | ||
| 97 | let config = embassy_net::Config::Dhcp(Default::default()); | 97 | let config = embassy_net::Config::dhcpv4(Default::default()); |
| 98 | //let config = embassy_net::Config::Static(embassy_net::StaticConfig { | 98 | //let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 { |
| 99 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), | 99 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), |
| 100 | // dns_servers: Vec::new(), | 100 | // dns_servers: Vec::new(), |
| 101 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), | 101 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), |
diff --git a/examples/stm32f7/Cargo.toml b/examples/stm32f7/Cargo.toml index 7a650067c..657251c50 100644 --- a/examples/stm32f7/Cargo.toml +++ b/examples/stm32f7/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f767zi", "unstable-pac", "time-driver-any", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f767zi", "unstable-pac", "time-driver-any", "exti"] } |
| 12 | embassy-net = { path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet"] } | 12 | embassy-net = { path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet"] } |
diff --git a/examples/stm32f7/build.rs b/examples/stm32f7/build.rs index c4e15f19c..2b5d412a9 100644 --- a/examples/stm32f7/build.rs +++ b/examples/stm32f7/build.rs | |||
| @@ -1,9 +1,8 @@ | |||
| 1 | //! adapted from https://github.com/stm32-rs/stm32f7xx-hal/blob/master/build.rs | 1 | //! adapted from https://github.com/stm32-rs/stm32f7xx-hal/blob/master/build.rs |
| 2 | use std::env; | ||
| 3 | use std::fs::File; | 2 | use std::fs::File; |
| 4 | use std::io::prelude::*; | 3 | use std::io::prelude::*; |
| 5 | use std::io::{self}; | ||
| 6 | use std::path::PathBuf; | 4 | use std::path::PathBuf; |
| 5 | use std::{env, io}; | ||
| 7 | 6 | ||
| 8 | #[derive(Debug)] | 7 | #[derive(Debug)] |
| 9 | enum Error { | 8 | enum Error { |
diff --git a/examples/stm32f7/src/bin/eth.rs b/examples/stm32f7/src/bin/eth.rs index d8438241c..fde6a7576 100644 --- a/examples/stm32f7/src/bin/eth.rs +++ b/examples/stm32f7/src/bin/eth.rs | |||
| @@ -62,8 +62,8 @@ async fn main(spawner: Spawner) -> ! { | |||
| 62 | 0, | 62 | 0, |
| 63 | ); | 63 | ); |
| 64 | 64 | ||
| 65 | let config = embassy_net::Config::Dhcp(Default::default()); | 65 | let config = embassy_net::Config::dhcpv4(Default::default()); |
| 66 | //let config = embassy_net::Config::Static(embassy_net::StaticConfig { | 66 | //let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 { |
| 67 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), | 67 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), |
| 68 | // dns_servers: Vec::new(), | 68 | // dns_servers: Vec::new(), |
| 69 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), | 69 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), |
diff --git a/examples/stm32g0/Cargo.toml b/examples/stm32g0/Cargo.toml index 4d7fc4548..c5245757b 100644 --- a/examples/stm32g0/Cargo.toml +++ b/examples/stm32g0/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g071rb", "memory-x", "unstable-pac", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g071rb", "memory-x", "unstable-pac", "exti"] } |
| 12 | 12 | ||
diff --git a/examples/stm32g4/Cargo.toml b/examples/stm32g4/Cargo.toml index 00e2dae4c..f94df2dd3 100644 --- a/examples/stm32g4/Cargo.toml +++ b/examples/stm32g4/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g491re", "memory-x", "unstable-pac", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g491re", "memory-x", "unstable-pac", "exti"] } |
| 12 | embassy-hal-common = {version = "0.1.0", path = "../../embassy-hal-common" } | 12 | embassy-hal-common = {version = "0.1.0", path = "../../embassy-hal-common" } |
diff --git a/examples/stm32g4/src/bin/pll.rs b/examples/stm32g4/src/bin/pll.rs new file mode 100644 index 000000000..8cee41e9b --- /dev/null +++ b/examples/stm32g4/src/bin/pll.rs | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | #![no_std] | ||
| 2 | #![no_main] | ||
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | |||
| 5 | use defmt::*; | ||
| 6 | use embassy_executor::Spawner; | ||
| 7 | use embassy_stm32::rcc::{ClockSrc, PllM, PllN, PllR, PllSrc}; | ||
| 8 | use embassy_stm32::Config; | ||
| 9 | use embassy_time::{Duration, Timer}; | ||
| 10 | use {defmt_rtt as _, panic_probe as _}; | ||
| 11 | |||
| 12 | #[embassy_executor::main] | ||
| 13 | async fn main(_spawner: Spawner) { | ||
| 14 | let mut config = Config::default(); | ||
| 15 | |||
| 16 | // Configure PLL to max frequency of 170 MHz | ||
| 17 | config.rcc.mux = ClockSrc::PLLCLK(PllSrc::HSI16, PllM::Div4, PllN::Mul85, PllR::Div2); | ||
| 18 | |||
| 19 | let _p = embassy_stm32::init(config); | ||
| 20 | info!("Hello World!"); | ||
| 21 | |||
| 22 | loop { | ||
| 23 | Timer::after(Duration::from_millis(1000)).await; | ||
| 24 | info!("1s elapsed"); | ||
| 25 | } | ||
| 26 | } | ||
diff --git a/examples/stm32h5/Cargo.toml b/examples/stm32h5/Cargo.toml index d49a0dde7..ebe511347 100644 --- a/examples/stm32h5/Cargo.toml +++ b/examples/stm32h5/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32h563zi", "time-driver-any", "exti", "unstable-pac", "unstable-traits"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32h563zi", "time-driver-any", "exti", "unstable-pac", "unstable-traits"] } |
| 12 | embassy-net = { path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet", "unstable-traits", "proto-ipv6"] } | 12 | embassy-net = { path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet", "unstable-traits", "proto-ipv6"] } |
diff --git a/examples/stm32h5/src/bin/eth.rs b/examples/stm32h5/src/bin/eth.rs index 5d1eadf4b..78c8282a6 100644 --- a/examples/stm32h5/src/bin/eth.rs +++ b/examples/stm32h5/src/bin/eth.rs | |||
| @@ -81,8 +81,8 @@ async fn main(spawner: Spawner) -> ! { | |||
| 81 | 0, | 81 | 0, |
| 82 | ); | 82 | ); |
| 83 | 83 | ||
| 84 | let config = embassy_net::Config::Dhcp(Default::default()); | 84 | let config = embassy_net::Config::dhcpv4(Default::default()); |
| 85 | //let config = embassy_net::Config::Static(embassy_net::StaticConfig { | 85 | //let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 { |
| 86 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), | 86 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), |
| 87 | // dns_servers: Vec::new(), | 87 | // dns_servers: Vec::new(), |
| 88 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), | 88 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), |
diff --git a/examples/stm32h7/Cargo.toml b/examples/stm32h7/Cargo.toml index 08b57f988..62ef5e9e4 100644 --- a/examples/stm32h7/Cargo.toml +++ b/examples/stm32h7/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32h743bi", "time-driver-any", "exti", "unstable-pac", "unstable-traits"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32h743bi", "time-driver-any", "exti", "unstable-pac", "unstable-traits"] } |
| 12 | embassy-net = { path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet", "unstable-traits", "proto-ipv6"] } | 12 | embassy-net = { path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet", "unstable-traits", "proto-ipv6"] } |
diff --git a/examples/stm32h7/src/bin/eth.rs b/examples/stm32h7/src/bin/eth.rs index 3aa7b2271..12d37f7a4 100644 --- a/examples/stm32h7/src/bin/eth.rs +++ b/examples/stm32h7/src/bin/eth.rs | |||
| @@ -63,8 +63,8 @@ async fn main(spawner: Spawner) -> ! { | |||
| 63 | 0, | 63 | 0, |
| 64 | ); | 64 | ); |
| 65 | 65 | ||
| 66 | let config = embassy_net::Config::Dhcp(Default::default()); | 66 | let config = embassy_net::Config::dhcpv4(Default::default()); |
| 67 | //let config = embassy_net::Config::Static(embassy_net::StaticConfig { | 67 | //let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 { |
| 68 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), | 68 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), |
| 69 | // dns_servers: Vec::new(), | 69 | // dns_servers: Vec::new(), |
| 70 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), | 70 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), |
diff --git a/examples/stm32h7/src/bin/eth_client.rs b/examples/stm32h7/src/bin/eth_client.rs index 575c716b6..6078fc3fe 100644 --- a/examples/stm32h7/src/bin/eth_client.rs +++ b/examples/stm32h7/src/bin/eth_client.rs | |||
| @@ -64,8 +64,8 @@ async fn main(spawner: Spawner) -> ! { | |||
| 64 | 0, | 64 | 0, |
| 65 | ); | 65 | ); |
| 66 | 66 | ||
| 67 | let config = embassy_net::Config::Dhcp(Default::default()); | 67 | let config = embassy_net::Config::dhcpv4(Default::default()); |
| 68 | //let config = embassy_net::Config::StaticConfig(embassy_net::Config { | 68 | //let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 { |
| 69 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), | 69 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), |
| 70 | // dns_servers: Vec::new(), | 70 | // dns_servers: Vec::new(), |
| 71 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), | 71 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), |
diff --git a/examples/stm32l0/Cargo.toml b/examples/stm32l0/Cargo.toml index 235f1b0b3..2ead714e4 100644 --- a/examples/stm32l0/Cargo.toml +++ b/examples/stm32l0/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [features] | 7 | [features] |
| 8 | default = ["nightly"] | 8 | default = ["nightly"] |
| 9 | nightly = ["embassy-stm32/nightly", "embassy-time/nightly", "embassy-time/unstable-traits", | 9 | nightly = ["embassy-stm32/nightly", "embassy-time/nightly", "embassy-time/unstable-traits", "embassy-executor/nightly", |
| 10 | "embassy-lora", "lora-phy", "lorawan-device", "lorawan", "embedded-io/async"] | 10 | "embassy-lora", "lora-phy", "lorawan-device", "lorawan", "embedded-io/async"] |
| 11 | 11 | ||
| 12 | [dependencies] | 12 | [dependencies] |
diff --git a/examples/stm32l1/Cargo.toml b/examples/stm32l1/Cargo.toml index 8b6508c87..93d48abeb 100644 --- a/examples/stm32l1/Cargo.toml +++ b/examples/stm32l1/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32l151cb-a", "time-driver-any", "memory-x"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32l151cb-a", "time-driver-any", "memory-x"] } |
| 12 | 12 | ||
diff --git a/examples/stm32l4/Cargo.toml b/examples/stm32l4/Cargo.toml index 29d091f94..3bb473ef5 100644 --- a/examples/stm32l4/Cargo.toml +++ b/examples/stm32l4/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 11 | embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" } | 11 | embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" } |
| 12 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32l4s5vi", "time-driver-any", "exti", "unstable-traits"] } | 12 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32l4s5vi", "time-driver-any", "exti", "unstable-traits"] } |
diff --git a/examples/stm32l5/Cargo.toml b/examples/stm32l5/Cargo.toml index 2ac9c180d..6035c291f 100644 --- a/examples/stm32l5/Cargo.toml +++ b/examples/stm32l5/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32l552ze", "time-driver-any", "exti", "unstable-traits", "memory-x"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32l552ze", "time-driver-any", "exti", "unstable-traits", "memory-x"] } |
| 12 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 12 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
diff --git a/examples/stm32l5/src/bin/usb_ethernet.rs b/examples/stm32l5/src/bin/usb_ethernet.rs index 6163e0709..32eba4277 100644 --- a/examples/stm32l5/src/bin/usb_ethernet.rs +++ b/examples/stm32l5/src/bin/usb_ethernet.rs | |||
| @@ -91,8 +91,8 @@ async fn main(spawner: Spawner) { | |||
| 91 | let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(make_static!(NetState::new()), our_mac_addr); | 91 | let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(make_static!(NetState::new()), our_mac_addr); |
| 92 | unwrap!(spawner.spawn(usb_ncm_task(runner))); | 92 | unwrap!(spawner.spawn(usb_ncm_task(runner))); |
| 93 | 93 | ||
| 94 | let config = embassy_net::Config::Dhcp(Default::default()); | 94 | let config = embassy_net::Config::dhcpv4(Default::default()); |
| 95 | //let config = embassy_net::Config::Static(embassy_net::StaticConfig { | 95 | //let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 { |
| 96 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), | 96 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), |
| 97 | // dns_servers: Vec::new(), | 97 | // dns_servers: Vec::new(), |
| 98 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), | 98 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), |
diff --git a/examples/stm32u5/Cargo.toml b/examples/stm32u5/Cargo.toml index be205f880..e2318c3d6 100644 --- a/examples/stm32u5/Cargo.toml +++ b/examples/stm32u5/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32u585ai", "time-driver-any", "memory-x" ] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32u585ai", "time-driver-any", "memory-x" ] } |
| 12 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 12 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
diff --git a/examples/stm32wb/Cargo.toml b/examples/stm32wb/Cargo.toml index 8cfac772a..14897b171 100644 --- a/examples/stm32wb/Cargo.toml +++ b/examples/stm32wb/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32wb55rg", "time-driver-any", "memory-x", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32wb55rg", "time-driver-any", "memory-x", "exti"] } |
| 12 | 12 | ||
diff --git a/examples/stm32wl/Cargo.toml b/examples/stm32wl/Cargo.toml index 6191d01e9..260f9afa1 100644 --- a/examples/stm32wl/Cargo.toml +++ b/examples/stm32wl/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["nightly", "unstable-traits", "defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["nightly", "unstable-traits", "defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "unstable-traits", "defmt", "stm32wl55jc-cm4", "time-driver-any", "memory-x", "unstable-pac", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "unstable-traits", "defmt", "stm32wl55jc-cm4", "time-driver-any", "memory-x", "unstable-pac", "exti"] } |
| 12 | embassy-embedded-hal = {version = "0.1.0", path = "../../embassy-embedded-hal" } | 12 | embassy-embedded-hal = {version = "0.1.0", path = "../../embassy-embedded-hal" } |
