Minor documentation improvements for esp-radio (#3986)

* Use correct spelling/case for Wi-Fi in docs

* Link to functions mentioned in doc comments
This commit is contained in:
Jesse Braham 2025-08-26 01:44:45 -07:00 committed by GitHub
parent d1681ab1f9
commit 5e1648f338
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 34 additions and 34 deletions

View File

@ -72,7 +72,7 @@ fn main() -> Result<(), Box<dyn Error>> {
!cfg!(feature = "wifi") || chip.contains("wifi"),
r#"
WiFi is not supported on this target.
Wi-Fi is not supported on this target.
"#
);
@ -104,7 +104,7 @@ fn main() -> Result<(), Box<dyn Error>> {
chip.contains("wifi") && chip.contains("bt"),
r#"
WiFi/Bluetooth coexistence is not supported on this target.
Wi-Fi/Bluetooth coexistence is not supported on this target.
"#
);

View File

@ -1,6 +1,6 @@
#[derive(Debug)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
/// Tunable parameters for the WiFi driver
/// Tunable parameters for the Wi-Fi driver
#[allow(unused)] // currently there are no ble tunables
pub(crate) struct Config {
pub(crate) rx_queue_size: usize,

View File

@ -340,7 +340,7 @@ pub struct EspNowManager<'d> {
}
impl EspNowManager<'_> {
/// Set primary WiFi channel.
/// Set primary Wi-Fi channel.
/// Should only be used when using ESP-NOW without AP or STA.
#[instability::unstable]
pub fn set_channel(&self, channel: u8) -> Result<(), EspNowError> {
@ -702,7 +702,7 @@ impl<'d> EspNow<'d> {
(self.manager, self.sender, self.receiver)
}
/// Set primary WiFi channel.
/// Set primary Wi-Fi channel.
/// Should only be used when using ESP-NOW without AP or STA.
#[instability::unstable]
pub fn set_channel(&self, channel: u8) -> Result<(), EspNowError> {

View File

@ -45,7 +45,7 @@
//! a feature flag of the `log` crate. See [documentation](https://docs.rs/log/0.4.19/log/#compile-time-filters).
//! You should set it to `release_max_level_off`.
//!
//! ### WiFi performance considerations
//! ### Wi-Fi performance considerations
//!
//! The default configuration is quite conservative to reduce power and memory consumption.
//!
@ -251,7 +251,7 @@ impl Drop for Controller<'_> {
}
}
/// Initialize for using WiFi and or BLE.
/// Initialize for using Wi-Fi and or BLE.
///
/// Make sure to **not** call this function while interrupts are disabled.
pub fn init<'d>() -> Result<Controller<'d>, InitializationError> {
@ -268,7 +268,7 @@ pub fn init<'d>() -> Result<Controller<'d>, InitializationError> {
return Err(InitializationError::SchedulerNotInitialized);
}
// A minimum clock of 80MHz is required to operate WiFi module.
// A minimum clock of 80MHz is required to operate Wi-Fi module.
const MIN_CLOCK: Rate = Rate::from_mhz(80);
let clocks = Clocks::get();
if clocks.cpu_clock < MIN_CLOCK {
@ -320,7 +320,7 @@ pub enum InitializationError {
/// A general error occurred.
/// The internal error code is reported.
General(i32),
/// An error from the WiFi driver.
/// An error from the Wi-Fi driver.
#[cfg(feature = "wifi")]
WifiError(WifiError),
/// The current CPU clock frequency is too low.
@ -342,7 +342,7 @@ impl From<WifiError> for InitializationError {
}
}
/// Enable verbose logging within the WiFi driver
/// Enable verbose logging within the Wi-Fi driver
/// Does nothing unless the `sys-logs` feature is enabled.
#[instability::unstable]
pub fn wifi_set_log_verbose() {

View File

@ -1,4 +1,4 @@
//! WiFi
//! Wi-Fi
#![deny(missing_docs)]
@ -908,7 +908,7 @@ impl AuthMethodExt for AuthMethod {
}
}
/// Wifi Mode (Sta and/or Ap)
/// Wi-Fi Mode (Sta and/or Ap)
#[derive(Debug, Clone, Copy, PartialEq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
@ -1208,7 +1208,7 @@ pub enum WifiError {
InvalidArguments,
}
/// Events generated by the WiFi driver.
/// Events generated by the Wi-Fi driver.
#[derive(Debug, FromPrimitive, EnumSetType)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[non_exhaustive]
@ -1328,28 +1328,28 @@ pub enum InternalWifiError {
/// Invalid argument
InvalidArg = 0x102,
/// WiFi driver was not installed by esp_wifi_init
/// Wi-Fi driver was not installed by [esp_wifi_init](crate::binary::include::esp_wifi_init)
NotInit = 0x3001,
/// WiFi driver was not started by esp_wifi_start
/// Wi-Fi driver was not started by [esp_wifi_start]
NotStarted = 0x3002,
/// WiFi driver was not stopped by esp_wifi_stop
/// Wi-Fi driver was not stopped by [esp_wifi_stop]
NotStopped = 0x3003,
/// WiFi interface error
/// Wi-Fi interface error
Interface = 0x3004,
/// WiFi mode error
/// Wi-Fi mode error
Mode = 0x3005,
/// WiFi internal state error
/// Wi-Fi internal state error
State = 0x3006,
/// WiFi internal control block of station or soft-AP error
/// Wi-Fi internal control block of station or soft-AP error
Conn = 0x3007,
/// WiFi internal NVS module error
/// Wi-Fi internal NVS module error
Nvs = 0x3008,
/// MAC address is invalid
@ -1364,7 +1364,7 @@ pub enum InternalWifiError {
/// Timeout error
Timeout = 0x300C,
/// WiFi is in sleep state (RF closed) and wakeup failed
/// Wi-Fi is in sleep state (RF closed) and wakeup failed
WakeFail = 0x300D,
/// The caller would block
@ -1373,19 +1373,19 @@ pub enum InternalWifiError {
/// Station still in disconnect status
NotConnected = 0x300F,
/// Failed to post the event to WiFi task
/// Failed to post the event to Wi-Fi task
PostFail = 0x3012,
/// Invalid WiFi state when init/deinit is called
/// Invalid Wi-Fi state when init/deinit is called
InvalidInitState = 0x3013,
/// Returned when WiFi is stopping
/// Returned when Wi-Fi is stopping
StopState = 0x3014,
/// The WiFi connection is not associated
/// The Wi-Fi connection is not associated
NotAssociated = 0x3015,
/// The WiFi TX is disallowed
/// The Wi-Fi TX is disallowed
TxDisallowed = 0x3016,
}
@ -1588,7 +1588,7 @@ pub(crate) fn wifi_start() -> Result<(), WifiError> {
Ok(())
}
/// Configuration for active or passive scan. For details see the [WIFI Alliance FAQ](https://www.wi-fi.org/knowledge-center/faq/what-are-passive-and-active-scanning).
/// Configuration for active or passive scan. For details see the [Wi-Fi Alliance FAQ](https://www.wi-fi.org/knowledge-center/faq/what-are-passive-and-active-scanning).
///
/// # Comparison of active and passive scan
///
@ -2154,7 +2154,7 @@ unsafe extern "C" fn promiscuous_rx_cb(buf: *mut core::ffi::c_void, frame_type:
#[cfg(all(feature = "sniffer", feature = "unstable"))]
#[instability::unstable]
/// A wifi sniffer.
/// A Wi-Fi sniffer.
#[non_exhaustive]
pub struct Sniffer {}
@ -2297,7 +2297,7 @@ impl WifiTxToken {
{
self.mode.increase_in_flight_counter();
// (safety): creation of multiple WiFi devices with the same mode is impossible
// (safety): creation of multiple Wi-Fi devices with the same mode is impossible
// in safe Rust, therefore only smoltcp _or_ embassy-net can be used at
// one time
static mut BUFFER: [u8; MTU] = [0u8; MTU];
@ -2701,9 +2701,9 @@ pub struct Interfaces<'d> {
pub sniffer: Sniffer,
}
/// Create a WiFi controller and it's associated interfaces.
/// Create a Wi-Fi controller and it's associated interfaces.
///
/// Dropping the controller will deinitialize / stop WiFi.
/// Dropping the controller will deinitialize / stop Wi-Fi.
///
/// Make sure to **not** call this function while interrupts are disabled, or IEEE 802.15.4 is
/// currently in use.
@ -3185,7 +3185,7 @@ pub(crate) struct WifiEventFuture {
}
impl WifiEventFuture {
/// Creates a new `Future` for the specified WiFi event.
/// Creates a new `Future` for the specified Wi-Fi event.
pub fn new(event: WifiEvent) -> Self {
Self { event }
}
@ -3213,7 +3213,7 @@ pub(crate) struct MultiWifiEventFuture {
}
impl MultiWifiEventFuture {
/// Creates a new `Future` for the specified set of WiFi events.
/// Creates a new `Future` for the specified set of Wi-Fi events.
pub fn new(event: EnumSet<WifiEvent>) -> Self {
Self { event }
}