[][src]Struct gba_hal::data::TimerControl

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

Controls one of the four Timer units.

  • 0-1: Tick however many CPU cycles
  • 2: Instead of above, tick once per lower timer overflow (useless with Timer0).
  • 6: Interrupt when this timer overflows
  • 7: Enable bit.

Each timer also has a "reload" (WO) and "counter" (RO). A timer's "reload" value gets copied into the "counter" value every time that it overflows, or any time that the enable bit goes from 0 to 1.

Methods

impl TimerControl[src]

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

A const "zero value" constructor

impl TimerControl[src]

pub const TICK_RATE_MASK: u8[src]

pub fn tick_rate(self) -> TimerTickRate[src]

pub const fn with_tick_rate(self, tick_rate: TimerTickRate) -> Self[src]

pub const CASCADE_BIT: u8[src]

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

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

pub const OVERFLOW_IRQ_BIT: u8[src]

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

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

pub const ENABLED_BIT: u8[src]

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

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

Trait Implementations

impl PartialEq<TimerControl> for TimerControl[src]

impl Eq for TimerControl[src]

impl Copy for TimerControl[src]

impl Debug for TimerControl[src]

impl Clone for TimerControl[src]

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

Performs copy-assignment from source. Read more

impl Default for TimerControl[src]

Auto Trait Implementations

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]