Skip to content

Commit 9ac9b9d

Browse files
committed
Highlight required features for some modules
And additional documentation improvments
1 parent 3478e5a commit 9ac9b9d

File tree

6 files changed

+20
-20
lines changed

6 files changed

+20
-20
lines changed

src/adc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
//! API for the ADC (Analog to Digital Converter)
1+
//! Analog to Digital Converter. (Requires feature `stm32f303x[bcde]`)
22
//!
33
//! # Examples
44
//!
5-
//! Check out [examles/adc.rs].
5+
//! Check out [examles/adc.rs][].
66
//!
77
//! It can be built for the STM32F3Discovery running
88
//! `cargo build --example adc --features=stm32f303xc`

src/can.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Controller Area Network
1+
//! Controller Area Network (Requires feature `can`)
22
//!
33
//! CAN is currently not enabled by default, and
44
//! can be enabled by the `can` feature.
@@ -25,8 +25,10 @@ pub use pac::can::btr::LBKM_A;
2525
const EXID_MASK: u32 = 0b1_1111_1111_1100_0000_0000_0000_0000;
2626
const MAX_EXTENDED_ID: u32 = 0x1FFF_FFFF;
2727

28-
/// Options the CAN bus. This is primarily used to set bus timings, but also controls options like enabling loopback or silent mode for debugging.
29-
/// See http://www.bittiming.can-wiki.info/#bxCAN for generating the timing parameters for different baud rates and clocks.
28+
/// Options for the CAN bus.
29+
///
30+
/// This is primarily used to set bus timings, but also controls options like enabling loopback or silent mode for debugging.
31+
/// See <http://www.bittiming.can-wiki.info/#bxCAN> for generating the timing parameters for different baud rates and clocks.
3032
///
3133
/// Use `CanOpts::default()` to get 250kbps at 32mhz system clock
3234
pub struct CanOpts {
@@ -43,25 +45,25 @@ impl CanOpts {
4345
CanOpts::default()
4446
}
4547

46-
/// Set the Baud Rate Prescaler. See http://www.bittiming.can-wiki.info/#bxCAN for generating the timing parameters for different baud rates and clocks.
48+
/// Set the Baud Rate Prescaler. See <http://www.bittiming.can-wiki.info/#bxCAN> for generating the timing parameters for different baud rates and clocks.
4749
pub fn brp(mut self, brp: u16) -> Self {
4850
self.brp = brp;
4951
self
5052
}
5153

52-
/// Set the Resynchronisation Jump Width. See http://www.bittiming.can-wiki.info/#bxCAN for generating the timing parameters for different baud rates and clocks.
54+
/// Set the Resynchronisation Jump Width. See <http://www.bittiming.can-wiki.info/#bxCAN> for generating the timing parameters for different baud rates and clocks.
5355
pub fn sjw(mut self, sjw: u8) -> Self {
5456
self.sjw = sjw;
5557
self
5658
}
5759

58-
/// Set Time Segment One. See http://www.bittiming.can-wiki.info/#bxCAN for generating the timing parameters for different baud rates and clocks.
60+
/// Set Time Segment One. See <http://www.bittiming.can-wiki.info/#bxCAN> for generating the timing parameters for different baud rates and clocks.
5961
pub fn ts1(mut self, ts1: u8) -> Self {
6062
self.ts1 = ts1;
6163
self
6264
}
6365

64-
/// Set Time Segment Two. See http://www.bittiming.can-wiki.info/#bxCAN for generating the timing parameters for different baud rates and clocks.
66+
/// Set Time Segment Two. See <http://www.bittiming.can-wiki.info/#bxCAN> for generating the timing parameters for different baud rates and clocks.
6567
pub fn ts2(mut self, ts2: u8) -> Self {
6668
self.ts2 = ts2;
6769
self

src/dma.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
//! Direct memory access (DMA) controller
1+
//! Direct memory access (DMA) controller. (Requires feature `stm32f303*` or `stm32f302*`)
22
//!
3-
//! Currently DMA is only supported for STM32F303 MCUs.
3+
//! Currently DMA is only supported for STM32F303 or STM32F302 MCUs.
44
//!
55
//! An example how to use DMA for serial, can be found at [examples/serial_dma.rs]
66
//!

src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,25 +47,25 @@
4747
4848
[README]: https://github.com/stm32-rs/stm32f3xx-hal/blob/master/README.md#selecting-the-right-chip
4949
50-
### ld
50+
### `ld`
5151
5252
When this feature is enabled the `memory.x` linker script for target chip is automatically
5353
provided by this crate. See [`cortex-m-rt` document][memoryx] for more info.
5454
5555
[memoryx]: https://docs.rs/cortex-m-rt/0.6.13/cortex_m_rt/#memoryx
5656
57-
### rt
57+
### `rt`
5858
5959
This feature enables [`stm32f3`][]'s `rt` feature. See [`cortex-m-rt` document][device] for more info.
6060
6161
[`stm32f3`]: https://crates.io/crates/stm32f3
6262
[device]: https://docs.rs/cortex-m-rt/0.6.13/cortex_m_rt/#device
6363
64-
### can
64+
### `can`
6565
6666
Enable CAN peripherals on supported targets.
6767
68-
### stm32-usbd
68+
### `stm32-usbd`
6969
7070
Enable USB peripherals on supported targets.
7171
@@ -120,7 +120,7 @@ pub use stm32f3::stm32f373 as pac;
120120
#[cfg(feature = "svd-f3x4")]
121121
pub use stm32f3::stm32f3x4 as pac;
122122

123-
/// Enable use of interrupt macro
123+
/// Enable use of interrupt macro. (Requires feature `rt`)
124124
#[cfg(feature = "rt")]
125125
pub use crate::pac::interrupt;
126126

src/spi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ use core::ptr;
99
use crate::hal::spi::FullDuplex;
1010
pub use crate::hal::spi::{Mode, Phase, Polarity};
1111
use crate::pac::{
12+
spi1,
1213
spi1::cr2::{DS_A, FRXTH_A},
1314
SPI1, SPI2, SPI3,
1415
};
15-
use crate::stm32::spi1;
1616

1717
#[cfg(any(
1818
feature = "stm32f302xd",

src/usb.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
//! USB peripheral
2-
//!
3-
//! Requires the `stm32-usbd` feature and one of the `stm32f303x*` features.
1+
//! USB peripheral. (Requires feature `stm32-usbd`)
42
//!
53
//! See [examples/usb_serial.rs] for a usage example.
64
//!

0 commit comments

Comments
 (0)