Skip to content

Commit 9630d78

Browse files
bors[bot]robamu
andauthored
Merge #265
265: Cross-Reference Example files in documentation r=hargoniX a=robamu I think these examples help would a lot, so I added them in the struct comment block Co-authored-by: Robin Mueller <robin.mueller.m@gmail.com>
2 parents fc623b7 + 4e03f9c commit 9630d78

File tree

23 files changed

+110
-4
lines changed

23 files changed

+110
-4
lines changed

src/adc.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
//!
33
//! ADC1 and ADC2 share a reset line. To initialise both of them, use the
44
//! [`adc12`](adc12) method.
5+
//!
6+
//! # Examples
7+
//!
8+
//! - [Reading a voltage using ADC1](https://github.com/stm32-rs/stm32h7xx-hal/blob/master/examples/adc.rs)
9+
//! - [Reading a temperature using ADC3](https://github.com/stm32-rs/stm32h7xx-hal/blob/master/examples/temperature.rs)
10+
//! - [Using ADC1 and ADC2 together](https://github.com/stm32-rs/stm32h7xx-hal/blob/master/examples/adc12.rs)
11+
//! - [Using ADC1 and ADC2 in parallel](https://github.com/stm32-rs/stm32h7xx-hal/blob/master/examples/adc12_parallel.rs)
512
613
use crate::hal::adc::{Channel, OneShot};
714
use crate::hal::blocking::delay::DelayUs;

src/crc.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
//! Cyclic Redundancy Check (CRC)
2+
//!
3+
//! # Examples
4+
//!
5+
//! - [CRC example](https://github.com/stm32-rs/stm32h7xx-hal/blob/master/examples/crc.rs)
26
37
use core::convert::TryInto;
48
use core::fmt;

src/dac.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
//! Digital to Analog Converter (DAC)
2+
//!
3+
//! # Examples
4+
//!
5+
//! - [Simple DAC example](https://github.com/stm32-rs/stm32h7xx-hal/blob/master/examples/dac.rs)
26
37
use core::marker::PhantomData;
48
use core::mem::MaybeUninit;

src/dma/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@
7373
//! * [next_transfer_with](Transfer#method.next_transfer_with)
7474
//! * [next_dbm_transfer_with](Transfer#method.next_dbm_transfer_with)
7575
//!
76+
//! ## Examples
77+
//!
78+
//! - [Memory to Memory Transfer](https://github.com/stm32-rs/stm32h7xx-hal/blob/master/examples/dma.rs)
79+
//! - [Memory to Memory Transfer using Master DMA(MDMA)](https://github.com/stm32-rs/stm32h7xx-hal/blob/master/examples/mdma.rs)
80+
//! - [Using MDMA with multiple beats per burst](https://github.com/stm32-rs/stm32h7xx-hal/blob/master/examples/mdma_bursts.rs)
81+
//!
7682
//! ## Credits
7783
//!
7884
//! Adapted from

src/ethernet/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
//! - SMSC LAN8742a
66
//! - Micrel KSZ8081R
77
//!
8+
//! # Examples
9+
//!
10+
//! - [Simple link checker for the Nucleo-H743ZI2](https://github.com/stm32-rs/stm32h7xx-hal/blob/master/examples/ethernet-nucleo-h743zi2.rs)
11+
//! - [Simple link checker for the STM32H747I-DISCO](https://github.com/stm32-rs/stm32h7xx-hal/blob/master/examples/ethernet-stm32h747i-disco.rs)
12+
//! - [Ethernet example for the STM32H747I-DISCO using RTIC](https://github.com/stm32-rs/stm32h7xx-hal/blob/master/examples/ethernet-rtic-stm32h747i-disco.rs)
813
914
/// Station Management Interface (SMI) on an ethernet PHY
1015
pub trait StationManagement {

src/exti.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
//! External interrupt controller
2+
//!
3+
//! # Examples
4+
//!
5+
//! - [External Interrupt via Button](https://github.com/stm32-rs/stm32h7xx-hal/blob/master/examples/exti_interrupt.rs)
26
use crate::stm32::EXTI;
37

48
/// EXTI trigger event

src/fmc.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
//!
2626
//! `sdram` usage is described
2727
//! [here](https://github.com/stm32-rs/stm32-fmc#usage).
28+
//!
29+
//! # Examples
30+
//!
31+
//! - [FMC example using the IS42S32800G SDRAM](https://github.com/stm32-rs/stm32h7xx-hal/blob/master/examples/fmc.rs)
2832
2933
// From stm32_fmc
3034
use stm32_fmc::FmcPeripheral;

src/gpio.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
//! General Purpose Input / Output
2+
//!
3+
//! # Examples
4+
//!
5+
//! - [Simple Blinky](https://github.com/stm32-rs/stm32h7xx-hal/blob/master/examples/blinky.rs)
6+
//! - [Digital Read](https://github.com/stm32-rs/stm32h7xx-hal/blob/master/examples/digital_read.rs)
7+
//! - [External Interrupt via Button](https://github.com/stm32-rs/stm32h7xx-hal/blob/master/examples/exti_interrupt.rs)
28
39
use core::marker::PhantomData;
410

src/i2c.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
//! Inter Integrated Circuit (I2C)
2+
//!
3+
//! # Examples
4+
//!
5+
//! - [I2C simple examples](https://github.com/stm32-rs/stm32h7xx-hal/blob/master/examples/i2c.rs)
6+
//! - [I2C example using I2C4 and BDMA](https://github.com/stm32-rs/stm32h7xx-hal/blob/master/examples/i2c4_bdma.rs)
27
38
use core::cmp;
49
use core::marker::PhantomData;

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! *See the examples folder for more usage examples*
1+
//! *See the [examples](https://github.com/stm32-rs/stm32h7xx-hal/tree/master/examples) folder for more usage examples*
22
//!
33
//! This Hardware Abstraction Layer (HAL) provides the following functionality:
44
//!

0 commit comments

Comments
 (0)