rsl10_pac/rf/
rf_crc_rst.rs

1#[doc = "Reader of register RF_CRC_RST"]
2pub type R = crate::R<u32, super::RF_CRC_RST>;
3#[doc = "Writer for register RF_CRC_RST"]
4pub type W = crate::W<u32, super::RF_CRC_RST>;
5#[doc = "Register RF_CRC_RST `reset()`'s with value 0"]
6impl crate::ResetValue for super::RF_CRC_RST {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0
11    }
12}
13#[doc = "CRC reset value\n\nValue on reset: 0"]
14#[derive(Clone, Copy, Debug, PartialEq)]
15#[repr(u32)]
16pub enum CRC_RST_CRC_RST_A {
17    #[doc = "0: `0`"]
18    CRC_RST_CRC_RST_DEFAULT = 0,
19}
20impl From<CRC_RST_CRC_RST_A> for u32 {
21    #[inline(always)]
22    fn from(variant: CRC_RST_CRC_RST_A) -> Self {
23        variant as _
24    }
25}
26#[doc = "Reader of field `CRC_RST_CRC_RST`"]
27pub type CRC_RST_CRC_RST_R = crate::R<u32, CRC_RST_CRC_RST_A>;
28impl CRC_RST_CRC_RST_R {
29    #[doc = r"Get enumerated values variant"]
30    #[inline(always)]
31    pub fn variant(&self) -> crate::Variant<u32, CRC_RST_CRC_RST_A> {
32        use crate::Variant::*;
33        match self.bits {
34            0 => Val(CRC_RST_CRC_RST_A::CRC_RST_CRC_RST_DEFAULT),
35            i => Res(i),
36        }
37    }
38    #[doc = "Checks if the value of the field is `CRC_RST_CRC_RST_DEFAULT`"]
39    #[inline(always)]
40    pub fn is_crc_rst_crc_rst_default(&self) -> bool {
41        *self == CRC_RST_CRC_RST_A::CRC_RST_CRC_RST_DEFAULT
42    }
43}
44#[doc = "Write proxy for field `CRC_RST_CRC_RST`"]
45pub struct CRC_RST_CRC_RST_W<'a> {
46    w: &'a mut W,
47}
48impl<'a> CRC_RST_CRC_RST_W<'a> {
49    #[doc = r"Writes `variant` to the field"]
50    #[inline(always)]
51    pub fn variant(self, variant: CRC_RST_CRC_RST_A) -> &'a mut W {
52        unsafe { self.bits(variant.into()) }
53    }
54    #[doc = "`0`"]
55    #[inline(always)]
56    pub fn crc_rst_crc_rst_default(self) -> &'a mut W {
57        self.variant(CRC_RST_CRC_RST_A::CRC_RST_CRC_RST_DEFAULT)
58    }
59    #[doc = r"Writes raw bits to the field"]
60    #[inline(always)]
61    pub unsafe fn bits(self, value: u32) -> &'a mut W {
62        self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff);
63        self.w
64    }
65}
66impl R {
67    #[doc = "Bits 0:31 - CRC reset value"]
68    #[inline(always)]
69    pub fn crc_rst_crc_rst(&self) -> CRC_RST_CRC_RST_R {
70        CRC_RST_CRC_RST_R::new((self.bits & 0xffff_ffff) as u32)
71    }
72}
73impl W {
74    #[doc = "Bits 0:31 - CRC reset value"]
75    #[inline(always)]
76    pub fn crc_rst_crc_rst(&mut self) -> CRC_RST_CRC_RST_W {
77        CRC_RST_CRC_RST_W { w: self }
78    }
79}