|
2 | 2 | //!
|
3 | 3 | //! [CMSIS-SVD]: http://www.keil.com/pack/doc/CMSIS/SVD/html/index.html
|
4 | 4 | //!
|
5 |
| -//! A SVD file is an XML file that describes the hardware features of a |
| 5 | +//! An SVD file is an XML file that describes the hardware features of a |
6 | 6 | //! microcontroller. In particular, it lists all the peripherals available to the
|
7 | 7 | //! device, where the registers associated to each device are located in memory,
|
8 | 8 | //! and what's the function of each register.
|
|
56 | 56 | //! $ cargo fmt
|
57 | 57 | //! ```
|
58 | 58 | //!
|
59 |
| -//! The resulting crate must provide an opt-in "rt" feature and depend on these crates: |
60 |
| -//! `cortex-m` v0.7, `cortex-m-rt` >=v0.6.13 and `vcell` >=v0.1.2. Furthermore |
61 |
| -//! the "device" feature of `cortex-m-rt` must be enabled when the "rt" feature is enabled. The |
62 |
| -//! `Cargo.toml` of the device crate will look like this: |
| 59 | +//! The resulting crate must provide an opt-in `rt` feature and depend on these crates: |
| 60 | +//! |
| 61 | +//! - [`critical-section`](https://crates.io/crates/critical-section) v1.x |
| 62 | +//! - [`cortex-m`](https://crates.io/crates/cortex-m) >=v0.7.6 |
| 63 | +//! - [`cortex-m-rt`](https://crates.io/crates/cortex-m-rt) >=v0.6.13 |
| 64 | +//! - [`vcell`](https://crates.io/crates/vcell) >=v0.1.2 |
| 65 | +//! |
| 66 | +//! Furthermore, the "device" feature of `cortex-m-rt` must be enabled when the `rt` feature |
| 67 | +//! is enabled. The `Cargo.toml` of the device crate will look like this: |
63 | 68 | //!
|
64 | 69 | //! ``` toml
|
65 | 70 | //! [dependencies]
|
66 |
| -//! cortex-m = "0.7" |
| 71 | +//! critical-section = { version = "1.0", optional = true } |
| 72 | +//! cortex-m = "0.7.6" |
| 73 | +//! cortex-m-rt = { version = "0.6.13", optional = true } |
67 | 74 | //! vcell = "0.1.2"
|
68 | 75 | //!
|
69 |
| -//! [dependencies.cortex-m-rt] |
70 |
| -//! optional = true |
71 |
| -//! version = "0.6.13" |
72 |
| -//! |
73 | 76 | //! [features]
|
74 | 77 | //! rt = ["cortex-m-rt/device"]
|
75 | 78 | //! ```
|
|
110 | 113 | //! $ cargo fmt
|
111 | 114 | //! ```
|
112 | 115 | //!
|
113 |
| -//! The resulting crate must provide opt-in "rt" feature and depend on these crates: `msp430` |
114 |
| -//! v0.3.x, `msp430-rt` v0.3.x, and `vcell` v0.1.x. If the `--nightly` flag is provided to |
115 |
| -//! `svd2rust`, then `msp430-atomic` v0.1.4 is also needed. Furthermore the "device" feature of |
116 |
| -//! `msp430-rt` must be enabled when the "rt" feature is enabled. The `Cargo.toml` of the device |
117 |
| -//! crate will look like this: |
| 116 | +//! The resulting crate must provide opt-in `rt` feature and depend on these crates: |
| 117 | +//! |
| 118 | +//! - [`critical-section`](https://crates.io/crates/critical-section) v1.x |
| 119 | +//! - [`msp430`](https://crates.io/crates/msp430) v0.3.x |
| 120 | +//! - [`msp430-rt`](https://crates.io/crates/msp430-rt) v0.3.x |
| 121 | +//! - [`vcell`](https://crates.io/crates/vcell) v0.1.x |
| 122 | +//! |
| 123 | +//! If the `--nightly` flag is provided to `svd2rust`, then `msp430-atomic` v0.1.4 is also needed. |
| 124 | +//! Furthermore the "device" feature of `msp430-rt` must be enabled when the `rt` feature is |
| 125 | +//! enabled. The `Cargo.toml` of the device crate will look like this: |
118 | 126 | //!
|
119 | 127 | //! ``` toml
|
120 | 128 | //! [dependencies]
|
| 129 | +//! critical-section = { version = "1.0", optional = true } |
121 | 130 | //! msp430 = "0.3.0"
|
122 |
| -//! vcell = "0.1.0" |
123 | 131 | //! msp430-atomic = "0.1.4" # Only when using the --nightly flag
|
124 |
| -//! |
125 |
| -//! [dependencies.msp430-rt] |
126 |
| -//! optional = true |
127 |
| -//! version = "0.3.0" |
| 132 | +//! msp430-rt = { version = "0.3.0", optional = true } |
| 133 | +//! vcell = "0.1.0" |
128 | 134 | //!
|
129 | 135 | //! [features]
|
130 | 136 | //! rt = ["msp430-rt/device"]
|
|
134 | 140 | //! ## Other targets
|
135 | 141 | //!
|
136 | 142 | //! When the target is riscv or none `svd2rust` will emit only the `lib.rs` file. Like in
|
137 |
| -//! the cortex-m case we recommend you use `form` and `rustfmt` on the output. |
| 143 | +//! the `cortex-m` case, we recommend you use `form` and `rustfmt` on the output. |
138 | 144 | //!
|
139 |
| -//! The resulting crate must provide an opt-in "rt" feature and depend on these crates: |
| 145 | +//! The resulting crate must provide an opt-in `rt` feature and depend on these crates: |
140 | 146 | //!
|
141 |
| -//! - [`bare-metal`](https://crates.io/crates/bare-metal) v0.2.x |
| 147 | +//! - [`critical-section`](https://crates.io/crates/critical-section) v1.x |
| 148 | +//! - [`riscv`](https://crates.io/crates/riscv) v0.9.x (if target is RISC-V) |
| 149 | +//! - [`riscv-rt`](https://crates.io/crates/riscv-rt) v0.9.x (if target is RISC-V) |
142 | 150 | //! - [`vcell`](https://crates.io/crates/vcell) v0.1.x
|
143 |
| -//! - [`riscv`](https://crates.io/crates/riscv) v0.4.x if target = riscv. |
144 |
| -//! - [`riscv-rt`](https://crates.io/crates/riscv-rt) v0.4.x if target = riscv. |
145 | 151 | //!
|
146 |
| -//! The `*-rt` dependencies must be optional only enabled when the "rt" feature is enabled. The |
147 |
| -//! `Cargo.toml` of the device crate will look like this for a riscv target: |
| 152 | +//! The `*-rt` dependencies must be optional only enabled when the `rt` feature is enabled. The |
| 153 | +//! `Cargo.toml` of the device crate will look like this for a RISC-V target: |
148 | 154 | //!
|
149 | 155 | //! ``` toml
|
150 | 156 | //! [dependencies]
|
151 |
| -//! bare-metal = "0.2.0" |
152 |
| -//! riscv = "0.4.0" |
| 157 | +//! critical-section = { version = "1.0", optional = true } |
| 158 | +//! riscv = "0.9.0" |
| 159 | +//! riscv-rt = { version = "0.9.0", optional = true } |
153 | 160 | //! vcell = "0.1.0"
|
154 | 161 | //!
|
155 |
| -//! [dependencies.riscv-rt] |
156 |
| -//! optional = true |
157 |
| -//! version = "0.4.0" |
158 |
| -//! |
159 | 162 | //! [features]
|
160 | 163 | //! rt = ["riscv-rt"]
|
161 | 164 | //! ```
|
|
458 | 461 | //! used with the `cortex-m` crate `NVIC` API.
|
459 | 462 | //!
|
460 | 463 | //! ```ignore
|
461 |
| -//! use cortex_m::interrupt; |
462 | 464 | //! use cortex_m::peripheral::Peripherals;
|
463 | 465 | //! use stm32f30x::Interrupt;
|
464 | 466 | //!
|
|
469 | 471 | //! nvic.enable(Interrupt::TIM3);
|
470 | 472 | //! ```
|
471 | 473 | //!
|
472 |
| -//! ## the "rt" feature |
| 474 | +//! ## the `rt` feature |
473 | 475 | //!
|
474 |
| -//! If the "rt" Cargo feature of the svd2rust generated crate is enabled, the crate will populate the |
| 476 | +//! If the `rt` Cargo feature of the svd2rust generated crate is enabled, the crate will populate the |
475 | 477 | //! part of the vector table that contains the interrupt vectors and provide an
|
476 | 478 | //! [`interrupt!`](macro.interrupt.html) macro (non Cortex-M/MSP430 targets) or [`interrupt`] attribute
|
477 | 479 | //! (Cortex-M or [MSP430](https://docs.rs/msp430-rt-macros/0.1/msp430_rt_macros/attr.interrupt.html))
|
|
0 commit comments