stm32f1_staging/stm32f100/dac/
swtrigr.rspub type W = crate::W<SWTRIGRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SWTRIG1 {
Disabled = 0,
Enabled = 1,
}
impl From<SWTRIG1> for bool {
#[inline(always)]
fn from(variant: SWTRIG1) -> Self {
variant as u8 != 0
}
}
pub type SWTRIG1_W<'a, REG> = crate::BitWriter<'a, REG, SWTRIG1>;
impl<'a, REG> SWTRIG1_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(SWTRIG1::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(SWTRIG1::Enabled)
}
}
pub use SWTRIG1_W as SWTRIG2_W;
impl core::fmt::Debug for crate::generic::Reg<SWTRIGRrs> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "(not readable)")
}
}
impl W {
#[inline(always)]
#[must_use]
pub fn swtrig1(&mut self) -> SWTRIG1_W<SWTRIGRrs> {
SWTRIG1_W::new(self, 0)
}
#[inline(always)]
#[must_use]
pub fn swtrig2(&mut self) -> SWTRIG2_W<SWTRIGRrs> {
SWTRIG2_W::new(self, 1)
}
}
pub struct SWTRIGRrs;
impl crate::RegisterSpec for SWTRIGRrs {
type Ux = u32;
}
impl crate::Writable for SWTRIGRrs {
type Safety = crate::Unsafe;
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
impl crate::Resettable for SWTRIGRrs {
const RESET_VALUE: u32 = 0;
}