pub struct DisplayStatusValue(/* private fields */);
Expand description
Relates to the status of the display.
When writing this value to DISPSTAT
, the vblank
, hblank
, and
vcounter
settings aren’t actually written. They can still be modified on
this type if you want to set up a specific value and then check for equality
or something.
Setting the interrupt related flags is dangerous if your interrupt handler
isn’t set up to handle the appropriate types of interrupts. Even if you set
for interrupt types to occur here they won’t fire unless you also enable
them in the IME
register, and of course you must have interrupts enabled
overall using the IE
register.
vblank
: Set duringVCOUNT
lines 160 to 226, but not 227.hblank
: Set when you’re in hblank, after the current line has completed drawing. It takes 960 cycles to draw a line, but GBATEK says that this is off for 1006 cycles per line.vcounter
: Set if the currentVCOUNT
value matches thevcount_trigger
value.vblank_irq
: If an interrupt should be triggered at start of vblank.hblank_irq
: If an interrupt should be triggered at start of hblank.vcounter_irq
: If an interrupt should be triggered whenVCOUNT
matches thevcount_trigger
value.vcount_trigger
: The scanline that you want to use for vcount interrupts and thevcounter
flag.
Implementations§
Source§impl DisplayStatusValue
impl DisplayStatusValue
pub const fn new() -> Self
pub const fn vblank(self) -> bool
pub const fn with_vblank(self, b: bool) -> Self
pub fn set_vblank(&mut self, b: bool)
pub const fn hblank(self) -> bool
pub const fn with_hblank(self, b: bool) -> Self
pub fn set_hblank(&mut self, b: bool)
pub const fn vcounter(self) -> bool
pub const fn with_vcounter(self, b: bool) -> Self
pub fn set_vcounter(&mut self, b: bool)
pub const fn vblank_irq(self) -> bool
pub const fn with_vblank_irq(self, b: bool) -> Self
pub fn set_vblank_irq(&mut self, b: bool)
pub const fn hblank_irq(self) -> bool
pub const fn with_hblank_irq(self, b: bool) -> Self
pub fn set_hblank_irq(&mut self, b: bool)
pub const fn vcounter_irq(self) -> bool
pub const fn with_vcounter_irq(self, b: bool) -> Self
pub fn set_vcounter_irq(&mut self, b: bool)
pub const fn vcount_trigger(self) -> u16
pub const fn with_vcount_trigger(self, u: u16) -> Self
pub fn set_vcount_trigger(&mut self, u: u16)
Trait Implementations§
Source§impl Clone for DisplayStatusValue
impl Clone for DisplayStatusValue
Source§fn clone(&self) -> DisplayStatusValue
fn clone(&self) -> DisplayStatusValue
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for DisplayStatusValue
impl Debug for DisplayStatusValue
Source§impl Default for DisplayStatusValue
impl Default for DisplayStatusValue
Source§fn default() -> DisplayStatusValue
fn default() -> DisplayStatusValue
Returns the “default value” for a type. Read more
Source§impl PartialEq for DisplayStatusValue
impl PartialEq for DisplayStatusValue
impl Copy for DisplayStatusValue
impl Eq for DisplayStatusValue
impl StructuralPartialEq for DisplayStatusValue
Auto Trait Implementations§
impl Freeze for DisplayStatusValue
impl RefUnwindSafe for DisplayStatusValue
impl Send for DisplayStatusValue
impl Sync for DisplayStatusValue
impl Unpin for DisplayStatusValue
impl UnwindSafe for DisplayStatusValue
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