pub struct SpeedSwitch(/* private fields */);Available on crate feature
cgb only.Expand description
CPU speed switch (KEY1).
| Bit | Field | Access | Meaning |
|---|---|---|---|
| 7 | double_speed | RO | Currently in CGB double speed mode. |
| 6-1 | — | Unused. | |
| 0 | armed | R/W | Arm a speed switch; it takes effect on the next STOP. |
Implementations§
Source§impl SpeedSwitch
impl SpeedSwitch
Sourcepub const fn armed(&self) -> bool
pub const fn armed(&self) -> bool
Arm a speed switch; it takes effect on the next STOP.
Bits: 0..1
Sourcepub const fn with_armed_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_armed_checked(self, value: bool) -> Result<Self, ()>
Arm a speed switch; it takes effect on the next STOP.
Bits: 0..1
Sourcepub const fn with_armed(self, value: bool) -> Self
pub const fn with_armed(self, value: bool) -> Self
Arm a speed switch; it takes effect on the next STOP.
Bits: 0..1
Sourcepub const fn set_armed(&mut self, value: bool)
pub const fn set_armed(&mut self, value: bool)
Arm a speed switch; it takes effect on the next STOP.
Bits: 0..1
Sourcepub const fn set_armed_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_armed_checked(&mut self, value: bool) -> Result<(), ()>
Arm a speed switch; it takes effect on the next STOP.
Bits: 0..1
Sourcepub const fn double_speed(&self) -> bool
pub const fn double_speed(&self) -> bool
Currently in CGB double speed mode (read-only).
Bits: 7..8
Trait Implementations§
Source§impl Clone for SpeedSwitch
impl Clone for SpeedSwitch
Source§fn clone(&self) -> SpeedSwitch
fn clone(&self) -> SpeedSwitch
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SpeedSwitch
Source§impl Debug for SpeedSwitch
impl Debug for SpeedSwitch
Source§impl Default for SpeedSwitch
impl Default for SpeedSwitch
impl Eq for SpeedSwitch
Source§impl From<SpeedSwitch> for u8
impl From<SpeedSwitch> for u8
Source§fn from(v: SpeedSwitch) -> Self
fn from(v: SpeedSwitch) -> Self
Converts to this type from the input type.
Source§impl From<u8> for SpeedSwitch
impl From<u8> for SpeedSwitch
Source§impl PartialEq for SpeedSwitch
impl PartialEq for SpeedSwitch
impl StructuralPartialEq for SpeedSwitch
Auto Trait Implementations§
impl BankSafe for SpeedSwitch
impl Freeze for SpeedSwitch
impl RefUnwindSafe for SpeedSwitch
impl Send for SpeedSwitch
impl Sync for SpeedSwitch
impl Unpin for SpeedSwitch
impl UnsafeUnpin for SpeedSwitch
impl UnwindSafe for SpeedSwitch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more