pub struct SerialCtrl(/* private fields */);Expand description
Serial transfer control (SC).
| Bit | Field | Access | Meaning |
|---|---|---|---|
| 7 | transfer_enable | R/W | Transfer requested / in progress. |
| 6-2 | — | Unused. | |
| 1 | clock_speed | R/W | Fast clock (CGB only). |
| 0 | clock_select | R/W | Use the internal clock (this Game Boy drives the transfer). |
Implementations§
Source§impl SerialCtrl
impl SerialCtrl
Sourcepub const fn clock_select(&self) -> bool
pub const fn clock_select(&self) -> bool
Use the internal clock (this Game Boy drives the transfer).
Bits: 0..1
Sourcepub const fn with_clock_select_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_clock_select_checked(self, value: bool) -> Result<Self, ()>
Use the internal clock (this Game Boy drives the transfer).
Bits: 0..1
Sourcepub const fn with_clock_select(self, value: bool) -> Self
pub const fn with_clock_select(self, value: bool) -> Self
Use the internal clock (this Game Boy drives the transfer).
Bits: 0..1
Sourcepub const fn set_clock_select(&mut self, value: bool)
pub const fn set_clock_select(&mut self, value: bool)
Use the internal clock (this Game Boy drives the transfer).
Bits: 0..1
Sourcepub const fn set_clock_select_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_clock_select_checked(&mut self, value: bool) -> Result<(), ()>
Use the internal clock (this Game Boy drives the transfer).
Bits: 0..1
Sourcepub const fn clock_speed(&self) -> bool
pub const fn clock_speed(&self) -> bool
Fast clock (CGB only).
Bits: 1..2
Sourcepub const fn with_clock_speed_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_clock_speed_checked(self, value: bool) -> Result<Self, ()>
Fast clock (CGB only).
Bits: 1..2
Sourcepub const fn with_clock_speed(self, value: bool) -> Self
pub const fn with_clock_speed(self, value: bool) -> Self
Fast clock (CGB only).
Bits: 1..2
Sourcepub const fn set_clock_speed(&mut self, value: bool)
pub const fn set_clock_speed(&mut self, value: bool)
Fast clock (CGB only).
Bits: 1..2
Sourcepub const fn set_clock_speed_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_clock_speed_checked(&mut self, value: bool) -> Result<(), ()>
Fast clock (CGB only).
Bits: 1..2
Sourcepub const fn transfer_enable(&self) -> bool
pub const fn transfer_enable(&self) -> bool
Transfer requested / in progress.
Bits: 7..8
Sourcepub const fn with_transfer_enable_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_transfer_enable_checked(self, value: bool) -> Result<Self, ()>
Transfer requested / in progress.
Bits: 7..8
Sourcepub const fn with_transfer_enable(self, value: bool) -> Self
pub const fn with_transfer_enable(self, value: bool) -> Self
Transfer requested / in progress.
Bits: 7..8
Sourcepub const fn set_transfer_enable(&mut self, value: bool)
pub const fn set_transfer_enable(&mut self, value: bool)
Transfer requested / in progress.
Bits: 7..8
Trait Implementations§
Source§impl Clone for SerialCtrl
impl Clone for SerialCtrl
Source§fn clone(&self) -> SerialCtrl
fn clone(&self) -> SerialCtrl
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 SerialCtrl
Source§impl Debug for SerialCtrl
impl Debug for SerialCtrl
Source§impl Default for SerialCtrl
impl Default for SerialCtrl
impl Eq for SerialCtrl
Source§impl From<SerialCtrl> for u8
impl From<SerialCtrl> for u8
Source§fn from(v: SerialCtrl) -> Self
fn from(v: SerialCtrl) -> Self
Converts to this type from the input type.
Source§impl From<u8> for SerialCtrl
impl From<u8> for SerialCtrl
Source§impl PartialEq for SerialCtrl
impl PartialEq for SerialCtrl
impl StructuralPartialEq for SerialCtrl
Auto Trait Implementations§
impl BankSafe for SerialCtrl
impl Freeze for SerialCtrl
impl RefUnwindSafe for SerialCtrl
impl Send for SerialCtrl
impl Sync for SerialCtrl
impl Unpin for SerialCtrl
impl UnsafeUnpin for SerialCtrl
impl UnwindSafe for SerialCtrl
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