diff --git a/esp-hal/src/aes/mod.rs b/esp-hal/src/aes/mod.rs index f7892f8ed..f360b3911 100644 --- a/esp-hal/src/aes/mod.rs +++ b/esp-hal/src/aes/mod.rs @@ -46,8 +46,6 @@ //! * AES-DMA mode is currently not supported on ESP32 and ESP32S2 //! * AES-DMA Initialization Vector (IV) is currently not supported -#![deny(missing_docs)] - use crate::{ peripheral::{Peripheral, PeripheralRef}, peripherals::AES, diff --git a/esp-hal/src/analog/mod.rs b/esp-hal/src/analog/mod.rs index 714642f7d..cac201b4c 100644 --- a/esp-hal/src/analog/mod.rs +++ b/esp-hal/src/analog/mod.rs @@ -5,8 +5,6 @@ //! available on the device. For more information about a peripheral driver, //! please refer to the relevant module documentation. -#![deny(missing_docs)] - #[cfg(adc)] pub mod adc; #[cfg(dac)] diff --git a/esp-hal/src/clock/mod.rs b/esp-hal/src/clock/mod.rs index af1f19d0a..eec20041c 100644 --- a/esp-hal/src/clock/mod.rs +++ b/esp-hal/src/clock/mod.rs @@ -70,8 +70,6 @@ //! # } //! ``` -#![deny(missing_docs)] - use fugit::HertzU32; #[cfg(any(esp32, esp32c2))] diff --git a/esp-hal/src/dma/mod.rs b/esp-hal/src/dma/mod.rs index 13dd18ec6..4adf05d97 100644 --- a/esp-hal/src/dma/mod.rs +++ b/esp-hal/src/dma/mod.rs @@ -50,8 +50,6 @@ //! //! For convenience you can use the [crate::dma_buffers] macro. -#![deny(missing_docs)] - use core::{fmt::Debug, marker::PhantomData, ptr::addr_of_mut, sync::atomic::compiler_fence}; trait Word: crate::private::Sealed {} diff --git a/esp-hal/src/ecc.rs b/esp-hal/src/ecc.rs index f2139ff48..e094deb2b 100644 --- a/esp-hal/src/ecc.rs +++ b/esp-hal/src/ecc.rs @@ -25,6 +25,8 @@ //! //! [ECC]: https://github.com/esp-rs/esp-hal/blob/main/hil-test/tests/ecc.rs +#![allow(missing_docs)] // TODO: Remove when able + use core::marker::PhantomData; use crate::{ diff --git a/esp-hal/src/etm.rs b/esp-hal/src/etm.rs index e5e83fe6e..2b016fa45 100644 --- a/esp-hal/src/etm.rs +++ b/esp-hal/src/etm.rs @@ -61,6 +61,8 @@ //! # } //! ``` +#![allow(missing_docs)] // TODO: Remove when able + use crate::{ peripheral::{Peripheral, PeripheralRef}, system::PeripheralClockControl, diff --git a/esp-hal/src/gpio/mod.rs b/esp-hal/src/gpio/mod.rs index 762843bc3..01861176b 100644 --- a/esp-hal/src/gpio/mod.rs +++ b/esp-hal/src/gpio/mod.rs @@ -46,8 +46,6 @@ //! [Commonly Used Setup]: ../index.html#commonly-used-setup //! [Inverting TX and RX Pins]: ../uart/index.html#inverting-tx-and-rx-pins -#![warn(missing_docs)] - use core::{cell::Cell, marker::PhantomData}; use critical_section::Mutex; diff --git a/esp-hal/src/hmac.rs b/esp-hal/src/hmac.rs index ea5bf7756..5016a189a 100644 --- a/esp-hal/src/hmac.rs +++ b/esp-hal/src/hmac.rs @@ -34,6 +34,8 @@ //! //! [HMAC]: https://github.com/esp-rs/esp-hal/blob/main/examples/src/bin/hmac.rs +#![allow(missing_docs)] // TODO: Remove when able + use core::convert::Infallible; use crate::{ diff --git a/esp-hal/src/i2c.rs b/esp-hal/src/i2c.rs index 643df5541..a81f86a8c 100644 --- a/esp-hal/src/i2c.rs +++ b/esp-hal/src/i2c.rs @@ -69,6 +69,8 @@ //! # } //! ``` +#![allow(missing_docs)] // TODO: Remove when able + use core::marker::PhantomData; use fugit::HertzU32; diff --git a/esp-hal/src/i2s.rs b/esp-hal/src/i2s.rs index 469231ca5..74c7a09fe 100644 --- a/esp-hal/src/i2s.rs +++ b/esp-hal/src/i2s.rs @@ -80,6 +80,8 @@ //! - Only master mode is supported. //! - Only TDM Philips standard is supported. +#![allow(missing_docs)] // TODO: Remove when able + use core::marker::PhantomData; use enumset::{EnumSet, EnumSetType}; diff --git a/esp-hal/src/interrupt/mod.rs b/esp-hal/src/interrupt/mod.rs index 1977d7d70..e8ef8d64b 100644 --- a/esp-hal/src/interrupt/mod.rs +++ b/esp-hal/src/interrupt/mod.rs @@ -73,8 +73,6 @@ //! } //! ``` -#![warn(missing_docs)] - use core::ops::BitAnd; #[cfg(riscv)] diff --git a/esp-hal/src/lcd_cam/mod.rs b/esp-hal/src/lcd_cam/mod.rs index c7450d86d..196f81e76 100644 --- a/esp-hal/src/lcd_cam/mod.rs +++ b/esp-hal/src/lcd_cam/mod.rs @@ -5,6 +5,8 @@ //! used simultaneously. For more information on these modules, please refer to //! the documentation in their respective modules. +#![allow(missing_docs)] // TODO: Remove when able + pub mod cam; pub mod lcd; diff --git a/esp-hal/src/ledc/mod.rs b/esp-hal/src/ledc/mod.rs index c1a4fe78a..006308f3d 100644 --- a/esp-hal/src/ledc/mod.rs +++ b/esp-hal/src/ledc/mod.rs @@ -60,6 +60,8 @@ //! - Source clock selection is not supported //! - Interrupts are not supported +#![allow(missing_docs)] // TODO: Remove when able + use self::{ channel::Channel, timer::{Timer, TimerSpeed}, diff --git a/esp-hal/src/lib.rs b/esp-hal/src/lib.rs index 7b2dc0c98..67030eca4 100644 --- a/esp-hal/src/lib.rs +++ b/esp-hal/src/lib.rs @@ -142,7 +142,7 @@ #![allow(asm_sub_register)] #![cfg_attr(feature = "async", allow(stable_features, async_fn_in_trait))] #![cfg_attr(xtensa, feature(asm_experimental_arch))] -#![deny(rust_2018_idioms)] +#![deny(missing_docs, rust_2018_idioms)] #![no_std] // MUST be the first module @@ -601,6 +601,7 @@ pub struct FlashSafeDma { } impl FlashSafeDma { + /// Create a new instance wrapping a given buffer pub fn new(inner: T) -> Self { Self { inner, @@ -608,14 +609,17 @@ impl FlashSafeDma { } } + /// Return a mutable reference to the inner buffer pub fn inner_mut(&mut self) -> &mut T { &mut self.inner } + /// Return an immutable reference to the inner buffer pub fn inner(&self) -> &T { &self.inner } + /// Free the inner buffer pub fn free(self) -> T { self.inner } diff --git a/esp-hal/src/mcpwm/mod.rs b/esp-hal/src/mcpwm/mod.rs index 4f8c3ad77..43b58667b 100644 --- a/esp-hal/src/mcpwm/mod.rs +++ b/esp-hal/src/mcpwm/mod.rs @@ -83,8 +83,6 @@ //! # } //! ``` -#![deny(missing_docs)] - use core::{marker::PhantomData, ops::Deref}; use fugit::HertzU32; diff --git a/esp-hal/src/otg_fs.rs b/esp-hal/src/otg_fs.rs index 235cf9d3c..62132428b 100644 --- a/esp-hal/src/otg_fs.rs +++ b/esp-hal/src/otg_fs.rs @@ -36,6 +36,8 @@ //! ## Implementation State //! - Low-speed (LS) is not supported. +#![allow(missing_docs)] // TODO: Remove when able + pub use esp_synopsys_usb_otg::UsbBus; use esp_synopsys_usb_otg::UsbPeripheral; diff --git a/esp-hal/src/parl_io.rs b/esp-hal/src/parl_io.rs index 8d0194c90..309ac6a22 100644 --- a/esp-hal/src/parl_io.rs +++ b/esp-hal/src/parl_io.rs @@ -23,8 +23,6 @@ //! //! [Parallel IO TX]: https://github.com/esp-rs/esp-hal/blob/main/examples/src/bin/parl_io_tx.rs -#![warn(missing_docs)] - use core::marker::PhantomData; use enumset::{EnumSet, EnumSetType}; diff --git a/esp-hal/src/pcnt/mod.rs b/esp-hal/src/pcnt/mod.rs index 8afae49f9..36f7d6fdd 100644 --- a/esp-hal/src/pcnt/mod.rs +++ b/esp-hal/src/pcnt/mod.rs @@ -20,6 +20,8 @@ //! [unit]: unit/index.html //! [PCNT Encoder]: https://github.com/esp-rs/esp-hal/blob/main/examples/src/bin/pcnt_encoder.rs +#![allow(missing_docs)] // TODO: Remove when able + use self::unit::Unit; use crate::{ interrupt::{self, InterruptHandler}, diff --git a/esp-hal/src/peripheral.rs b/esp-hal/src/peripheral.rs index da05b07c5..05824c5a5 100644 --- a/esp-hal/src/peripheral.rs +++ b/esp-hal/src/peripheral.rs @@ -46,6 +46,7 @@ pub struct PeripheralRef<'a, T> { } impl<'a, T> PeripheralRef<'a, T> { + /// Create a new exclusive reference to a peripheral #[inline] pub fn new(inner: T) -> Self { Self { diff --git a/esp-hal/src/reset.rs b/esp-hal/src/reset.rs index a1b18f62f..5b3486769 100644 --- a/esp-hal/src/reset.rs +++ b/esp-hal/src/reset.rs @@ -17,6 +17,7 @@ use crate::rtc_cntl::SocResetReason; +/// Source of the wakeup event #[derive(Debug, Copy, Clone)] pub enum SleepSource { /// In case of deep sleep, reset was not caused by exit from deep sleep diff --git a/esp-hal/src/rmt.rs b/esp-hal/src/rmt.rs index eb2b43a27..d28356990 100644 --- a/esp-hal/src/rmt.rs +++ b/esp-hal/src/rmt.rs @@ -79,8 +79,6 @@ //! (on ESP32 and ESP32-S2 you cannot specify a base frequency other than 80 //! MHz) -#![warn(missing_docs)] - use core::marker::PhantomData; use fugit::HertzU32; diff --git a/esp-hal/src/rsa/mod.rs b/esp-hal/src/rsa/mod.rs index 943fd5c3b..a9496b41d 100644 --- a/esp-hal/src/rsa/mod.rs +++ b/esp-hal/src/rsa/mod.rs @@ -34,6 +34,8 @@ //! [nb]: https://docs.rs/nb/1.1.0/nb/ //! [the repository with corresponding example]: https://github.com/esp-rs/esp-hal/blob/main/hil-test/tests/rsa.rs +#![allow(missing_docs)] // TODO: Remove when able + use core::{marker::PhantomData, ptr::copy_nonoverlapping}; use crate::{ diff --git a/esp-hal/src/rtc_cntl/mod.rs b/esp-hal/src/rtc_cntl/mod.rs index 22a99efac..db6a05636 100644 --- a/esp-hal/src/rtc_cntl/mod.rs +++ b/esp-hal/src/rtc_cntl/mod.rs @@ -69,6 +69,8 @@ //! } //! ``` +#![allow(missing_docs)] // TODO: Remove when able + #[cfg(not(any(esp32c6, esp32h2)))] use fugit::HertzU32; use fugit::MicrosDurationU64; diff --git a/esp-hal/src/sha.rs b/esp-hal/src/sha.rs index 26364ad59..89474222b 100644 --- a/esp-hal/src/sha.rs +++ b/esp-hal/src/sha.rs @@ -57,6 +57,8 @@ //! ## Implementation State //! - DMA-SHA Mode is not supported. +#![allow(missing_docs)] // TODO: Remove when able + use core::{convert::Infallible, marker::PhantomData}; use crate::{ diff --git a/esp-hal/src/soc/mod.rs b/esp-hal/src/soc/mod.rs index 1e7c93b41..8f2b49538 100644 --- a/esp-hal/src/soc/mod.rs +++ b/esp-hal/src/soc/mod.rs @@ -1,3 +1,5 @@ +#![allow(missing_docs)] // TODO: Remove when able + use portable_atomic::{AtomicU8, Ordering}; pub use self::implementation::*; diff --git a/esp-hal/src/spi/mod.rs b/esp-hal/src/spi/mod.rs index 0335284f5..c3da24442 100644 --- a/esp-hal/src/spi/mod.rs +++ b/esp-hal/src/spi/mod.rs @@ -9,6 +9,8 @@ //! more information on these modes, please refer to the documentation in their //! respective modules. +#![allow(missing_docs)] // TODO: Remove when able + use crate::dma::DmaError; pub mod master; diff --git a/esp-hal/src/system.rs b/esp-hal/src/system.rs index 8eb105dd3..da49a3e21 100755 --- a/esp-hal/src/system.rs +++ b/esp-hal/src/system.rs @@ -29,6 +29,8 @@ //! # } //! ``` +#![allow(missing_docs)] // TODO: Remove when able + use crate::{ interrupt::InterruptHandler, peripheral::PeripheralRef, diff --git a/esp-hal/src/time.rs b/esp-hal/src/time.rs index 26ad31803..ba05a694e 100644 --- a/esp-hal/src/time.rs +++ b/esp-hal/src/time.rs @@ -10,7 +10,6 @@ //! let time = time::current_time(); //! # } //! ``` -#![warn(missing_docs)] /// Provides time since system start in microseconds precision /// diff --git a/esp-hal/src/timer/mod.rs b/esp-hal/src/timer/mod.rs index 5cf439110..4946d0111 100644 --- a/esp-hal/src/timer/mod.rs +++ b/esp-hal/src/timer/mod.rs @@ -38,8 +38,6 @@ //! # } //! ``` -#![deny(missing_docs)] - use fugit::{ExtU64, Instant, MicrosDurationU64}; use crate::{ diff --git a/esp-hal/src/touch.rs b/esp-hal/src/touch.rs index ed3215fb0..8aa502169 100644 --- a/esp-hal/src/touch.rs +++ b/esp-hal/src/touch.rs @@ -27,8 +27,6 @@ //! - Touch sensor slope control //! - Deep Sleep support (wakeup from Deep Sleep) -#![deny(missing_docs)] - use core::marker::PhantomData; use crate::{ diff --git a/esp-hal/src/trace.rs b/esp-hal/src/trace.rs index 3bd26c7b0..a0c735b1e 100644 --- a/esp-hal/src/trace.rs +++ b/esp-hal/src/trace.rs @@ -42,13 +42,16 @@ use crate::{ /// Errors returned from [Trace::stop_trace] #[derive(Debug, Clone, Copy)] pub enum Error { + /// Attempted to stop a trace which had not been started yet NotStarted, } /// Returned by [Trace::stop_trace] #[derive(Debug, Clone, Copy)] pub struct TraceResult { + /// Start index of the valid data pub valid_start_index: usize, + /// Length of the valid data pub valid_length: usize, } @@ -200,7 +203,9 @@ where } } +/// Trace peripheral instance pub trait Instance: crate::private::Sealed { + /// Get a reference to the peripheral's underlying register block fn register_block(&self) -> &RegisterBlock; } diff --git a/esp-hal/src/twai/mod.rs b/esp-hal/src/twai/mod.rs index bf588080c..0953b5434 100644 --- a/esp-hal/src/twai/mod.rs +++ b/esp-hal/src/twai/mod.rs @@ -129,6 +129,8 @@ //! # } //! ``` +#![allow(missing_docs)] // TODO: Remove when able + use core::marker::PhantomData; use self::filter::{Filter, FilterType}; diff --git a/esp-hal/src/uart.rs b/esp-hal/src/uart.rs index e2395b0f5..2d15d321c 100644 --- a/esp-hal/src/uart.rs +++ b/esp-hal/src/uart.rs @@ -118,6 +118,8 @@ //! [embedded-hal-async]: https://docs.rs/embedded-hal-async/latest/embedded_hal_async/ //! [embedded-io-async]: https://docs.rs/embedded-io-async/latest/embedded_io_async/ +#![allow(missing_docs)] // TODO: Remove when able + use core::marker::PhantomData; use self::config::Config; diff --git a/esp-hal/src/usb_serial_jtag.rs b/esp-hal/src/usb_serial_jtag.rs index fd615bded..83df2bb04 100644 --- a/esp-hal/src/usb_serial_jtag.rs +++ b/esp-hal/src/usb_serial_jtag.rs @@ -338,6 +338,7 @@ where self.tx.flush_tx_nb() } + /// Read a single byte but don't block if it isn't ready immediately pub fn read_byte(&mut self) -> nb::Result { self.rx.read_byte() }