Struct alt_stm32f30x_hal::timer::tim2::Timer [−][src]
Timer impl
Methods
impl Timer<ChannelFree, ChannelFree, ChannelFree, ChannelFree>
[src]
impl Timer<ChannelFree, ChannelFree, ChannelFree, ChannelFree>
pub fn new<T>(
tim: TIM2,
timeout: T,
clocks: Clocks,
apb: &mut APB1
) -> Timer<ChannelFree, ChannelFree, ChannelFree, ChannelFree> where
T: Into<Hertz>,
[src]
pub fn new<T>(
tim: TIM2,
timeout: T,
clocks: Clocks,
apb: &mut APB1
) -> Timer<ChannelFree, ChannelFree, ChannelFree, ChannelFree> where
T: Into<Hertz>,
Creates new channel
pub fn free(self, apb: &mut APB1) -> TIM2
[src]
pub fn free(self, apb: &mut APB1) -> TIM2
Releases the TIM peripheral
impl<C1: ChState, C2: ChState, C3: ChState, C4: ChState> Timer<C1, C2, C3, C4>
[src]
impl<C1: ChState, C2: ChState, C3: ChState, C4: ChState> Timer<C1, C2, C3, C4>
pub fn reset<T>(&mut self, timeout: T) where
T: Into<Hertz>,
[src]
pub fn reset<T>(&mut self, timeout: T) where
T: Into<Hertz>,
Stop timer and reset frequency (doesn't start/enable)
pub fn listen(&mut self, event: Event)
[src]
pub fn listen(&mut self, event: Event)
Starts listening for an event
pub fn unlisten(&mut self, event: Event)
[src]
pub fn unlisten(&mut self, event: Event)
Stops listening for an event
pub fn enable(&mut self)
[src]
pub fn enable(&mut self)
Enable timer
impl Timer<ChannelFree, ChannelFree, ChannelFree, ChannelFree>
[src]
impl Timer<ChannelFree, ChannelFree, ChannelFree, ChannelFree>
pub fn take_all(
self
) -> (Channel<CH1, Inactive>, Channel<CH2, Inactive>, Channel<CH3, Inactive>, Channel<CH4, Inactive>, Timer<ChannelTaken, ChannelTaken, ChannelTaken, ChannelTaken>)
[src]
pub fn take_all(
self
) -> (Channel<CH1, Inactive>, Channel<CH2, Inactive>, Channel<CH3, Inactive>, Channel<CH4, Inactive>, Timer<ChannelTaken, ChannelTaken, ChannelTaken, ChannelTaken>)
Get all channels
impl<C2: ChState, C3: ChState, C4: ChState> Timer<ChannelFree, C2, C3, C4>
[src]
impl<C2: ChState, C3: ChState, C4: ChState> Timer<ChannelFree, C2, C3, C4>
pub fn take_ch1(
self
) -> (Channel<CH1, Inactive>, Timer<ChannelTaken, C2, C3, C4>)
[src]
pub fn take_ch1(
self
) -> (Channel<CH1, Inactive>, Timer<ChannelTaken, C2, C3, C4>)
Get channel 1
impl<C2: ChState, C3: ChState, C4: ChState> Timer<ChannelTaken, C2, C3, C4>
[src]
impl<C2: ChState, C3: ChState, C4: ChState> Timer<ChannelTaken, C2, C3, C4>
pub fn return_ch1<CM: ChMode>(
self,
_ch: Channel<CH1, CM>
) -> Timer<ChannelFree, C2, C3, C4>
[src]
pub fn return_ch1<CM: ChMode>(
self,
_ch: Channel<CH1, CM>
) -> Timer<ChannelFree, C2, C3, C4>
Return channel 1 back
impl<C1: ChState, C3: ChState, C4: ChState> Timer<C1, ChannelFree, C3, C4>
[src]
impl<C1: ChState, C3: ChState, C4: ChState> Timer<C1, ChannelFree, C3, C4>
pub fn take_ch2(
self
) -> (Channel<CH2, Inactive>, Timer<C1, ChannelTaken, C3, C4>)
[src]
pub fn take_ch2(
self
) -> (Channel<CH2, Inactive>, Timer<C1, ChannelTaken, C3, C4>)
Take channel 2
impl<C1: ChState, C3: ChState, C4: ChState> Timer<C1, ChannelTaken, C3, C4>
[src]
impl<C1: ChState, C3: ChState, C4: ChState> Timer<C1, ChannelTaken, C3, C4>
pub fn return_ch2<CM: ChMode>(
self,
_ch: Channel<CH2, CM>
) -> Timer<C1, ChannelFree, C3, C4>
[src]
pub fn return_ch2<CM: ChMode>(
self,
_ch: Channel<CH2, CM>
) -> Timer<C1, ChannelFree, C3, C4>
Return channel 2 back
impl<C1: ChState, C2: ChState, C4: ChState> Timer<C1, C2, ChannelFree, C4>
[src]
impl<C1: ChState, C2: ChState, C4: ChState> Timer<C1, C2, ChannelFree, C4>
pub fn take_ch3(
self
) -> (Channel<CH3, Inactive>, Timer<C1, C2, ChannelTaken, C4>)
[src]
pub fn take_ch3(
self
) -> (Channel<CH3, Inactive>, Timer<C1, C2, ChannelTaken, C4>)
Take channel 3
impl<C1: ChState, C2: ChState, C4: ChState> Timer<C1, C2, ChannelTaken, C4>
[src]
impl<C1: ChState, C2: ChState, C4: ChState> Timer<C1, C2, ChannelTaken, C4>
pub fn return_ch3<CM: ChMode>(
self,
_ch: Channel<CH3, CM>
) -> Timer<C1, C2, ChannelFree, C4>
[src]
pub fn return_ch3<CM: ChMode>(
self,
_ch: Channel<CH3, CM>
) -> Timer<C1, C2, ChannelFree, C4>
Return channel 3 back
impl<C1: ChState, C2: ChState, C3: ChState> Timer<C1, C2, C3, ChannelFree>
[src]
impl<C1: ChState, C2: ChState, C3: ChState> Timer<C1, C2, C3, ChannelFree>
pub fn take_ch4(
self
) -> (Channel<CH4, Inactive>, Timer<C1, C2, C3, ChannelTaken>)
[src]
pub fn take_ch4(
self
) -> (Channel<CH4, Inactive>, Timer<C1, C2, C3, ChannelTaken>)
Take channel 4
impl<C1: ChState, C2: ChState, C3: ChState> Timer<C1, C2, C3, ChannelTaken>
[src]
impl<C1: ChState, C2: ChState, C3: ChState> Timer<C1, C2, C3, ChannelTaken>
pub fn return_ch4<CM: ChMode>(
self,
_ch: Channel<CH4, CM>
) -> Timer<C1, C2, C3, ChannelFree>
[src]
pub fn return_ch4<CM: ChMode>(
self,
_ch: Channel<CH4, CM>
) -> Timer<C1, C2, C3, ChannelFree>
Return channel back
Trait Implementations
impl<C1: ChState, C2: ChState, C3: ChState, C4: ChState> Periodic for Timer<C1, C2, C3, C4>
[src]
impl<C1: ChState, C2: ChState, C3: ChState, C4: ChState> Periodic for Timer<C1, C2, C3, C4>
impl<C1: ChState, C2: ChState, C3: ChState, C4: ChState> CountDown for Timer<C1, C2, C3, C4>
[src]
impl<C1: ChState, C2: ChState, C3: ChState, C4: ChState> CountDown for Timer<C1, C2, C3, C4>