Struct d1_pac::rtc::losc_ctrl::W

source ·
pub struct W(/* private fields */);
Expand description

Register losc_ctrl writer

Implementations§

source§

impl W

source

pub fn losc_src_sel(&mut self) -> LOSC_SRC_SEL_W<'_, 0>

Bit 0 - LOSC Clock Source Select

source

pub fn rtc_src_sel(&mut self) -> RTC_SRC_SEL_W<'_, 1>

Bit 1 - RTC_TIMER Clock Source Select

source

pub fn ext_losc_gsm(&mut self) -> EXT_LOSC_GSM_W<'_, 2>

Bits 2:3 - External 32.768 kHz Crystal GSM

When GSM is changed, the 32K oscillation circuit will arise transient instability. If the autoswitch function (bit 15) is enabled, 32K changes to RC16M with certain probability. The GSM can influence the time of 32K starting oscillation, the more the GSM, the shorter the time of starting oscillation. So modifying GSM is not recommended.

If you need to modify the GSM, firstly disable the auto switch function (bit 15), with a delay of 50 us, then change the GSM, the 32K clock source is changed to external clock.

source

pub fn ext_losc_en(&mut self) -> EXT_LOSC_EN_W<'_, 4>

Bit 4 - External 32.768 kHz Crystal Enable

source

pub fn rtc_day_acce(&mut self) -> RTC_DAY_ACCE_W<'_, 7>

Bit 7 - RTC DAY access

After writing the RTC DAY register, this bit is set and it will be cleared until the real writing operation is finished. After writing the RTC DAY register, the DAY register will be refreshed for at most one second.

Note: Make sure that the bit is 0 for time configuration.

source

pub fn rtc_hhmmss_acce(&mut self) -> RTC_HHMMSS_ACCE_W<'_, 8>

Bit 8 - RTC Hour Minute Second access

After writing the RTC HH-MM-SS Register, this bit is set and it will be cleared until the real writing operation is finished. After writing the RTC HH-MM-SS Register, the RTC HH-MM-SS Register will be refreshed for at most one second.

Note: Make sure that the bit is 0 for time configuration.

source

pub fn losc_auto_swt_32k_sel_en(&mut self) -> LOSC_AUTO_SWT_32K_SEL_EN_W<'_, 14>

Bit 14 - LOSC auto switch 32K clk source select enable

source

pub fn losc_auto_swt_function(&mut self) -> LOSC_AUTO_SWT_FUNCTION_W<'_, 15>

Bit 15 - LOSC auto switch function disable

source

pub fn key_field(&mut self) -> KEY_FIELD_W<'_, 16>

Bits 16:31 - Key Field

This field should be filled with 0x16AA, and then the bit0 and bit1 can be written with the new value.

source

pub unsafe fn bits(&mut self, bits: u32) -> &mut Self

Writes raw bits to the register.

Methods from Deref<Target = W<LOSC_CTRL_SPEC>>§

source

pub unsafe fn bits(&mut self, bits: REG::Ux) -> &mut Self

Writes raw bits to the register.

§Safety

Read datasheet or reference manual to find what values are allowed to pass.

Trait Implementations§

source§

impl Deref for W

§

type Target = W<LOSC_CTRL_SPEC>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for W

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl From<W<LOSC_CTRL_SPEC>> for W

source§

fn from(writer: W<LOSC_CTRL_SPEC>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for W

§

impl RefUnwindSafe for W

§

impl Send for W

§

impl Sync for W

§

impl Unpin for W

§

impl UnwindSafe for W

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.