pub trait Register: Default + Sized {
type T: RegisterValue;
type RegisterBits = RegisterBits<Self>;
const ADDRESS: *mut Self::T;
Show 14 methods
// Provided methods
fn write<V>(value: V)
where V: Into<Self::T> { ... }
fn read() -> Self::T { ... }
fn set(bits: RegisterBits<Self>) { ... }
fn set_mask_raw(mask: Self::T) { ... }
fn unset(bits: RegisterBits<Self>) { ... }
fn unset_mask_raw(mask: Self::T) { ... }
fn toggle(mask: RegisterBits<Self>) { ... }
fn toggle_raw(mask: Self::T) { ... }
fn is_set(bits: RegisterBits<Self>) -> bool { ... }
fn is_mask_set_raw(mask: Self::T) -> bool { ... }
fn is_clear(mask: RegisterBits<Self>) -> bool { ... }
fn is_clear_raw(mask: Self::T) -> bool { ... }
fn wait_until_set(bits: RegisterBits<Self>) { ... }
fn wait_until_mask_set_raw(mask: Self::T) { ... }
}
Expand description
A register.
Required Associated Types§
sourcetype T: RegisterValue
type T: RegisterValue
The type that can represent the value of the register.
Provided Associated Types§
sourcetype RegisterBits = RegisterBits<Self>
type RegisterBits = RegisterBits<Self>
The type representing a set of bits that may be manipulated within the register.
Required Associated Constants§
Provided Methods§
sourcefn set(bits: RegisterBits<Self>)
fn set(bits: RegisterBits<Self>)
Sets a set of bits to 1
in the register.
sourcefn set_mask_raw(mask: Self::T)
fn set_mask_raw(mask: Self::T)
Sets a bitmask in a register.
This is equivalent to r |= mask
.
sourcefn unset(bits: RegisterBits<Self>)
fn unset(bits: RegisterBits<Self>)
Unsets a set of bits in the register.
All of the bits will be set to 0
.
sourcefn unset_mask_raw(mask: Self::T)
fn unset_mask_raw(mask: Self::T)
Clears a bitmask from a register.
This is equivalent to r &= !mask
.
sourcefn toggle(mask: RegisterBits<Self>)
fn toggle(mask: RegisterBits<Self>)
Toggles a set of bits within the register.
All specified bits which were previously 0
will become
1
, and all specified bits that were previous 1
will
become 0
.
sourcefn toggle_raw(mask: Self::T)
fn toggle_raw(mask: Self::T)
Toggles a mask in the register.
This is equivalent to r ^= mask
.
sourcefn is_set(bits: RegisterBits<Self>) -> bool
fn is_set(bits: RegisterBits<Self>) -> bool
Checks if a set of bits are enabled.
All specifed bits must be set for this function
to return true
.
sourcefn is_mask_set_raw(mask: Self::T) -> bool
fn is_mask_set_raw(mask: Self::T) -> bool
Checks if a mask is set in the register.
This is equivalent to (r & mask) == mask
.
sourcefn is_clear(mask: RegisterBits<Self>) -> bool
fn is_clear(mask: RegisterBits<Self>) -> bool
Checks if a set of bits are not set.
All specified bits must be 0
for this
function to return true
.
sourcefn is_clear_raw(mask: Self::T) -> bool
fn is_clear_raw(mask: Self::T) -> bool
Checks if a mask is clear in the register.
This is equivalent to (r & mask) == 0
.
sourcefn wait_until_set(bits: RegisterBits<Self>)
fn wait_until_set(bits: RegisterBits<Self>)
Waits until a set of bits are set in the register.
This function will block until all bits that are set in the mask are also set in the register.
sourcefn wait_until_mask_set_raw(mask: Self::T)
fn wait_until_mask_set_raw(mask: Self::T)
Waits until a bit mask is set in the register.
This function will block until all bits that are set in the mask are also set in the register.