#[doc = "Register `CR1` reader"]
pub struct R(crate::R<CR1_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<CR1_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<CR1_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<CR1_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `CR1` writer"]
pub struct W(crate::W<CR1_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<CR1_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<CR1_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<CR1_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `EN1` reader - EN1"]
pub type EN1_R = crate::BitReader<bool>;
#[doc = "Field `EN1` writer - EN1"]
pub type EN1_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, bool, O>;
#[doc = "Field `EN2` reader - EN2"]
pub type EN2_R = crate::BitReader<bool>;
#[doc = "Field `EN2` writer - EN2"]
pub type EN2_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, bool, O>;
#[doc = "Field `EN3` reader - EN3"]
pub type EN3_R = crate::BitReader<bool>;
#[doc = "Field `EN3` writer - EN3"]
pub type EN3_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, bool, O>;
impl R {
#[doc = "Bit 5 - EN1"]
#[inline(always)]
pub fn en1(&self) -> EN1_R {
EN1_R::new(((self.bits >> 5) & 1) != 0)
}
#[doc = "Bit 6 - EN2"]
#[inline(always)]
pub fn en2(&self) -> EN2_R {
EN2_R::new(((self.bits >> 6) & 1) != 0)
}
#[doc = "Bit 7 - EN3"]
#[inline(always)]
pub fn en3(&self) -> EN3_R {
EN3_R::new(((self.bits >> 7) & 1) != 0)
}
}
impl W {
#[doc = "Bit 5 - EN1"]
#[inline(always)]
pub fn en1(&mut self) -> EN1_W<5> {
EN1_W::new(self)
}
#[doc = "Bit 6 - EN2"]
#[inline(always)]
pub fn en2(&mut self) -> EN2_W<6> {
EN2_W::new(self)
}
#[doc = "Bit 7 - EN3"]
#[inline(always)]
pub fn en3(&mut self) -> EN3_W<7> {
EN3_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 = "CR1 register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cr1](index.html) module"]
pub struct CR1_SPEC;
impl crate::RegisterSpec for CR1_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [cr1::R](R) reader structure"]
impl crate::Readable for CR1_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [cr1::W](W) writer structure"]
impl crate::Writable for CR1_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets CR1 to value 0"]
impl crate::Resettable for CR1_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}