Struct stm32_metapac::sai::regs::Cr1
#[repr(transparent)]pub struct Cr1(pub u32);
Expand description
Configuration register 1
Tuple Fields§
§0: u32
Implementations§
§impl Cr1
impl Cr1
pub const fn prtcfg(&self) -> Prtcfg
pub const fn prtcfg(&self) -> Prtcfg
Protocol configuration. These bits are set and cleared by software. These bits have to be configured when the audio block is disabled.
pub fn set_prtcfg(&mut self, val: Prtcfg)
pub fn set_prtcfg(&mut self, val: Prtcfg)
Protocol configuration. These bits are set and cleared by software. These bits have to be configured when the audio block is disabled.
pub const fn ds(&self) -> Ds
pub const fn ds(&self) -> Ds
Data size. These bits are set and cleared by software. These bits are ignored when the SPDIF protocols are selected (bit PRTCFG[1:0]), because the frame and the data size are fixed in such case. When the companding mode is selected through COMP[1:0] bits, DS[1:0] are ignored since the data size is fixed to 8 bits by the algorithm. These bits must be configured when the audio block is disabled.
pub fn set_ds(&mut self, val: Ds)
pub fn set_ds(&mut self, val: Ds)
Data size. These bits are set and cleared by software. These bits are ignored when the SPDIF protocols are selected (bit PRTCFG[1:0]), because the frame and the data size are fixed in such case. When the companding mode is selected through COMP[1:0] bits, DS[1:0] are ignored since the data size is fixed to 8 bits by the algorithm. These bits must be configured when the audio block is disabled.
pub const fn lsbfirst(&self) -> Lsbfirst
pub const fn lsbfirst(&self) -> Lsbfirst
Least significant bit first. This bit is set and cleared by software. It must be configured when the audio block is disabled. This bit has no meaning in AC97 audio protocol since AC97 data are always transferred with the MSB first. This bit has no meaning in SPDIF audio protocol since in SPDIF data are always transferred with LSB first.
pub fn set_lsbfirst(&mut self, val: Lsbfirst)
pub fn set_lsbfirst(&mut self, val: Lsbfirst)
Least significant bit first. This bit is set and cleared by software. It must be configured when the audio block is disabled. This bit has no meaning in AC97 audio protocol since AC97 data are always transferred with the MSB first. This bit has no meaning in SPDIF audio protocol since in SPDIF data are always transferred with LSB first.
pub const fn ckstr(&self) -> Ckstr
pub const fn ckstr(&self) -> Ckstr
Clock strobing edge. This bit is set and cleared by software. It must be configured when the audio block is disabled. This bit has no meaning in SPDIF audio protocol.
pub fn set_ckstr(&mut self, val: Ckstr)
pub fn set_ckstr(&mut self, val: Ckstr)
Clock strobing edge. This bit is set and cleared by software. It must be configured when the audio block is disabled. This bit has no meaning in SPDIF audio protocol.
pub const fn syncen(&self) -> Syncen
pub const fn syncen(&self) -> Syncen
Synchronization enable. These bits are set and cleared by software. They must be configured when the audio sub-block is disabled. Note: The audio sub-block should be configured as asynchronous when SPDIF mode is enabled.
pub fn set_syncen(&mut self, val: Syncen)
pub fn set_syncen(&mut self, val: Syncen)
Synchronization enable. These bits are set and cleared by software. They must be configured when the audio sub-block is disabled. Note: The audio sub-block should be configured as asynchronous when SPDIF mode is enabled.
pub const fn mono(&self) -> Mono
pub const fn mono(&self) -> Mono
Mono mode. This bit is set and cleared by software. It is meaningful only when the number of slots is equal to 2. When the mono mode is selected, slot 0 data are duplicated on slot 1 when the audio block operates as a transmitter. In reception mode, the slot1 is discarded and only the data received from slot 0 are stored. Refer to Section: Mono/stereo mode for more details.
pub fn set_mono(&mut self, val: Mono)
pub fn set_mono(&mut self, val: Mono)
Mono mode. This bit is set and cleared by software. It is meaningful only when the number of slots is equal to 2. When the mono mode is selected, slot 0 data are duplicated on slot 1 when the audio block operates as a transmitter. In reception mode, the slot1 is discarded and only the data received from slot 0 are stored. Refer to Section: Mono/stereo mode for more details.
pub const fn outdriv(&self) -> Outdriv
pub const fn outdriv(&self) -> Outdriv
Output drive. This bit is set and cleared by software. Note: This bit has to be set before enabling the audio block and after the audio block configuration.
pub fn set_outdriv(&mut self, val: Outdriv)
pub fn set_outdriv(&mut self, val: Outdriv)
Output drive. This bit is set and cleared by software. Note: This bit has to be set before enabling the audio block and after the audio block configuration.
pub const fn saien(&self) -> bool
pub const fn saien(&self) -> bool
Audio block enable where x is A or B. This bit is set by software. To switch off the audio block, the application software must program this bit to 0 and poll the bit till it reads back 0, meaning that the block is completely disabled. Before setting this bit to 1, check that it is set to 0, otherwise the enable command will not be taken into account. This bit allows to control the state of SAIx audio block. If it is disabled when an audio frame transfer is ongoing, the ongoing transfer completes and the cell is fully disabled at the end of this audio frame transfer. Note: When SAIx block is configured in master mode, the clock must be present on the input of SAIx before setting SAIXEN bit.
pub fn set_saien(&mut self, val: bool)
pub fn set_saien(&mut self, val: bool)
Audio block enable where x is A or B. This bit is set by software. To switch off the audio block, the application software must program this bit to 0 and poll the bit till it reads back 0, meaning that the block is completely disabled. Before setting this bit to 1, check that it is set to 0, otherwise the enable command will not be taken into account. This bit allows to control the state of SAIx audio block. If it is disabled when an audio frame transfer is ongoing, the ongoing transfer completes and the cell is fully disabled at the end of this audio frame transfer. Note: When SAIx block is configured in master mode, the clock must be present on the input of SAIx before setting SAIXEN bit.
pub const fn dmaen(&self) -> bool
pub const fn dmaen(&self) -> bool
DMA enable. This bit is set and cleared by software. Note: Since the audio block defaults to operate as a transmitter after reset, the MODE[1:0] bits must be configured before setting DMAEN to avoid a DMA request in receiver mode.
pub fn set_dmaen(&mut self, val: bool)
pub fn set_dmaen(&mut self, val: bool)
DMA enable. This bit is set and cleared by software. Note: Since the audio block defaults to operate as a transmitter after reset, the MODE[1:0] bits must be configured before setting DMAEN to avoid a DMA request in receiver mode.
pub const fn mckdiv(&self) -> u8
pub const fn mckdiv(&self) -> u8
Master clock divider. These bits are set and cleared by software. These bits are meaningless when the audio block operates in slave mode. They have to be configured when the audio block is disabled. Others: the master clock frequency is calculated accordingly to the following formula:
pub fn set_mckdiv(&mut self, val: u8)
pub fn set_mckdiv(&mut self, val: u8)
Master clock divider. These bits are set and cleared by software. These bits are meaningless when the audio block operates in slave mode. They have to be configured when the audio block is disabled. Others: the master clock frequency is calculated accordingly to the following formula:
Trait Implementations§
impl Copy for Cr1
impl Eq for Cr1
impl StructuralPartialEq for Cr1
Auto Trait Implementations§
impl Freeze for Cr1
impl RefUnwindSafe for Cr1
impl Send for Cr1
impl Sync for Cr1
impl Unpin for Cr1
impl UnwindSafe for Cr1
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)