Skip to main content

ProtectedModify

Trait ProtectedModify 

Source
pub trait ProtectedModify<T: Copy> {
    // Required method
    fn protected_modify(&self, f: impl FnOnce(&mut T));

    // Provided method
    fn is_protected(&self) -> bool { ... }
}
Expand description

Provides a function to disable write protection for a single modify operation on a register.

Required Methods§

Source

fn protected_modify(&self, f: impl FnOnce(&mut T))

Performs a modify operation on a register, disabling WP before and enabling it after.

Provided Methods§

Source

fn is_protected(&self) -> bool

§Returns
  • true if this register is currently write protected.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ProtectedModify<Icmr3> for Reg<Icmr3, RW>

Available on iic only.
Source§

fn is_protected(&self) -> bool

Source§

fn protected_modify(&self, func: impl FnOnce(&mut Icmr3))

Source§

impl ProtectedModify<Pin> for Reg<Pin, RW>

Source§

fn is_protected(&self) -> bool

Source§

fn protected_modify(&self, func: impl FnOnce(&mut Pin))

Implementors§