[−][src]Struct alt_stm32f30x_hal::timer::tim2::Timer
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]
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]
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]
T: Into<Hertz>,
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]
pub fn take_all(
self
) -> (Channel<CH1, Inactive>, Channel<CH2, Inactive>, Channel<CH3, Inactive>, Channel<CH4, Inactive>, Timer<ChannelTaken, ChannelTaken, ChannelTaken, ChannelTaken>)
[src]
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]
pub fn take_ch1(
self
) -> (Channel<CH1, Inactive>, Timer<ChannelTaken, C2, C3, C4>)
[src]
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]
pub fn return_ch1<CM: ChMode>(
self,
_ch: Channel<CH1, CM>
) -> Timer<ChannelFree, C2, C3, C4>
[src]
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]
pub fn take_ch2(
self
) -> (Channel<CH2, Inactive>, Timer<C1, ChannelTaken, C3, C4>)
[src]
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]
pub fn return_ch2<CM: ChMode>(
self,
_ch: Channel<CH2, CM>
) -> Timer<C1, ChannelFree, C3, C4>
[src]
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]
pub fn take_ch3(
self
) -> (Channel<CH3, Inactive>, Timer<C1, C2, ChannelTaken, C4>)
[src]
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]
pub fn return_ch3<CM: ChMode>(
self,
_ch: Channel<CH3, CM>
) -> Timer<C1, C2, ChannelFree, C4>
[src]
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]
pub fn take_ch4(
self
) -> (Channel<CH4, Inactive>, Timer<C1, C2, C3, ChannelTaken>)
[src]
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]
pub fn return_ch4<CM: ChMode>(
self,
_ch: Channel<CH4, CM>
) -> Timer<C1, C2, C3, ChannelFree>
[src]
self,
_ch: Channel<CH4, CM>
) -> Timer<C1, C2, C3, ChannelFree>
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
fn start<T>(&mut self, timeout: T) where
T: Into<Hertz>,
[src]
T: Into<Hertz>,
fn wait(&mut self) -> Result<(), Void>
[src]
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,
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]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,