Skip to content

Commit

Permalink
Point to usage examples (#2349)
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani authored Oct 15, 2024
1 parent da9c0b0 commit f0a361e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
19 changes: 10 additions & 9 deletions esp-hal/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
//! # Configuration
//!
//! ## Overview
//! This module contains the initial configuation for the system.
//! This module contains the initial configuration for the system.
//!
//! ## Configuration
//! In the esp_hal::init method, we can configure different parameters for the
//! system:
//! In the [`esp_hal::init()`][crate::init] method, we can configure different
//! parameters for the system:
//! - CPU clock configuration.
//! - Watchdog configuration.
//!
//! ## Example
//! ## Examples
//!
//! ### Default initialization
//!
Expand Down Expand Up @@ -40,20 +40,21 @@ pub enum WatchdogStatus {
Disabled,
}

/// Watchdogs configuration.
/// Watchdog configuration.
#[non_exhaustive]
#[derive(Default)]
pub struct WatchdogConfig {
#[cfg(not(any(esp32, esp32s2)))]
/// Enable the super watchdog timer, which is slightly less than one second.
/// Enable the super watchdog timer, which has a trigger time of slightly
/// less than one second.
pub swd: bool,
/// Configures the reset watchdog timer.
pub rwdt: WatchdogStatus,
/// Configures the timg0 watchdog timer.
/// Configures the `timg0` watchdog timer.
pub timg0: WatchdogStatus,
#[cfg(timg1)]
/// Configures the timg1 watchdog timer.
/// Configures the `timg1` watchdog timer.
///
/// By default, the bootloader does not enables this watchdog timer.
/// By default, the bootloader does not enable this watchdog timer.
pub timg1: WatchdogStatus,
}
7 changes: 7 additions & 0 deletions esp-hal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,13 @@ use crate::{
};

/// System configuration.
///
/// This `struct` is marked with `#[non_exhaustive]` and can't be instantiated
/// directly. This is done to prevent breaking changes when new fields are added
/// to the `struct`. Instead, use the [`Config::default()`] method to create a
/// new instance.
///
/// For usage examples, see the [config module documentation](crate::config).
#[non_exhaustive]
#[derive(Default)]
pub struct Config {
Expand Down

0 comments on commit f0a361e

Please sign in to comment.