Skip to content

Commit 9919851

Browse files
authored
Merge pull request #493 from nyurik/doc-fixes
Fix doc links and one incorrect type name
2 parents 8cd89e2 + b0b4f46 commit 9919851

File tree

8 files changed

+23
-23
lines changed

8 files changed

+23
-23
lines changed

embedded-hal-async/src/spi.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub use embedded_hal::spi::{
99
/// `SpiDevice` represents ownership over a single SPI device on a (possibly shared) bus, selected
1010
/// with a CS (Chip Select) pin.
1111
///
12-
/// See (the docs on embedded-hal)[embedded_hal::spi] for important information on SPI Bus vs Device traits.
12+
/// See [the docs on embedded-hal](embedded_hal::spi) for important information on SPI Bus vs Device traits.
1313
pub trait SpiDevice<Word: Copy + 'static = u8>: ErrorType {
1414
/// Perform a transaction against the device.
1515
///
@@ -108,21 +108,21 @@ impl<Word: Copy + 'static, T: SpiDevice<Word> + ?Sized> SpiDevice<Word> for &mut
108108
///
109109
/// `SpiBus` represents **exclusive ownership** over the whole SPI bus, with SCK, MOSI and MISO pins.
110110
///
111-
/// See (the docs on embedded-hal)[embedded_hal::spi] for important information on SPI Bus vs Device traits.
111+
/// See [the docs on embedded-hal][embedded_hal::spi] for important information on SPI Bus vs Device traits.
112112
pub trait SpiBus<Word: 'static + Copy = u8>: ErrorType {
113113
/// Read `words` from the slave.
114114
///
115115
/// The word value sent on MOSI during reading is implementation-defined,
116116
/// typically `0x00`, `0xFF`, or configurable.
117117
///
118118
/// Implementations are allowed to return before the operation is
119-
/// complete. See (the docs on embedded-hal)[embedded_hal::spi] for details on flushing.
119+
/// complete. See [the docs on embedded-hal][embedded_hal::spi] for details on flushing.
120120
async fn read(&mut self, words: &mut [Word]) -> Result<(), Self::Error>;
121121

122122
/// Write `words` to the slave, ignoring all the incoming words.
123123
///
124124
/// Implementations are allowed to return before the operation is
125-
/// complete. See (the docs on embedded-hal)[embedded_hal::spi] for details on flushing.
125+
/// complete. See [the docs on embedded-hal][embedded_hal::spi] for details on flushing.
126126
async fn write(&mut self, words: &[Word]) -> Result<(), Self::Error>;
127127

128128
/// Write and read simultaneously. `write` is written to the slave on MOSI and
@@ -135,20 +135,20 @@ pub trait SpiBus<Word: 'static + Copy = u8>: ErrorType {
135135
/// typically `0x00`, `0xFF`, or configurable.
136136
///
137137
/// Implementations are allowed to return before the operation is
138-
/// complete. See (the docs on embedded-hal)[embedded_hal::spi] for details on flushing.
138+
/// complete. See [the docs on embedded-hal][embedded_hal::spi] for details on flushing.
139139
async fn transfer(&mut self, read: &mut [Word], write: &[Word]) -> Result<(), Self::Error>;
140140

141141
/// Write and read simultaneously. The contents of `words` are
142142
/// written to the slave, and the received words are stored into the same
143143
/// `words` buffer, overwriting it.
144144
///
145145
/// Implementations are allowed to return before the operation is
146-
/// complete. See (the docs on embedded-hal)[embedded_hal::spi] for details on flushing.
146+
/// complete. See [the docs on embedded-hal][embedded_hal::spi] for details on flushing.
147147
async fn transfer_in_place(&mut self, words: &mut [Word]) -> Result<(), Self::Error>;
148148

149149
/// Wait until all operations have completed and the bus is idle.
150150
///
151-
/// See (the docs on embedded-hal)[embedded_hal::spi] for information on flushing.
151+
/// See [the docs on embedded-hal][embedded_hal::spi] for information on flushing.
152152
async fn flush(&mut self) -> Result<(), Self::Error>;
153153
}
154154

embedded-hal-bus/src/i2c/critical_section.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use embedded_hal::i2c::{ErrorType, I2c};
44

55
/// `critical-section`-based shared bus [`I2c`] implementation.
66
///
7-
/// Sharing is implemented with a `critical-section` [`Mutex`](critical_section::Mutex). A critical section is taken for
7+
/// Sharing is implemented with a `critical-section` [`Mutex`]. A critical section is taken for
88
/// the entire duration of a transaction. This allows sharing a single bus across multiple threads (interrupt priority levels).
99
/// The downside is critical sections typically require globally disabling interrupts, so `CriticalSectionDevice` will likely
1010
/// negatively impact real-time properties, such as interrupt latency. If you can, prefer using

embedded-hal-bus/src/i2c/mutex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::sync::Mutex;
33

44
/// `std` `Mutex`-based shared bus [`I2c`] implementation.
55
///
6-
/// Sharing is implemented with an `std` [`Mutex`](std::sync::Mutex). It allows a single bus across multiple threads,
6+
/// Sharing is implemented with an `std` [`Mutex`]. It allows a single bus across multiple threads,
77
/// with finer-grained locking than [`CriticalSectionDevice`](super::CriticalSectionDevice). The downside is that
88
/// it is only available in `std` targets.
99
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]

embedded-hal-bus/src/spi/critical_section.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ use super::DeviceError;
88

99
/// `critical-section`-based shared bus [`SpiDevice`] implementation.
1010
///
11-
/// This allows for sharing an [`SpiBus`](embedded_hal::spi::SpiBus), obtaining multiple [`SpiDevice`] instances,
11+
/// This allows for sharing an [`SpiBus`], obtaining multiple [`SpiDevice`] instances,
1212
/// each with its own `CS` pin.
1313
///
14-
/// Sharing is implemented with a `critical-section` [`Mutex`](critical_section::Mutex). A critical section is taken for
14+
/// Sharing is implemented with a `critical-section` [`Mutex`]. A critical section is taken for
1515
/// the entire duration of a transaction. This allows sharing a single bus across multiple threads (interrupt priority levels).
1616
/// The downside is critical sections typically require globally disabling interrupts, so `CriticalSectionDevice` will likely
1717
/// negatively impact real-time properties, such as interrupt latency. If you can, prefer using
@@ -23,20 +23,20 @@ pub struct CriticalSectionDevice<'a, BUS, CS, D> {
2323
}
2424

2525
impl<'a, BUS, CS, D> CriticalSectionDevice<'a, BUS, CS, D> {
26-
/// Create a new ExclusiveDevice.
26+
/// Create a new [`CriticalSectionDevice`].
2727
#[inline]
2828
pub fn new(bus: &'a Mutex<RefCell<BUS>>, cs: CS, delay: D) -> Self {
2929
Self { bus, cs, delay }
3030
}
3131
}
3232

3333
impl<'a, BUS, CS> CriticalSectionDevice<'a, BUS, CS, super::NoDelay> {
34-
/// Create a new CriticalSectionDevice without support for in-transaction delays.
34+
/// Create a new [`CriticalSectionDevice`] without support for in-transaction delays.
3535
///
3636
/// # Panics
3737
///
3838
/// The returned device will panic if you try to execute a transaction
39-
/// that contains any operations of type `Operation::DelayUs`.
39+
/// that contains any operations of type [`Operation::DelayUs`].
4040
#[inline]
4141
pub fn new_no_delay(bus: &'a Mutex<RefCell<BUS>>, cs: CS) -> Self {
4242
Self {

embedded-hal-bus/src/spi/exclusive.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use super::DeviceError;
1313

1414
/// [`SpiDevice`] implementation with exclusive access to the bus (not shared).
1515
///
16-
/// This is the most straightforward way of obtaining an [`SpiDevice`] from an [`SpiBus`](embedded_hal::spi::SpiBus),
16+
/// This is the most straightforward way of obtaining an [`SpiDevice`] from an [`SpiBus`],
1717
/// ideal for when no sharing is required (only one SPI device is present on the bus).
1818
pub struct ExclusiveDevice<BUS, CS, D> {
1919
bus: BUS,
@@ -22,7 +22,7 @@ pub struct ExclusiveDevice<BUS, CS, D> {
2222
}
2323

2424
impl<BUS, CS, D> ExclusiveDevice<BUS, CS, D> {
25-
/// Create a new ExclusiveDevice.
25+
/// Create a new [`ExclusiveDevice`].
2626
#[inline]
2727
pub fn new(bus: BUS, cs: CS, delay: D) -> Self {
2828
Self { bus, cs, delay }
@@ -42,7 +42,7 @@ impl<BUS, CS, D> ExclusiveDevice<BUS, CS, D> {
4242
}
4343

4444
impl<BUS, CS> ExclusiveDevice<BUS, CS, super::NoDelay> {
45-
/// Create a new ExclusiveDevice without support for in-transaction delays.
45+
/// Create a new [`ExclusiveDevice`] without support for in-transaction delays.
4646
///
4747
/// # Panics
4848
///

embedded-hal-bus/src/spi/mutex.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ use super::DeviceError;
77

88
/// `std` `Mutex`-based shared bus [`SpiDevice`] implementation.
99
///
10-
/// This allows for sharing an [`SpiBus`](embedded_hal::spi::SpiBus), obtaining multiple [`SpiDevice`] instances,
10+
/// This allows for sharing an [`SpiBus`], obtaining multiple [`SpiDevice`] instances,
1111
/// each with its own `CS` pin.
1212
///
13-
/// Sharing is implemented with a `std` [`Mutex`](std::sync::Mutex). It allows a single bus across multiple threads,
13+
/// Sharing is implemented with a `std` [`Mutex`]. It allows a single bus across multiple threads,
1414
/// with finer-grained locking than [`CriticalSectionDevice`](super::CriticalSectionDevice). The downside is
1515
/// it is only available in `std` targets.
1616
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]

embedded-hal-bus/src/spi/refcell.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use super::DeviceError;
77

88
/// `RefCell`-based shared bus [`SpiDevice`] implementation.
99
///
10-
/// This allows for sharing an [`SpiBus`](embedded_hal::spi::SpiBus), obtaining multiple [`SpiDevice`] instances,
10+
/// This allows for sharing an [`SpiBus`], obtaining multiple [`SpiDevice`] instances,
1111
/// each with its own `CS` pin.
1212
///
1313
/// Sharing is implemented with a `RefCell`. This means it has low overhead, but `RefCellDevice` instances are not `Send`,
@@ -20,15 +20,15 @@ pub struct RefCellDevice<'a, BUS, CS, D> {
2020
}
2121

2222
impl<'a, BUS, CS, D> RefCellDevice<'a, BUS, CS, D> {
23-
/// Create a new RefCellDevice.
23+
/// Create a new [`RefCellDevice`].
2424
#[inline]
2525
pub fn new(bus: &'a RefCell<BUS>, cs: CS, delay: D) -> Self {
2626
Self { bus, cs, delay }
2727
}
2828
}
2929

3030
impl<'a, BUS, CS> RefCellDevice<'a, BUS, CS, super::NoDelay> {
31-
/// Create a new RefCellDevice without support for in-transaction delays.
31+
/// Create a new [`RefCellDevice`] without support for in-transaction delays.
3232
///
3333
/// # Panics
3434
///

embedded-hal-nb/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
//! [`svd2rust`]: https://crates.io/crates/svd2rust
5858
//!
5959
//! Shown below is an implementation of some of the HAL traits for the [`stm32f1xx-hal`] crate. This
60-
//! single implementation will work for *any* microcontroller in the STM32F1xx family.
60+
//! single implementation will work for *any* microcontroller in the `STM32F1xx` family.
6161
//!
6262
//! [`stm32f1`]: https://crates.io/crates/stm32f1
6363
//!

0 commit comments

Comments
 (0)