stm32-metapac

Crates

git

Versions

stm32u5a5rj

Flavors

Skip to main content

ChTr2

Struct ChTr2 

#[repr(transparent)]
pub struct ChTr2(pub u32);
Expand description

LPDMA channel x transfer register 2

Tuple Fields§

§0: u32

Implementations§

§

impl ChTr2

pub const fn reqsel(&self) -> u8

LPDMA hardware request selection (REQSEL[4:0] on STM32U5, REQSEL[5:0] on STM32WBA2, REQSEL[6:0] on STM32C5). These bits are ignored if channel x is activated (CH[x].CR.EN asserted) with SWREQ = 1 (software request for a memory-to-memory transfer). The user must not assign a same input hardware request (same REQSEL value) to different active LPDMA channels (CH[x].CR.EN = 1 and CH[x].TR2.SWREQ = 0 for these channels). LPDMA is not intended to hardware support the case of simultaneous enabled channels incorrectly configured with a same hardware peripheral request signal, and there is no user setting error reporting.

pub const fn set_reqsel(&mut self, val: u8)

LPDMA hardware request selection (REQSEL[4:0] on STM32U5, REQSEL[5:0] on STM32WBA2, REQSEL[6:0] on STM32C5). These bits are ignored if channel x is activated (CH[x].CR.EN asserted) with SWREQ = 1 (software request for a memory-to-memory transfer). The user must not assign a same input hardware request (same REQSEL value) to different active LPDMA channels (CH[x].CR.EN = 1 and CH[x].TR2.SWREQ = 0 for these channels). LPDMA is not intended to hardware support the case of simultaneous enabled channels incorrectly configured with a same hardware peripheral request signal, and there is no user setting error reporting.

pub const fn swreq(&self) -> Swreq

software request. This bit is internally taken into account when CH[x].CR.EN is asserted.

pub const fn set_swreq(&mut self, val: Swreq)

software request. This bit is internally taken into account when CH[x].CR.EN is asserted.

pub const fn breq(&self) -> Breq

Block hardware request. If the channel x is activated (CH[x].CR.EN asserted) with SWREQ = 1 (software request for a memory-to-memory transfer), this bit is ignored.

pub const fn set_breq(&mut self, val: Breq)

Block hardware request. If the channel x is activated (CH[x].CR.EN asserted) with SWREQ = 1 (software request for a memory-to-memory transfer), this bit is ignored.

pub const fn pfreq(&self) -> bool

Hardware request in peripheral flow control mode. 0 = the block transfer completion is controlled by LPDMA (CH[x].BR1.BNDT), 1 = the block transfer can be early completed by the peripheral itself. Ignored if SWREQ = 1. Only on STM32C5, and only on the channels implemented with peripheral early termination (otherwise reserved).

pub const fn set_pfreq(&mut self, val: bool)

Hardware request in peripheral flow control mode. 0 = the block transfer completion is controlled by LPDMA (CH[x].BR1.BNDT), 1 = the block transfer can be early completed by the peripheral itself. Ignored if SWREQ = 1. Only on STM32C5, and only on the channels implemented with peripheral early termination (otherwise reserved).

pub const fn trigm(&self) -> Trigm

trigger mode. These bits define the transfer granularity for its conditioning by the trigger. If the channel x is enabled (CH[x].CR.EN asserted) with TRIGPOL[1:0] = 00 or 11, these TRIGM[1:0] bits are ignored. Else, a LPDMA transfer is conditioned by at least one trigger hit. The LPDMA monitoring of a trigger for channel x is started when the channel is enabled/loaded with a new active trigger configuration: rising or falling edge on a selected trigger (TRIGPOL[1:0] = 01 or respectively TRIGPOL[1:0] = 10). The monitoring of this trigger is kept active during the triggered and uncompleted (data or link) transfer; and if a new trigger is detected then, this hit is internally memorized to grant the next transfer, as long as the defined rising or falling edge is not modified, and the TRIGSEL is not modified, and the channel is enabled. Transferring a next LLIn+1 that updates the CH[x].TR2 with a new value for any of TRIGSEL or TRIGPOL[1:0], resets the monitoring, trashing the memorized hit of the formerly defined LLIn trigger. After a first new trigger hitn+1 is memorized, if another second trigger hitn+2 is detected and if the hitn triggered transfer is still not completed, hitn+2 is lost and not memorized. A trigger overrun flag is reported (CH[x].SR.TOF =1 ), and an interrupt is generated if enabled (CH[x].CR.TOIE = 1). The channel is not automatically disabled by hardware due to a trigger overrun.

pub const fn set_trigm(&mut self, val: Trigm)

trigger mode. These bits define the transfer granularity for its conditioning by the trigger. If the channel x is enabled (CH[x].CR.EN asserted) with TRIGPOL[1:0] = 00 or 11, these TRIGM[1:0] bits are ignored. Else, a LPDMA transfer is conditioned by at least one trigger hit. The LPDMA monitoring of a trigger for channel x is started when the channel is enabled/loaded with a new active trigger configuration: rising or falling edge on a selected trigger (TRIGPOL[1:0] = 01 or respectively TRIGPOL[1:0] = 10). The monitoring of this trigger is kept active during the triggered and uncompleted (data or link) transfer; and if a new trigger is detected then, this hit is internally memorized to grant the next transfer, as long as the defined rising or falling edge is not modified, and the TRIGSEL is not modified, and the channel is enabled. Transferring a next LLIn+1 that updates the CH[x].TR2 with a new value for any of TRIGSEL or TRIGPOL[1:0], resets the monitoring, trashing the memorized hit of the formerly defined LLIn trigger. After a first new trigger hitn+1 is memorized, if another second trigger hitn+2 is detected and if the hitn triggered transfer is still not completed, hitn+2 is lost and not memorized. A trigger overrun flag is reported (CH[x].SR.TOF =1 ), and an interrupt is generated if enabled (CH[x].CR.TOIE = 1). The channel is not automatically disabled by hardware due to a trigger overrun.

pub const fn trigsel(&self) -> u8

trigger event input selection (TRIGSEL[4:0] on STM32U5 and STM32WBA2, TRIGSEL[5:0] on STM32C5). These bits select the trigger event input of the LPDMA transfer, with an active trigger event if TRIGPOL[1:0] ≠ 00.

pub const fn set_trigsel(&mut self, val: u8)

trigger event input selection (TRIGSEL[4:0] on STM32U5 and STM32WBA2, TRIGSEL[5:0] on STM32C5). These bits select the trigger event input of the LPDMA transfer, with an active trigger event if TRIGPOL[1:0] ≠ 00.

pub const fn trigpol(&self) -> Trigpol

trigger event polarity. These bits define the polarity of the selected trigger event input defined by TRIGSEL.

pub const fn set_trigpol(&mut self, val: Trigpol)

trigger event polarity. These bits define the polarity of the selected trigger event input defined by TRIGSEL.

pub const fn tcem(&self) -> Tcem

transfer complete event mode. These bits define the transfer granularity for the transfer complete and half transfer complete events generation. Note: If the initial LLI0 data transfer is null/void (directly programmed by the internal register file with CH[x].BR1.BNDT[15:0] = 0), then neither the complete transfer event nor the half transfer event is generated in block mode; in LLI mode the half transfer event is not generated, and the transfer complete event is generated when is completed the loading of the LLI1.

pub const fn set_tcem(&mut self, val: Tcem)

transfer complete event mode. These bits define the transfer granularity for the transfer complete and half transfer complete events generation. Note: If the initial LLI0 data transfer is null/void (directly programmed by the internal register file with CH[x].BR1.BNDT[15:0] = 0), then neither the complete transfer event nor the half transfer event is generated in block mode; in LLI mode the half transfer event is not generated, and the transfer complete event is generated when is completed the loading of the LLI1.

Trait Implementations§

§

impl Clone for ChTr2

§

fn clone(&self) -> ChTr2

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Copy for ChTr2

§

impl Default for ChTr2

§

fn default() -> ChTr2

Returns the “default value” for a type. Read more
§

impl Eq for ChTr2

§

impl PartialEq for ChTr2

§

fn eq(&self, other: &ChTr2) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
§

impl StructuralPartialEq for ChTr2

Auto Trait Implementations§

§

impl Freeze for ChTr2

§

impl RefUnwindSafe for ChTr2

§

impl Send for ChTr2

§

impl Sync for ChTr2

§

impl Unpin for ChTr2

§

impl UnsafeUnpin for ChTr2

§

impl UnwindSafe for ChTr2

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 = !

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.