aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.vscode/settings.json3
-rw-r--r--Cargo.example.toml93
-rw-r--r--README.md25
3 files changed, 23 insertions, 98 deletions
diff --git a/.vscode/settings.json b/.vscode/settings.json
index a35be8054..b229f7eb6 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -16,7 +16,8 @@
16 //"embassy-net/pool-16", 16 //"embassy-net/pool-16",
17 ], 17 ],
18 "rust-analyzer.linkedProjects": [ 18 "rust-analyzer.linkedProjects": [
19 "examples/stm32f1/Cargo.toml" 19 // Declare for the target you wish to develop
20 "examples/nrf/Cargo.toml"
20 ], 21 ],
21 "rust-analyzer.procMacro.enable": true, 22 "rust-analyzer.procMacro.enable": true,
22 "rust-analyzer.cargo.runBuildScripts": true, 23 "rust-analyzer.cargo.runBuildScripts": true,
diff --git a/Cargo.example.toml b/Cargo.example.toml
deleted file mode 100644
index 3fa8a32e9..000000000
--- a/Cargo.example.toml
+++ /dev/null
@@ -1,93 +0,0 @@
1# This file is a template for a Cargo workspace for developer convenience.
2#
3# Since Cargo resolves all features for all crates in the workspace together,
4# it is not possible to have a workspace with all the crates together, since they
5# enable incompatible features. For example, nrf crates enable embassy-macros/nrf
6# and stm32 crates enable embassy-macros/stm32. embassy-macros doesn't support having
7# both of these features on at the same time, because it makes no sense.
8#
9# Instead, we provide this template so you can enable only the crates you're going to
10# work on. This makes eg rust-analyzer check-on-save and autocomplete work, but only
11# in these crates, without any feature conflict.
12#
13# Copy this file to `Cargo.toml` and uncomment one group of crates below.
14#
15# `/Cargo.toml` is already in .gitignore, so you don't commit it accidentally.
16
17[workspace]
18resolver = "2"
19
20members = [
21 "embassy",
22 "embassy-traits",
23 "embassy-macros",
24 "embassy-hal-common",
25 "embassy-net",
26
27 # Uncomment ONLY ONE of the groups below.
28
29 # nRF
30 #"embassy-nrf",
31 #"examples/nrf",
32
33 # stm32
34 #"embassy-stm32",
35 #"stm32-metapac",
36 # uncomment ONLY ONE example crate.
37 #"examples/stm32f0",
38 #"examples/stm32f1",
39 #"examples/stm32f4",
40 #"examples/stm32f7",
41 #"examples/stm32g0",
42 #"examples/stm32h7",
43 #"examples/stm32l0",
44 #"examples/stm32l1",
45 #"examples/stm32l4",
46 #"examples/stm32wb55",
47 #"examples/stm32wl55",
48
49 # rp2040
50 #"embassy-rp",
51 #"examples/rp",
52
53 # std
54 #"examples/std",
55]
56
57exclude = [
58 # This is only built as a build-dependency, for the host. It shouldn't
59 # get built for the target.
60 "stm32-metapac-gen"
61]
62
63[profile.dev]
64codegen-units = 1
65debug = 2
66debug-assertions = true
67incremental = false
68opt-level = 3
69overflow-checks = true
70
71[profile.release]
72codegen-units = 1
73debug = 2
74debug-assertions = false
75incremental = false
76lto = "fat"
77opt-level = 's'
78overflow-checks = false
79
80# do not optimize proc-macro crates = faster builds from scratch
81[profile.dev.build-override]
82codegen-units = 8
83debug = false
84debug-assertions = false
85opt-level = 0
86overflow-checks = false
87
88[profile.release.build-override]
89codegen-units = 8
90debug = false
91debug-assertions = false
92opt-level = 0
93overflow-checks = false
diff --git a/README.md b/README.md
index f8898dcd6..fd856bb6d 100644
--- a/README.md
+++ b/README.md
@@ -28,9 +28,10 @@ The `embassy::executor` module provides an async/await executor designed for emb
28 28
29`embassy::util` contains some lightweight async/await utilities, mainly helpful for async driver development (signaling a task that an interrupt has occured, for example). 29`embassy::util` contains some lightweight async/await utilities, mainly helpful for async driver development (signaling a task that an interrupt has occured, for example).
30 30
31## embassy-nrf 31## HALs
32 32
33The `embassy-nrf` crate contains implementations for nRF 52 series SoCs. 33Hardware Absraction Layers with asynchronous behaviors are provided for a variety of platforms.
34For example, the `embassy-nrf` crate contains implementations for nRF 52 series SoCs.
34 35
35- `uarte`: UARTE driver implementing `AsyncBufRead` and `AsyncWrite`. 36- `uarte`: UARTE driver implementing `AsyncBufRead` and `AsyncWrite`.
36- `qspi`: QSPI driver implementing `Flash`. 37- `qspi`: QSPI driver implementing `Flash`.
@@ -41,7 +42,8 @@ The `embassy-nrf` crate contains implementations for nRF 52 series SoCs.
41 42
42## Examples 43## Examples
43 44
44Examples are found in the `examples/` folder seperated by the chip manufacturer they are designed to run on: 45Examples are found in the `examples/` folder seperated by the chip manufacturer they are designed to run on. For example:
46
45* `examples/nrf` are designed to run on the `nrf52840-dk` board (PCA10056) but should be easily adaptable to other nRF52 chips and boards. 47* `examples/nrf` are designed to run on the `nrf52840-dk` board (PCA10056) but should be easily adaptable to other nRF52 chips and boards.
46* `examples/rp` are for the RP2040 chip. 48* `examples/rp` are for the RP2040 chip.
47* `examples/stm32` are designed for the STM32F429ZI chip but should be easily adaptable to other STM32F4xx chips. 49* `examples/stm32` are designed for the STM32F429ZI chip but should be easily adaptable to other STM32F4xx chips.
@@ -61,12 +63,27 @@ git submodule update
61cargo install probe-run 63cargo install probe-run
62``` 64```
63 65
66- Change directory to the sample's base directory. For example:
67
68```
69cd examples/nrf
70```
71
64- Run the example 72- Run the example
65 73
74For example:
75
66``` 76```
67cargo run --bin rtc_async 77cargo run --bin blinky
68``` 78```
69 79
80## Developing Embassy with Rust Analyzer based editors
81
82The [Rust Analyzer](https://rust-analyzer.github.io/) is used by [Visual Studio Code](https://code.visualstudio.com/)
83and others. Given the multiple targets that Embassy serves, there is no Cargo workspace file. Instead, the Rust Analyzer
84must be told of the target project to work with. In the case of Visual Studio Code,
85please refer to the `.vscode/settings.json` file's `rust-analyzer.linkedProjects`setting.
86
70## Minimum supported Rust version (MSRV) 87## Minimum supported Rust version (MSRV)
71 88
72Required nightly version is specified in the `rust-toolchain.toml` file. Nightly is required for: 89Required nightly version is specified in the `rust-toolchain.toml` file. Nightly is required for: