Struct HrTim

Source
pub struct HrTim<TIM, PSCL, CPT1, CPT2, DacRst: DacResetTrigger = NoDacTrigger> { /* private fields */ }

Implementations§

Source§

impl<TIM: Instance, PSCL, CPT1, CPT2, DacRst> HrTim<TIM, PSCL, CPT1, CPT2, DacRst>
where DacRst: DacResetTrigger,

Source

pub fn set_repetition_counter(&mut self, repetition_counter: u8)

Source

pub fn enable_repetition_interrupt(&mut self, enable: bool)

Trait Implementations§

Source§

impl<TIM: InstanceX, PSCL, CPT1, CPT2> CaptureEvent<TIM, PSCL> for HrTim<TIM, PSCL, CPT1, CPT2>

Timer Update event

Source§

const BITS: u32 = 2u32

Source§

impl<DST, PSCL, CPT1, CPT2> EventSource<DST, PSCL> for HrTim<HRTIM_MASTER, PSCL, CPT1, CPT2, NoDacTrigger>

Master Timer Period event

Source§

const BITS: u32 = 128u32

Source§

impl<TIM: InstanceX, DST, PSCL, CPT1, CPT2, DacRst> EventSource<DST, PSCL> for HrTim<TIM, PSCL, CPT1, CPT2, DacRst>
where DacRst: DacResetTrigger,

Timer Period event

Source§

const BITS: u32 = 4u32

Source§

impl<TIM: InstanceX, PSCL: HrtimPrescaler, CPT1, CPT2, DacRst> HrSlaveTimer for HrTim<TIM, PSCL, CPT1, CPT2, DacRst>
where DacRst: DacResetTrigger,

Source§

fn enable_reset_event<E: TimerResetEventSource<Self::Timer, Self::Prescaler>>( &mut self, _event: &E, )

Reset this timer every time the specified event occurs

Behaviour depends on timer_mode:

  • HrTimerMode::SingleShotNonRetriggable: Enabling the timer enables it but does not start it. A first reset event starts the counting and any subsequent reset is ignored until the counter reaches the PER value. The PER event is then generated and the counter is stopped. A reset event restarts the counting from 0x0000.
  • HrTimerMode:SingleShotRetriggable: Enabling the timer enables it but does not start it. A reset event starts the counting if the counter is stopped, otherwise it clears the counter. When the counter reaches the PER value, the PER event is generated and the counter is stopped. A reset event restarts the counting from 0x0000.
  • HrTimerMode::Continuous: Enabling the timer enables and starts it simultaneously. When the counter reaches the PER value, it rolls-over to 0x0000 and resumes counting. The counter can be reset at any time
Source§

fn disable_reset_event<E: TimerResetEventSource<Self::Timer, Self::Prescaler>>( &mut self, _event: &E, )

Stop listening to the specified event

Source§

unsafe fn swap_outputs(&self, _hr_control: &mut HrPwmCtrl, swap: SwapPins)

This is only allowed while having register preload enabled (PREEN is set to 1)

Source§

type CptCh1 = HrCapt<<HrTim<TIM, PSCL, CPT1, CPT2, DacRst> as HrTimer>::Timer, <HrTim<TIM, PSCL, CPT1, CPT2, DacRst> as HrTimer>::Prescaler, Ch1, NoDma>

Source§

type CptCh2 = HrCapt<<HrTim<TIM, PSCL, CPT1, CPT2, DacRst> as HrTimer>::Timer, <HrTim<TIM, PSCL, CPT1, CPT2, DacRst> as HrTimer>::Prescaler, Ch2, NoDma>

Source§

impl<TIM: InstanceX, PSCL, DacRst> HrSlaveTimerCpt for HrTim<TIM, PSCL, HrCapt<TIM, PSCL, Ch1, NoDma>, HrCapt<TIM, PSCL, Ch2, NoDma>, DacRst>
where PSCL: HrtimPrescaler, DacRst: DacResetTrigger, HrCapt<TIM, PSCL, Ch1, NoDma>: HrCapture, HrCapt<TIM, PSCL, Ch2, NoDma>: HrCapture,

Source§

fn capture_ch1(&mut self) -> &mut Self::CaptureCh1

Access the timers first capture channel

Source§

fn capture_ch2(&mut self) -> &mut Self::CaptureCh2

Access the timers second capture channel

Source§

type CaptureCh1 = <HrTim<TIM, PSCL, HrCapt<TIM, PSCL, Ch1, NoDma>, HrCapt<TIM, PSCL, Ch2, NoDma>, DacRst> as HrSlaveTimer>::CptCh1

Source§

type CaptureCh2 = <HrTim<TIM, PSCL, HrCapt<TIM, PSCL, Ch1, NoDma>, HrCapt<TIM, PSCL, Ch2, NoDma>, DacRst> as HrSlaveTimer>::CptCh2

Source§

fn split_capture(self) -> TimerSplitCapture<TIM, PSCL, Ch1, Ch2, DacRst>

Source§

impl<TIM: Instance, PSCL: HrtimPrescaler, CPT1, CPT2, DacRst: DacResetTrigger> HrTimer for HrTim<TIM, PSCL, CPT1, CPT2, DacRst>

Source§

fn start(&mut self, _hr_control: &mut HrPwmCtrl)

Start timer

Source§

fn stop(&mut self, _hr_control: &mut HrPwmCtrl)

Stop timer

Source§

fn stop_and_reset(&mut self, _hr_control: &mut HrPwmCtrl)

Stop timer and reset counter

Source§

fn as_reset_adc_trigger(&self) -> TimerReset<Self::Timer>

Make a handle to this timers reset event to use as adc trigger

Source§

fn as_period_adc_trigger(&self) -> TimerPeriod<Self::Timer>

Make a handle to this timers period event to use as adc trigger

Source§

fn disable_register_updates(&mut self, _hr_control: &mut HrPwmCtrl)

Disable register updates

Calling this function temporarily disables the transfer from preload to active registers, whatever the selected update event. This allows to modify several registers. The regular update event takes place once Self::enable_register_updates is called.

Source§

fn enable_register_updates<'a>(&mut self, _hr_control: &mut HrPwmCtrl)

Enable register updates

See Self::disable_register_updates.

NOTE: Register updates are enabled by default, no need to call this unless Self::disable_register_updates has been called.

Source§

type Prescaler = PSCL

Source§

type Timer = TIM

Source§

type DacResetTrigger = DacRst

Source§

fn get_period(&self) -> u16

Get period of timer in number of ticks Read more
Source§

fn set_period(&mut self, period: u16)

Set period of timer in number of ticks Read more
Source§

fn get_counter_value(&self) -> u16

Get the current counter value Read more
Source§

fn clear_repetition_interrupt(&mut self)

Source§

impl<DST, PSCL, CPT1, CPT2> TimerResetEventSource<DST, PSCL> for HrTim<HRTIM_MASTER, PSCL, CPT1, CPT2, NoDacTrigger>

Master Timer Period event

Source§

const BITS: u32 = 16u32

Auto Trait Implementations§

§

impl<TIM, PSCL, CPT1, CPT2, DacRst> Freeze for HrTim<TIM, PSCL, CPT1, CPT2, DacRst>
where CPT1: Freeze, CPT2: Freeze,

§

impl<TIM, PSCL, CPT1, CPT2, DacRst> RefUnwindSafe for HrTim<TIM, PSCL, CPT1, CPT2, DacRst>
where CPT1: RefUnwindSafe, CPT2: RefUnwindSafe, TIM: RefUnwindSafe, PSCL: RefUnwindSafe, DacRst: RefUnwindSafe,

§

impl<TIM, PSCL, CPT1, CPT2, DacRst> Send for HrTim<TIM, PSCL, CPT1, CPT2, DacRst>
where CPT1: Send, CPT2: Send, TIM: Send, PSCL: Send, DacRst: Send,

§

impl<TIM, PSCL, CPT1, CPT2, DacRst> Sync for HrTim<TIM, PSCL, CPT1, CPT2, DacRst>
where CPT1: Sync, CPT2: Sync, TIM: Sync, PSCL: Sync, DacRst: Sync,

§

impl<TIM, PSCL, CPT1, CPT2, DacRst> Unpin for HrTim<TIM, PSCL, CPT1, CPT2, DacRst>
where CPT1: Unpin, CPT2: Unpin, TIM: Unpin, PSCL: Unpin, DacRst: Unpin,

§

impl<TIM, PSCL, CPT1, CPT2, DacRst> UnwindSafe for HrTim<TIM, PSCL, CPT1, CPT2, DacRst>
where CPT1: UnwindSafe, CPT2: UnwindSafe, TIM: UnwindSafe, PSCL: UnwindSafe, DacRst: UnwindSafe,

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<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.