#[doc = "Register `CNSTAT_CMB11` reader"] pub struct R(crate::R); impl core::ops::Deref for R { type Target = crate::R; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl From> for R { #[inline(always)] fn from(reader: crate::R) -> Self { R(reader) } } #[doc = "Register `CNSTAT_CMB11` writer"] pub struct W(crate::W); impl core::ops::Deref for W { type Target = crate::W; #[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> for W { #[inline(always)] fn from(writer: crate::W) -> Self { W(writer) } } #[doc = "Field `DLC` reader - Data Length Code"] pub struct DLC_R(crate::FieldReader); impl DLC_R { #[inline(always)] pub(crate) fn new(bits: u8) -> Self { DLC_R(crate::FieldReader::new(bits)) } } impl core::ops::Deref for DLC_R { type Target = crate::FieldReader; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `DLC` writer - Data Length Code"] pub struct DLC_W<'a> { w: &'a mut W, } impl<'a> DLC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x0f << 12)) | ((value as u32 & 0x0f) << 12); self.w } } #[doc = "Field `PRI` reader - Transmit Priority Code"] pub struct PRI_R(crate::FieldReader); impl PRI_R { #[inline(always)] pub(crate) fn new(bits: u8) -> Self { PRI_R(crate::FieldReader::new(bits)) } } impl core::ops::Deref for PRI_R { type Target = crate::FieldReader; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `PRI` writer - Transmit Priority Code"] pub struct PRI_W<'a> { w: &'a mut W, } impl<'a> PRI_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x0f << 4)) | ((value as u32 & 0x0f) << 4); self.w } } #[doc = "Field `ST` reader - Buffer Status"] pub struct ST_R(crate::FieldReader); impl ST_R { #[inline(always)] pub(crate) fn new(bits: u8) -> Self { ST_R(crate::FieldReader::new(bits)) } } impl core::ops::Deref for ST_R { type Target = crate::FieldReader; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `ST` writer - Buffer Status"] pub struct ST_W<'a> { w: &'a mut W, } impl<'a> ST_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); self.w } } impl R { #[doc = "Bits 12:15 - Data Length Code"] #[inline(always)] pub fn dlc(&self) -> DLC_R { DLC_R::new(((self.bits >> 12) & 0x0f) as u8) } #[doc = "Bits 4:7 - Transmit Priority Code"] #[inline(always)] pub fn pri(&self) -> PRI_R { PRI_R::new(((self.bits >> 4) & 0x0f) as u8) } #[doc = "Bits 0:3 - Buffer Status"] #[inline(always)] pub fn st(&self) -> ST_R { ST_R::new((self.bits & 0x0f) as u8) } } impl W { #[doc = "Bits 12:15 - Data Length Code"] #[inline(always)] pub fn dlc(&mut self) -> DLC_W { DLC_W { w: self } } #[doc = "Bits 4:7 - Transmit Priority Code"] #[inline(always)] pub fn pri(&mut self) -> PRI_W { PRI_W { w: self } } #[doc = "Bits 0:3 - Buffer Status"] #[inline(always)] pub fn st(&mut self) -> ST_W { ST_W { w: 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 = "Buffer Status / Control 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 [cnstat_cmb11](index.html) module"] pub struct CNSTAT_CMB11_SPEC; impl crate::RegisterSpec for CNSTAT_CMB11_SPEC { type Ux = u32; } #[doc = "`read()` method returns [cnstat_cmb11::R](R) reader structure"] impl crate::Readable for CNSTAT_CMB11_SPEC { type Reader = R; } #[doc = "`write(|w| ..)` method takes [cnstat_cmb11::W](W) writer structure"] impl crate::Writable for CNSTAT_CMB11_SPEC { type Writer = W; } #[doc = "`reset()` method sets CNSTAT_CMB11 to value 0"] impl crate::Resettable for CNSTAT_CMB11_SPEC { #[inline(always)] fn reset_value() -> Self::Ux { 0 } }