diff --git a/esp-hal/src/aes/mod.rs b/esp-hal/src/aes/mod.rs index c955c51e5fd..8028b8d518a 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 714642f7db9..cac201b4c04 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 af1f19d0a46..eec20041cb1 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 38df8650737..5ad8fd6095e 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 43424bad9e6..0d3f6df28f2 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 ea35a9cc70e..cca60eda286 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 762843bc37e..01861176bf0 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 f2b37a83048..abbf1e9e387 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 643df5541e1..a81f86a8c65 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 4a53db16452..0a9258c395c 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 1977d7d7070..e8ef8d64bc0 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 ec1b2b3b334..d5f248ced06 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 58a1650eb8f..184b2f0b3a7 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 7b2dc0c98eb..67030eca416 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 7ebfedf48ee..d134d729de4 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 75c4c0c0b23..71b80b1eb2b 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 af1bd40da57..2d46017a4ad 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 8bd28fe33d7..c8c04c949d6 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 da05b07c551..05824c5a556 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 a1b18f62fce..5b3486769d6 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 1d1d288f0ef..92476de3399 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 8a0afd88364..cb3fc1624fd 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 22a99efac97..db6a056361f 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 7e2b276c9ef..692f04b8069 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 1e7c93b41a2..8f2b49538e4 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 0335284f566..c3da24442b2 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 8eb105dd3c2..da49a3e2196 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 26ad3180359..ba05a694ec1 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 5cf4391105f..4946d0111e6 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 ed3215fb082..8aa5021695a 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 ef6d2a35ca0..f99f9dd74b9 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, } @@ -199,7 +202,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 9b8350803f4..280a7128ae3 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 e2395b0f51d..2d15d321c89 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 70d6d2f06a3..f148f76db70 100644 --- a/esp-hal/src/usb_serial_jtag.rs +++ b/esp-hal/src/usb_serial_jtag.rs @@ -337,6 +337,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() }