Skip to content

Commit

Permalink
Merge pull request #233 from Sh3Rm4n/improve-doc
Browse files Browse the repository at this point in the history
Improve doc
  • Loading branch information
Sh3Rm4n authored Jun 10, 2021
2 parents 2a4382e + bc6b2b8 commit f708a69
Show file tree
Hide file tree
Showing 17 changed files with 74 additions and 17 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,22 @@ jobs:
command: check
args: --features=ld,defmt,${{ matrix.mcu }} --test ${{ matrix.test }}

check-doc:
name: Check Documentation Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: thumbv7em-none-eabihf
override: true
profile: minimal
- uses: actions-rs/cargo@v1
with:
command: doc
args: --features=stm32f303xc,rt,stm32-usbd,can

clippy:
name: Clippy
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions src/adc.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Analog to Digital Converter.
//! # Analog to Digital Converter.
//!
//! # Examples
//! ## Examples
//!
//! Check out [examles/adc.rs][].
//!
Expand Down
7 changes: 6 additions & 1 deletion src/delay.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
//! Delays
//! # Delays
//!
//! Implementations for the [`DelayMs`] and [`DelayUs`] traits
//!
//! [DelayMs]: embedded_hal::blocking::delay::DelayMs
//! [DelayUs]: embedded_hal::blocking::delay::DelayUs

use core::convert::From;

Expand Down
4 changes: 3 additions & 1 deletion src/dma.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
//! Direct memory access (DMA) controller.
//! # Direct memory access (DMA) controller.
//!
//! Currently DMA is only supported for STM32F303 or STM32F302 MCUs.
//!
//! ## Examples
//!
//! An example how to use DMA for serial, can be found at [examples/serial_dma.rs]
//!
//! [examples/serial_dma.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.6.1/examples/serial_dma.rs
Expand Down
4 changes: 3 additions & 1 deletion src/flash.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
//! Flash memory
//! # Flash memory
//!
//! Abstractions of the internal flash module.

use crate::pac::{flash, FLASH};

Expand Down
2 changes: 1 addition & 1 deletion src/gpio.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! General Purpose Input / Output
//! # General Purpose Input / Output
//!
//! To use the GPIO pins, you first need to configure the GPIO port (GPIOA, GPIOB, ...) that you
//! are interested in. This is done using the [`GpioExt::split`] function.
Expand Down
4 changes: 3 additions & 1 deletion src/i2c.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
//! Inter-Integrated Circuit (I2C) bus
//! # Inter-Integrated Circuit (I2C) bus
//!
//! ## Examples
//!
//! A usage example of the i2c peripheral can be found at [examples/i2c_scanner.rs]
//!
Expand Down
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
# stm32f3xx-hal
# `stm32f3xx-hal`
`stm32f3xx-hal` contains a multi device hardware abstraction on top of the
peripheral access API for the STMicro [STM32F3][stm] series microcontrollers.
Expand Down Expand Up @@ -90,6 +90,7 @@
#![allow(clippy::upper_case_acronyms)]
#![warn(missing_docs)]
#![deny(macro_use_extern_crate)]
#![cfg_attr(nightly, deny(rustdoc::broken_intra_doc_links))]

use cfg_if::cfg_if;

Expand Down
10 changes: 9 additions & 1 deletion src/prelude.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
//! Prelude
//! # Prelude
//!
//! ```rust
//! // Import common extension traits.
//! //
//! // This includes internal extension crates,
//! // but also reexportet traits from embeded-hal or embedded time.
//! use stm32f3xx-hal::prelude::*;
//! ```

#[cfg(any(feature = "stm32f302", feature = "stm32f303"))]
pub use crate::dma::DmaExt as _stm32f3xx_hal_dma_DmaExt;
Expand Down
2 changes: 1 addition & 1 deletion src/rcc.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Reset and Clock Control
//! # Reset and Clock Control
//!
//! The most important function this module
//! delivers is the clock configuration.
Expand Down
2 changes: 1 addition & 1 deletion src/rtc.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Real Time Clock
//! # Real Time Clock
//!
//! Interface to the real time clock. See STM32F303 reference manual, section 27.
//! For more details, see [ST AN4759][].
Expand Down
9 changes: 8 additions & 1 deletion src/serial.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
//! Serial
//! # Serial
//!
//! Asynchronous serial communication using the interal USART peripherals
//!
//! The serial modules implement the [`Read`] and [`Write`] traits.
//!
//! [`Read`]: embedded_hal::serial::Read
//! [`Write`]: embedded_hal::serial::Write

use core::{convert::Infallible, marker::PhantomData, ptr};

Expand Down
4 changes: 3 additions & 1 deletion src/spi.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
//! Serial Peripheral Interface (SPI) bus
//! # Serial Peripheral Interface (SPI) bus
//!
//! ## Examples
//!
//! A usage example of the can peripheral can be found at [examples/spi.rs]
//!
Expand Down
2 changes: 1 addition & 1 deletion src/syscfg.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! System configuration controller
//! # System configuration controller

use core::ops::Deref;

Expand Down
8 changes: 7 additions & 1 deletion src/timer.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
//! Timers
//! # Timers
//!
//! Abstractions of the internal timer peripherals
//! The timer modules implements the [`CountDown`] and [`Periodic`] traits.
//!
//! [Read]: embedded_hal::timer::CountDown
//! [Write]: embedded_hal::timer::Periodic

use core::convert::{From, TryFrom};

Expand Down
6 changes: 5 additions & 1 deletion src/usb.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
//! USB peripheral.
//! # USB peripheral.
//!
//! Mostly builds upon the [`stm32_usbd`] crate.
//!
//! ## Examples
//!
//! See [examples/usb_serial.rs] for a usage example.
//!
Expand Down
4 changes: 3 additions & 1 deletion src/watchdog.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
//! Watchdog
//! # Watchdog
//!
//! ## Examples
//!
//! A usage example of the watchdog can be found at [examples/can.rs]
//!
Expand Down

0 comments on commit f708a69

Please sign in to comment.