[][src]Struct gba_hal::data::KeyControl

#[repr(transparent)]
pub struct KeyControl(_);

Affects when a key interrupt is triggered.

This is intended for bringing the GBA out of the very-low-power mode, not for general input.

  • There's one bit per button, matching the bits of the KeyInput type.
  • 14: Key interrupts enabled
  • 15: true if all selected keys must be pressed to trigger the interrupt (Logical AND), false if any selected key can be pressed to trigger the interrupt (Logical OR).

Methods

impl KeyControl[src]

pub const fn new() -> Self[src]

A const "zero value" constructor

impl KeyControl[src]

pub const A_BIT: u16[src]

pub const fn a(self) -> bool[src]

pub const fn with_a(self, bit: bool) -> Self[src]

pub const B_BIT: u16[src]

pub const fn b(self) -> bool[src]

pub const fn with_b(self, bit: bool) -> Self[src]

pub const SELECT_BIT: u16[src]

pub const fn select(self) -> bool[src]

pub const fn with_select(self, bit: bool) -> Self[src]

pub const START_BIT: u16[src]

pub const fn start(self) -> bool[src]

pub const fn with_start(self, bit: bool) -> Self[src]

pub const RIGHT_BIT: u16[src]

pub const fn right(self) -> bool[src]

pub const fn with_right(self, bit: bool) -> Self[src]

pub const LEFT_BIT: u16[src]

pub const fn left(self) -> bool[src]

pub const fn with_left(self, bit: bool) -> Self[src]

pub const UP_BIT: u16[src]

pub const fn up(self) -> bool[src]

pub const fn with_up(self, bit: bool) -> Self[src]

pub const DOWN_BIT: u16[src]

pub const fn down(self) -> bool[src]

pub const fn with_down(self, bit: bool) -> Self[src]

pub const R_BIT: u16[src]

pub const fn r(self) -> bool[src]

pub const fn with_r(self, bit: bool) -> Self[src]

pub const L_BIT: u16[src]

pub const fn l(self) -> bool[src]

pub const fn with_l(self, bit: bool) -> Self[src]

pub const IRQ_ENABLED_BIT: u16[src]

pub const fn irq_enabled(self) -> bool[src]

pub const fn with_irq_enabled(self, bit: bool) -> Self[src]

pub const REQUIRE_ALL_SELECTED_KEYS_BIT: u16[src]

pub const fn require_all_selected_keys(self) -> bool[src]

pub const fn with_require_all_selected_keys(self, bit: bool) -> Self[src]

Trait Implementations

impl PartialEq<KeyControl> for KeyControl[src]

impl Eq for KeyControl[src]

impl Debug for KeyControl[src]

impl Copy for KeyControl[src]

impl Clone for KeyControl[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Default for KeyControl[src]

Auto Trait Implementations

impl Send for KeyControl

impl Sync for KeyControl

Blanket Implementations

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]