Skip to content

Commit 360d02a

Browse files
committed
Link to examples in documentation
1 parent 70adeb8 commit 360d02a

File tree

9 files changed

+35
-4
lines changed

9 files changed

+35
-4
lines changed

src/adc.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
//! API for the ADC (Analog to Digital Converter)
22
//!
33
//! # Examples
4-
//! Check `adc.rs` in the examples folder.
4+
//!
5+
//! Check out [examles/adc.rs].
6+
//!
57
//! It can be built for the STM32F3Discovery running
68
//! `cargo build --example adc --features=stm32f303xc`
9+
//!
10+
//! [examples/adc.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.5.0/examples/adc.rs
11+
712
use crate::{
813
gpio::Analog,
914
rcc::{Clocks, AHB},

src/can.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
//! It is a implementation of the [`embedded_hal_can`][can] traits.
77
//!
88
//! [can]: embedded_hal_can
9+
//!
10+
//! A usage example of the can peripheral can be found at [examples/can.rs]
11+
//!
12+
//! [examples/can.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.5.0/examples/can.rs
13+
914
pub use embedded_hal_can::{self, Filter, Frame, Id, Receiver, Transmitter};
1015

1116
use crate::gpio::gpioa;

src/dma.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
//! Direct memory access (DMA) controller
22
//!
33
//! Currently DMA is only supported for STM32F303 MCUs.
4+
//!
5+
//! An example how to use DMA for serial, can be found at [examples/serial_dma.rs]
6+
//!
7+
//! [examples/serial_dma.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.5.0/examples/serial_dma.rs
48
59
// To learn about most of the ideas implemented here, check out the DMA section
610
// of the Embedonomicon: https://docs.rust-embedded.org/embedonomicon/dma.html

src/gpio.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
//!
2727
//! [InputPin]: embedded_hal::digital::v2::InputPin
2828
//! [OutputPin]: embedded_hal::digital::v2::OutputPin
29-
//! [examples/toggle.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.4.3/examples/toggle.rs
29+
//! [examples/toggle.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.5.0/examples/toggle.rs
3030
3131
use core::convert::Infallible;
3232
use core::marker::PhantomData;

src/i2c.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
//! Inter-Integrated Circuit (I2C) bus
2+
//!
3+
//! A usage example of the i2c peripheral can be found at [examples/i2c_scanner.rs]
4+
//!
5+
//! [examples/i2c_scanner.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.5.0/examples/i2c_scanner.rs
26
37
use core::convert::TryFrom;
48
use core::ops::Deref;

src/pwm.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@
149149
Once we've connected a complementary pin (PA7) we are now _only_
150150
allowed to use other complementary pins. PA8 is a valid choice if
151151
we have no pins in use, but it cannot be used once we've used PA7.
152+
153+
A usage example can be found at [examples/pwm.rs]
154+
155+
[examples/pwm.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.5.0/examples/pwm.rs
152156
*/
153157

154158
use crate::{

src/spi.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
//! Serial Peripheral Interface (SPI) bus
2+
//!
3+
//! A usage example of the can peripheral can be found at [examples/spi.rs]
4+
//!
5+
//! [examples/spi.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.5.0/examples/spi.rs
26
37
use core::ptr;
48

src/usb.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
//!
33
//! Requires the `stm32-usbd` feature and one of the `stm32f303x*` features.
44
//!
5-
//! See <https://github.com/stm32-rs/stm32f3xx-hal/tree/master/examples>
6-
//! for usage examples.
5+
//! See [examples/usb_serial.rs] for a usage example.
6+
//!
7+
//! [examples/usb_serial.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.5.0/examples/usb_serial.rs
78
89
use crate::pac::{RCC, USB};
910
use stm32_usbd::UsbPeripheral;

src/watchdog.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
//! Watchdog
2+
//!
3+
//! A usage example of the watchdog can be found at [examples/can.rs]
4+
//!
5+
//! [examples/can.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.5.0/examples/can.rs
26
37
use crate::hal::watchdog::{Watchdog, WatchdogEnable};
48

0 commit comments

Comments
 (0)