Skip to content

Commit bc6b2b8

Browse files
committed
Improve top module documentation
1 parent 2424a40 commit bc6b2b8

File tree

16 files changed

+57
-17
lines changed

16 files changed

+57
-17
lines changed

src/adc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
//! Analog to Digital Converter.
1+
//! # Analog to Digital Converter.
22
//!
3-
//! # Examples
3+
//! ## Examples
44
//!
55
//! Check out [examles/adc.rs][].
66
//!

src/delay.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
//! Delays
1+
//! # Delays
2+
//!
3+
//! Implementations for the [`DelayMs`] and [`DelayUs`] traits
4+
//!
5+
//! [DelayMs]: embedded_hal::blocking::delay::DelayMs
6+
//! [DelayUs]: embedded_hal::blocking::delay::DelayUs
27
38
use core::convert::From;
49

src/dma.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
//! Direct memory access (DMA) controller.
1+
//! # Direct memory access (DMA) controller.
22
//!
33
//! Currently DMA is only supported for STM32F303 or STM32F302 MCUs.
44
//!
5+
//! ## Examples
6+
//!
57
//! An example how to use DMA for serial, can be found at [examples/serial_dma.rs]
68
//!
79
//! [examples/serial_dma.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.6.1/examples/serial_dma.rs

src/flash.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
//! Flash memory
1+
//! # Flash memory
2+
//!
3+
//! Abstractions of the internal flash module.
24
35
use crate::pac::{flash, FLASH};
46

src/gpio.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! General Purpose Input / Output
1+
//! # General Purpose Input / Output
22
//!
33
//! To use the GPIO pins, you first need to configure the GPIO port (GPIOA, GPIOB, ...) that you
44
//! are interested in. This is done using the [`GpioExt::split`] function.

src/i2c.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
//! Inter-Integrated Circuit (I2C) bus
1+
//! # Inter-Integrated Circuit (I2C) bus
2+
//!
3+
//! ## Examples
24
//!
35
//! A usage example of the i2c peripheral can be found at [examples/i2c_scanner.rs]
46
//!

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
# stm32f3xx-hal
2+
# `stm32f3xx-hal`
33
44
`stm32f3xx-hal` contains a multi device hardware abstraction on top of the
55
peripheral access API for the STMicro [STM32F3][stm] series microcontrollers.

src/prelude.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
//! Prelude
1+
//! # Prelude
2+
//!
3+
//! ```rust
4+
//! // Import common extension traits.
5+
//! //
6+
//! // This includes internal extension crates,
7+
//! // but also reexportet traits from embeded-hal or embedded time.
8+
//! use stm32f3xx-hal::prelude::*;
9+
//! ```
210
311
#[cfg(any(feature = "stm32f302", feature = "stm32f303"))]
412
pub use crate::dma::DmaExt as _stm32f3xx_hal_dma_DmaExt;

src/rcc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Reset and Clock Control
1+
//! # Reset and Clock Control
22
//!
33
//! The most important function this module
44
//! delivers is the clock configuration.

src/rtc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Real Time Clock
1+
//! # Real Time Clock
22
//!
33
//! Interface to the real time clock. See STM32F303 reference manual, section 27.
44
//! For more details, see [ST AN4759][].

0 commit comments

Comments
 (0)