[][src]Struct alt_stm32f30x_hal::timer::tim2::Timer

pub struct Timer<C1: ChState, C2: ChState, C3: ChState, C4: ChState> { /* fields omitted */ }

Timer impl

Methods

impl Timer<ChannelFree, ChannelFree, ChannelFree, ChannelFree>[src]

pub fn new<T>(
    tim: TIM2,
    timeout: T,
    clocks: Clocks,
    apb: &mut APB1
) -> Timer<ChannelFree, ChannelFree, ChannelFree, ChannelFree> where
    T: Into<Hertz>, 
[src]

Creates new channel

pub fn free(self, apb: &mut APB1) -> TIM2[src]

Releases the TIM peripheral

impl<C1: ChState, C2: ChState, C3: ChState, C4: ChState> Timer<C1, C2, C3, C4>[src]

pub fn reset<T>(&mut self, timeout: T) where
    T: Into<Hertz>, 
[src]

Stop timer and reset frequency (doesn't start/enable)

pub fn listen(&mut self, event: Event)[src]

Starts listening for an event

pub fn unlisten(&mut self, event: Event)[src]

Stops listening for an event

pub fn enable(&mut self)[src]

Enable timer

impl Timer<ChannelFree, ChannelFree, ChannelFree, ChannelFree>[src]

impl<C2: ChState, C3: ChState, C4: ChState> Timer<ChannelFree, C2, C3, C4>[src]

pub fn take_ch1(
    self
) -> (Channel<CH1, Inactive>, Timer<ChannelTaken, C2, C3, C4>)
[src]

Get channel 1

impl<C2: ChState, C3: ChState, C4: ChState> Timer<ChannelTaken, C2, C3, C4>[src]

pub fn return_ch1<CM: ChMode>(
    self,
    _ch: Channel<CH1, CM>
) -> Timer<ChannelFree, C2, C3, C4>
[src]

Return channel 1 back

impl<C1: ChState, C3: ChState, C4: ChState> Timer<C1, ChannelFree, C3, C4>[src]

pub fn take_ch2(
    self
) -> (Channel<CH2, Inactive>, Timer<C1, ChannelTaken, C3, C4>)
[src]

Take channel 2

impl<C1: ChState, C3: ChState, C4: ChState> Timer<C1, ChannelTaken, C3, C4>[src]

pub fn return_ch2<CM: ChMode>(
    self,
    _ch: Channel<CH2, CM>
) -> Timer<C1, ChannelFree, C3, C4>
[src]

Return channel 2 back

impl<C1: ChState, C2: ChState, C4: ChState> Timer<C1, C2, ChannelFree, C4>[src]

pub fn take_ch3(
    self
) -> (Channel<CH3, Inactive>, Timer<C1, C2, ChannelTaken, C4>)
[src]

Take channel 3

impl<C1: ChState, C2: ChState, C4: ChState> Timer<C1, C2, ChannelTaken, C4>[src]

pub fn return_ch3<CM: ChMode>(
    self,
    _ch: Channel<CH3, CM>
) -> Timer<C1, C2, ChannelFree, C4>
[src]

Return channel 3 back

impl<C1: ChState, C2: ChState, C3: ChState> Timer<C1, C2, C3, ChannelFree>[src]

pub fn take_ch4(
    self
) -> (Channel<CH4, Inactive>, Timer<C1, C2, C3, ChannelTaken>)
[src]

Take channel 4

impl<C1: ChState, C2: ChState, C3: ChState> Timer<C1, C2, C3, ChannelTaken>[src]

pub fn return_ch4<CM: ChMode>(
    self,
    _ch: Channel<CH4, CM>
) -> Timer<C1, C2, C3, ChannelFree>
[src]

Return channel back

Trait Implementations

impl<C1: ChState, C2: ChState, C3: ChState, C4: ChState> CountDown for Timer<C1, C2, C3, C4>[src]

type Time = Hertz

The unit of time used by this timer

impl<C1: ChState, C2: ChState, C3: ChState, C4: ChState> Periodic for Timer<C1, C2, C3, C4>[src]

Auto Trait Implementations

impl<C1, C2, C3, C4> Send for Timer<C1, C2, C3, C4> where
    C1: Send,
    C2: Send,
    C3: Send,
    C4: Send

impl<C1, C2, C3, C4> !Sync for Timer<C1, C2, C3, C4>

Blanket Implementations

impl<T> From for T[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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