#[doc = "Register `CR` writer"]
pub struct W(crate::W<CR_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<CR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<CR_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<CR_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `START` writer - Send a START Condition"]
pub type START_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, bool, O>;
#[doc = "Field `STOP` writer - Send a STOP Condition"]
pub type STOP_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, bool, O>;
#[doc = "Field `MSEN` writer - TWI Master Mode Enabled"]
pub type MSEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, bool, O>;
#[doc = "Field `MSDIS` writer - TWI Master Mode Disabled"]
pub type MSDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, bool, O>;
#[doc = "Field `SVEN` writer - TWI Slave Mode Enabled"]
pub type SVEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, bool, O>;
#[doc = "Field `SVDIS` writer - TWI Slave Mode Disabled"]
pub type SVDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, bool, O>;
#[doc = "Field `QUICK` writer - SMBUS Quick Command"]
pub type QUICK_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, bool, O>;
#[doc = "Field `SWRST` writer - Software Reset"]
pub type SWRST_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, bool, O>;
impl W {
#[doc = "Bit 0 - Send a START Condition"]
#[inline(always)]
#[must_use]
pub fn start(&mut self) -> START_W<0> {
START_W::new(self)
}
#[doc = "Bit 1 - Send a STOP Condition"]
#[inline(always)]
#[must_use]
pub fn stop(&mut self) -> STOP_W<1> {
STOP_W::new(self)
}
#[doc = "Bit 2 - TWI Master Mode Enabled"]
#[inline(always)]
#[must_use]
pub fn msen(&mut self) -> MSEN_W<2> {
MSEN_W::new(self)
}
#[doc = "Bit 3 - TWI Master Mode Disabled"]
#[inline(always)]
#[must_use]
pub fn msdis(&mut self) -> MSDIS_W<3> {
MSDIS_W::new(self)
}
#[doc = "Bit 4 - TWI Slave Mode Enabled"]
#[inline(always)]
#[must_use]
pub fn sven(&mut self) -> SVEN_W<4> {
SVEN_W::new(self)
}
#[doc = "Bit 5 - TWI Slave Mode Disabled"]
#[inline(always)]
#[must_use]
pub fn svdis(&mut self) -> SVDIS_W<5> {
SVDIS_W::new(self)
}
#[doc = "Bit 6 - SMBUS Quick Command"]
#[inline(always)]
#[must_use]
pub fn quick(&mut self) -> QUICK_W<6> {
QUICK_W::new(self)
}
#[doc = "Bit 7 - Software Reset"]
#[inline(always)]
#[must_use]
pub fn swrst(&mut self) -> SWRST_W<7> {
SWRST_W::new(self)
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Control Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cr](index.html) module"]
pub struct CR_SPEC;
impl crate::RegisterSpec for CR_SPEC {
type Ux = u32;
}
#[doc = "`write(|w| ..)` method takes [cr::W](W) writer structure"]
impl crate::Writable for CR_SPEC {
type Writer = W;
const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
}