pub struct Xosc32kBase<M: Mode> { /* private fields */ }
Expand description

XOSC32K base clock, which feeds the Xosc1k and Xosc32k clocks

The XOSC32K peripheral has two possible clock outputs, one at 32 kHz and another at 1 kHz. This structure is represented in the type system as a set of three clocks forming a small clock tree. The Xosc32kBase clock represents the configurable base oscillator that feeds the optional Xosc1k and Xosc32k output clocks. See the module-level documentation for details and examples.

Implementations

Create the Xosc32kBase clock from an external clock, taking ownership of the XIn32 Pin

Creating an Xosc32kBase clock does not modify any of the hardware registers. It only creates a struct to track the configuration. The configuration data is stored until the user calls enable. At that point, all of the registers are written according to the initialization procedures specified in the datasheet, and an EnabledXosc32kBase clock is returned. The Xosc32kBase clock is not active or useful until that point.

Consume the Xosc32kBase and release the Xosc32kBaseToken and XIn32 Pin

Create the Xosc32kBase clock from an external crystal oscillator, taking ownership of the XIn32 and XOut32 Pins.

Creating an Xosc32kBase clock does not modify any of the hardware registers. It only creates a struct to track the configuration. The configuration data is stored until the user calls enable. At that point, all of the registers are written according to the initialization procedures specified in the datasheet, and an EnabledXosc32kBase clock is returned. The Xosc32kBase is not active or useful until that point.

Consume the Xosc32kBase and release the Xosc32kBaseToken, XIn32 and XOut32 Pins

Set the crystal oscillator ControlGainMode

Set the start up delay before the Xosc32kBase clock is unmasked and continuously monitored

During the start up period, the Xosc32kBase clock is masked to prevent clock instability from propagating to the digital logic. During this time, clock failure detection is disabled.

Control the XOSC32K on-demand behavior

When the on-demand is enabled, the XOSC32K clocks will only run in Idle or Standby sleep modes if it is requested by a peripheral. Otherwise, its behavior is dependent on the run-standby setting.

Control the XOSC32K behavior in Standby sleep mode

When RUNSTDBY is disabled, the XOSC32K clocks will never run in Standby sleep mode unless ONDEMAND is enabled and a clock is requested by a peripheral.

When RUNSTDBY is enabled, the Xosc will run in Standby sleep mode, but it can still be disabled if ONDEMAND is enabled and a clock is not requested.

Freeze the XOSC32K configuration until power-on reset

This function sets the write-lock bit, which freezes the XOSC32K configuration at the hardware level until power-on reset. At the API level, it also consumes and drops the Xosc32kBase, which prevents any further modifications.

NOTE: Because the Xosc32kBase is not yet enabled, calling this method will lock both the Xosc1k and Xosc32k in their disabled state.

Enable the Xosc32kBase clock, so that it can be used as a clock Source for the Xosc1k and Xosc32k clocks

As mentioned when creating a new Xosc32kBase, no hardware registers are actually modified until this call. Rather, the desired configuration is stored internally, and the Xosc32kBase is initialized and configured here according to the datasheet.

The returned value is an EnabledXosc32kBase that can be used as a clock Source for the Xosc1k and Xosc32k clocks.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.