TIM2

Struct TIM2 

Source
pub struct TIM2 { /* private fields */ }
Expand description

General-purpose-timers

Implementations§

Source§

impl TIM2

Source

pub const PTR: *const RegisterBlock = {0x40000000 as *const stm32l4::stm32l4x2::tim2::RegisterBlock}

Pointer to the register block

Source

pub const fn ptr() -> *const RegisterBlock

Return the pointer to the register block

Methods from Deref<Target = RegisterBlock>§

Source

pub fn ccmr1_input(&self) -> &Reg<CCMR1_INPUT_SPEC>

0x18 - capture/compare mode register 1 (input mode)

Source

pub fn ccmr1_output(&self) -> &Reg<CCMR1_OUTPUT_SPEC>

0x18 - capture/compare mode register 1 (output mode)

Source

pub fn ccmr2_input(&self) -> &Reg<CCMR2_INPUT_SPEC>

0x1c - capture/compare mode register 2 (input mode)

Source

pub fn ccmr2_output(&self) -> &Reg<CCMR2_OUTPUT_SPEC>

0x1c - capture/compare mode register 2 (output mode)

Trait Implementations§

Source§

impl Debug for TIM2

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Deref for TIM2

Source§

type Target = RegisterBlock

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<TIM2 as Deref>::Target

Dereferences the value.
Source§

impl Enable for TIM2

Source§

fn enable(bus: &mut Self::Bus)

Enables peripheral
Source§

fn disable(bus: &mut Self::Bus)

Disables peripheral
Source§

fn is_enabled() -> bool

Check if peripheral enabled
Source§

fn is_disabled() -> bool

Check if peripheral disabled
Source§

unsafe fn enable_unchecked()

Safety Read more
Source§

unsafe fn disable_unchecked()

Safety Read more
Source§

impl<OTYPE> Pins<TIM2> for (PA15<Alternate<OTYPE, 1>>, PB10<Alternate<OTYPE, 1>>)

Source§

const C1: bool = true

Source§

const C3: bool = true

Source§

type Channels = (Pwm<TIM2, C1>, Pwm<TIM2, C3>)

Source§

const C2: bool = false

Source§

const C4: bool = false

Source§

impl<OTYPE> Pins<TIM2> for (PA15<Alternate<OTYPE, 1>>, PB10<Alternate<OTYPE, 1>>, PB11<Alternate<OTYPE, 1>>)

Source§

const C1: bool = true

Source§

const C3: bool = true

Source§

const C4: bool = true

Source§

type Channels = (Pwm<TIM2, C1>, Pwm<TIM2, C3>, Pwm<TIM2, C4>)

Source§

const C2: bool = false

Source§

impl<OTYPE> Pins<TIM2> for (PA15<Alternate<OTYPE, 1>>, PB11<Alternate<OTYPE, 1>>)

Source§

const C1: bool = true

Source§

const C4: bool = true

Source§

type Channels = (Pwm<TIM2, C1>, Pwm<TIM2, C4>)

Source§

const C2: bool = false

Source§

const C3: bool = false

Source§

impl<OTYPE> Pins<TIM2> for (PA15<Alternate<OTYPE, 1>>, PB3<Alternate<OTYPE, 1>>)

Source§

const C1: bool = true

Source§

const C2: bool = true

Source§

type Channels = (Pwm<TIM2, C1>, Pwm<TIM2, C2>)

Source§

const C3: bool = false

Source§

const C4: bool = false

Source§

impl<OTYPE> Pins<TIM2> for (PA15<Alternate<OTYPE, 1>>, PB3<Alternate<OTYPE, 1>>, PB10<Alternate<OTYPE, 1>>)

Source§

const C1: bool = true

Source§

const C2: bool = true

Source§

const C3: bool = true

Source§

type Channels = (Pwm<TIM2, C1>, Pwm<TIM2, C2>, Pwm<TIM2, C3>)

Source§

const C4: bool = false

Source§

impl<OTYPE> Pins<TIM2> for (PA15<Alternate<OTYPE, 1>>, PB3<Alternate<OTYPE, 1>>, PB10<Alternate<OTYPE, 1>>, PB11<Alternate<OTYPE, 1>>)

Source§

const C1: bool = true

Source§

const C2: bool = true

Source§

const C3: bool = true

Source§

const C4: bool = true

Source§

type Channels = (Pwm<TIM2, C1>, Pwm<TIM2, C2>, Pwm<TIM2, C3>, Pwm<TIM2, C4>)

Source§

impl<OTYPE> Pins<TIM2> for (PA15<Alternate<OTYPE, 1>>, PB3<Alternate<OTYPE, 1>>, PB11<Alternate<OTYPE, 1>>)

Source§

const C1: bool = true

Source§

const C2: bool = true

Source§

const C4: bool = true

Source§

type Channels = (Pwm<TIM2, C1>, Pwm<TIM2, C2>, Pwm<TIM2, C4>)

Source§

const C3: bool = false

Source§

impl<OTYPE> Pins<TIM2> for (PB10<Alternate<OTYPE, 1>>, PB11<Alternate<OTYPE, 1>>)

Source§

const C3: bool = true

Source§

const C4: bool = true

Source§

type Channels = (Pwm<TIM2, C3>, Pwm<TIM2, C4>)

Source§

const C1: bool = false

Source§

const C2: bool = false

Source§

impl<OTYPE> Pins<TIM2> for (PA0<Alternate<OTYPE, 1>>, PA1<Alternate<OTYPE, 1>>)

Source§

const C1: bool = true

Source§

const C2: bool = true

Source§

type Channels = (Pwm<TIM2, C1>, Pwm<TIM2, C2>)

Source§

const C3: bool = false

Source§

const C4: bool = false

Source§

impl<OTYPE> Pins<TIM2> for (PA0<Alternate<OTYPE, 1>>, PA1<Alternate<OTYPE, 1>>, PA2<Alternate<OTYPE, 1>>)

Source§

const C1: bool = true

Source§

const C2: bool = true

Source§

const C3: bool = true

Source§

type Channels = (Pwm<TIM2, C1>, Pwm<TIM2, C2>, Pwm<TIM2, C3>)

Source§

const C4: bool = false

Source§

impl<OTYPE> Pins<TIM2> for (PA0<Alternate<OTYPE, 1>>, PA1<Alternate<OTYPE, 1>>, PA2<Alternate<OTYPE, 1>>, PB11<Alternate<OTYPE, 1>>)

Source§

const C1: bool = true

Source§

const C2: bool = true

Source§

const C3: bool = true

Source§

const C4: bool = true

Source§

type Channels = (Pwm<TIM2, C1>, Pwm<TIM2, C2>, Pwm<TIM2, C3>, Pwm<TIM2, C4>)

Source§

impl<OTYPE> Pins<TIM2> for (PA0<Alternate<OTYPE, 1>>, PA1<Alternate<OTYPE, 1>>, PA2<Alternate<OTYPE, 1>>, PA3<Alternate<OTYPE, 1>>)

Source§

const C1: bool = true

Source§

const C2: bool = true

Source§

const C3: bool = true

Source§

const C4: bool = true

Source§

type Channels = (Pwm<TIM2, C1>, Pwm<TIM2, C2>, Pwm<TIM2, C3>, Pwm<TIM2, C4>)

Source§

impl<OTYPE> Pins<TIM2> for (PA0<Alternate<OTYPE, 1>>, PA1<Alternate<OTYPE, 1>>, PA3<Alternate<OTYPE, 1>>)

Source§

const C1: bool = true

Source§

const C2: bool = true

Source§

const C4: bool = true

Source§

type Channels = (Pwm<TIM2, C1>, Pwm<TIM2, C2>, Pwm<TIM2, C4>)

Source§

const C3: bool = false

Source§

impl<OTYPE> Pins<TIM2> for (PA0<Alternate<OTYPE, 1>>, PA2<Alternate<OTYPE, 1>>)

Source§

const C1: bool = true

Source§

const C3: bool = true

Source§

type Channels = (Pwm<TIM2, C1>, Pwm<TIM2, C3>)

Source§

const C2: bool = false

Source§

const C4: bool = false

Source§

impl<OTYPE> Pins<TIM2> for (PA0<Alternate<OTYPE, 1>>, PA2<Alternate<OTYPE, 1>>, PA3<Alternate<OTYPE, 1>>)

Source§

const C1: bool = true

Source§

const C3: bool = true

Source§

const C4: bool = true

Source§

type Channels = (Pwm<TIM2, C1>, Pwm<TIM2, C3>, Pwm<TIM2, C4>)

Source§

const C2: bool = false

Source§

impl<OTYPE> Pins<TIM2> for (PA0<Alternate<OTYPE, 1>>, PA3<Alternate<OTYPE, 1>>)

Source§

const C1: bool = true

Source§

const C4: bool = true

Source§

type Channels = (Pwm<TIM2, C1>, Pwm<TIM2, C4>)

Source§

const C2: bool = false

Source§

const C3: bool = false

Source§

impl<OTYPE> Pins<TIM2> for (PA1<Alternate<OTYPE, 1>>, PA2<Alternate<OTYPE, 1>>)

Source§

const C2: bool = true

Source§

const C3: bool = true

Source§

type Channels = (Pwm<TIM2, C2>, Pwm<TIM2, C3>)

Source§

const C1: bool = false

Source§

const C4: bool = false

Source§

impl<OTYPE> Pins<TIM2> for (PA1<Alternate<OTYPE, 1>>, PA2<Alternate<OTYPE, 1>>, PA3<Alternate<OTYPE, 1>>)

Source§

const C2: bool = true

Source§

const C3: bool = true

Source§

const C4: bool = true

Source§

type Channels = (Pwm<TIM2, C2>, Pwm<TIM2, C3>, Pwm<TIM2, C4>)

Source§

const C1: bool = false

Source§

impl<OTYPE> Pins<TIM2> for (PA1<Alternate<OTYPE, 1>>, PA3<Alternate<OTYPE, 1>>)

Source§

const C2: bool = true

Source§

const C4: bool = true

Source§

type Channels = (Pwm<TIM2, C2>, Pwm<TIM2, C4>)

Source§

const C1: bool = false

Source§

const C3: bool = false

Source§

impl<OTYPE> Pins<TIM2> for (PA2<Alternate<OTYPE, 1>>, PA3<Alternate<OTYPE, 1>>)

Source§

const C3: bool = true

Source§

const C4: bool = true

Source§

type Channels = (Pwm<TIM2, C3>, Pwm<TIM2, C4>)

Source§

const C1: bool = false

Source§

const C2: bool = false

Source§

impl<OTYPE> Pins<TIM2> for (PB3<Alternate<OTYPE, 1>>, PB10<Alternate<OTYPE, 1>>)

Source§

const C2: bool = true

Source§

const C3: bool = true

Source§

type Channels = (Pwm<TIM2, C2>, Pwm<TIM2, C3>)

Source§

const C1: bool = false

Source§

const C4: bool = false

Source§

impl<OTYPE> Pins<TIM2> for (PB3<Alternate<OTYPE, 1>>, PB10<Alternate<OTYPE, 1>>, PB11<Alternate<OTYPE, 1>>)

Source§

const C2: bool = true

Source§

const C3: bool = true

Source§

const C4: bool = true

Source§

type Channels = (Pwm<TIM2, C2>, Pwm<TIM2, C3>, Pwm<TIM2, C4>)

Source§

const C1: bool = false

Source§

impl<OTYPE> Pins<TIM2> for (PB3<Alternate<OTYPE, 1>>, PB11<Alternate<OTYPE, 1>>)

Source§

const C2: bool = true

Source§

const C4: bool = true

Source§

type Channels = (Pwm<TIM2, C2>, Pwm<TIM2, C4>)

Source§

const C1: bool = false

Source§

const C3: bool = false

Source§

impl<OTYPE> Pins<TIM2> for PA15<Alternate<OTYPE, 1>>

Source§

const C1: bool = true

Source§

type Channels = Pwm<TIM2, C1>

Source§

const C2: bool = false

Source§

const C3: bool = false

Source§

const C4: bool = false

Source§

impl<OTYPE> Pins<TIM2> for PB10<Alternate<OTYPE, 1>>

Source§

const C3: bool = true

Source§

type Channels = Pwm<TIM2, C3>

Source§

const C1: bool = false

Source§

const C2: bool = false

Source§

const C4: bool = false

Source§

impl<OTYPE> Pins<TIM2> for PB11<Alternate<OTYPE, 1>>

Source§

const C4: bool = true

Source§

type Channels = Pwm<TIM2, C4>

Source§

const C1: bool = false

Source§

const C2: bool = false

Source§

const C3: bool = false

Source§

impl<OTYPE> Pins<TIM2> for PA0<Alternate<OTYPE, 1>>

Source§

const C1: bool = true

Source§

type Channels = Pwm<TIM2, C1>

Source§

const C2: bool = false

Source§

const C3: bool = false

Source§

const C4: bool = false

Source§

impl<OTYPE> Pins<TIM2> for PA1<Alternate<OTYPE, 1>>

Source§

const C2: bool = true

Source§

type Channels = Pwm<TIM2, C2>

Source§

const C1: bool = false

Source§

const C3: bool = false

Source§

const C4: bool = false

Source§

impl<OTYPE> Pins<TIM2> for PA2<Alternate<OTYPE, 1>>

Source§

const C3: bool = true

Source§

type Channels = Pwm<TIM2, C3>

Source§

const C1: bool = false

Source§

const C2: bool = false

Source§

const C4: bool = false

Source§

impl<OTYPE> Pins<TIM2> for PA3<Alternate<OTYPE, 1>>

Source§

const C4: bool = true

Source§

type Channels = Pwm<TIM2, C4>

Source§

const C1: bool = false

Source§

const C2: bool = false

Source§

const C3: bool = false

Source§

impl<OTYPE> Pins<TIM2> for PB3<Alternate<OTYPE, 1>>

Source§

const C2: bool = true

Source§

type Channels = Pwm<TIM2, C2>

Source§

const C1: bool = false

Source§

const C3: bool = false

Source§

const C4: bool = false

Source§

impl PwmExt2 for TIM2

Source§

fn pwm<PINS>( self, _pins: PINS, freq: Hertz, clocks: Clocks, apb: &mut APB1R1, ) -> PINS::Channels
where PINS: Pins<Self>,

Source§

impl RccBus for TIM2

Source§

type Bus = APB1R1

Bus type;
Source§

impl Reset for TIM2

Source§

fn reset(bus: &mut Self::Bus)

Resets peripheral
Source§

unsafe fn reset_unchecked()

Safety Read more
Source§

impl SMEnable for TIM2

Source§

fn enable_in_sleep_mode(bus: &mut Self::Bus)

Enables peripheral
Source§

fn disable_in_sleep_mode(bus: &mut Self::Bus)

Disables peripheral
Source§

fn is_enabled_in_sleep_mode() -> bool

Check if peripheral enabled
Source§

fn is_disabled_in_sleep_mode() -> bool

Check if peripheral disabled
Source§

unsafe fn enable_in_sleep_mode_unchecked()

Safety Read more
Source§

unsafe fn disable_in_sleep_mode_unchecked()

Safety Read more
Source§

impl Send for TIM2

Auto Trait Implementations§

§

impl Freeze for TIM2

§

impl RefUnwindSafe for TIM2

§

impl !Sync for TIM2

§

impl Unpin for TIM2

§

impl UnwindSafe for TIM2

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.