Skip to main content

rsl10_pac/bb/
bb_isotrcnl1.rs

1#[doc = "Reader of register BB_ISOTRCNL1"]
2pub type R = crate::R<u32, super::BB_ISOTRCNL1>;
3#[doc = "Writer for register BB_ISOTRCNL1"]
4pub type W = crate::W<u32, super::BB_ISOTRCNL1>;
5#[doc = "Register BB_ISOTRCNL1 `reset()`'s with value 0"]
6impl crate::ResetValue for super::BB_ISOTRCNL1 {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0
11    }
12}
13#[doc = "Negotiated, maximum expected number of bytes for ISO Channel 0 Rx payloads\n\nValue on reset: 0"]
14#[derive(Clone, Copy, Debug, PartialEq)]
15#[repr(u8)]
16pub enum ISO1RXLEN_A {
17    #[doc = "0: `0`"]
18    ISO1RXLEN_0 = 0,
19}
20impl From<ISO1RXLEN_A> for u8 {
21    #[inline(always)]
22    fn from(variant: ISO1RXLEN_A) -> Self {
23        variant as _
24    }
25}
26#[doc = "Reader of field `ISO1RXLEN`"]
27pub type ISO1RXLEN_R = crate::R<u8, ISO1RXLEN_A>;
28impl ISO1RXLEN_R {
29    #[doc = r"Get enumerated values variant"]
30    #[inline(always)]
31    pub fn variant(&self) -> crate::Variant<u8, ISO1RXLEN_A> {
32        use crate::Variant::*;
33        match self.bits {
34            0 => Val(ISO1RXLEN_A::ISO1RXLEN_0),
35            i => Res(i),
36        }
37    }
38    #[doc = "Checks if the value of the field is `ISO1RXLEN_0`"]
39    #[inline(always)]
40    pub fn is_iso1rxlen_0(&self) -> bool {
41        *self == ISO1RXLEN_A::ISO1RXLEN_0
42    }
43}
44#[doc = "Write proxy for field `ISO1RXLEN`"]
45pub struct ISO1RXLEN_W<'a> {
46    w: &'a mut W,
47}
48impl<'a> ISO1RXLEN_W<'a> {
49    #[doc = r"Writes `variant` to the field"]
50    #[inline(always)]
51    pub fn variant(self, variant: ISO1RXLEN_A) -> &'a mut W {
52        unsafe { self.bits(variant.into()) }
53    }
54    #[doc = "`0`"]
55    #[inline(always)]
56    pub fn iso1rxlen_0(self) -> &'a mut W {
57        self.variant(ISO1RXLEN_A::ISO1RXLEN_0)
58    }
59    #[doc = r"Writes raw bits to the field"]
60    #[inline(always)]
61    pub unsafe fn bits(self, value: u8) -> &'a mut W {
62        self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16);
63        self.w
64    }
65}
66#[doc = "Negotiated, number of bytes for ISO Channel 0 Tx payloads\n\nValue on reset: 0"]
67#[derive(Clone, Copy, Debug, PartialEq)]
68#[repr(u8)]
69pub enum ISO1TXLEN_A {
70    #[doc = "0: `0`"]
71    ISO1TXLEN_0 = 0,
72}
73impl From<ISO1TXLEN_A> for u8 {
74    #[inline(always)]
75    fn from(variant: ISO1TXLEN_A) -> Self {
76        variant as _
77    }
78}
79#[doc = "Reader of field `ISO1TXLEN`"]
80pub type ISO1TXLEN_R = crate::R<u8, ISO1TXLEN_A>;
81impl ISO1TXLEN_R {
82    #[doc = r"Get enumerated values variant"]
83    #[inline(always)]
84    pub fn variant(&self) -> crate::Variant<u8, ISO1TXLEN_A> {
85        use crate::Variant::*;
86        match self.bits {
87            0 => Val(ISO1TXLEN_A::ISO1TXLEN_0),
88            i => Res(i),
89        }
90    }
91    #[doc = "Checks if the value of the field is `ISO1TXLEN_0`"]
92    #[inline(always)]
93    pub fn is_iso1txlen_0(&self) -> bool {
94        *self == ISO1TXLEN_A::ISO1TXLEN_0
95    }
96}
97#[doc = "Write proxy for field `ISO1TXLEN`"]
98pub struct ISO1TXLEN_W<'a> {
99    w: &'a mut W,
100}
101impl<'a> ISO1TXLEN_W<'a> {
102    #[doc = r"Writes `variant` to the field"]
103    #[inline(always)]
104    pub fn variant(self, variant: ISO1TXLEN_A) -> &'a mut W {
105        unsafe { self.bits(variant.into()) }
106    }
107    #[doc = "`0`"]
108    #[inline(always)]
109    pub fn iso1txlen_0(self) -> &'a mut W {
110        self.variant(ISO1TXLEN_A::ISO1TXLEN_0)
111    }
112    #[doc = r"Writes raw bits to the field"]
113    #[inline(always)]
114    pub unsafe fn bits(self, value: u8) -> &'a mut W {
115        self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff);
116        self.w
117    }
118}
119impl R {
120    #[doc = "Bits 16:23 - Negotiated, maximum expected number of bytes for ISO Channel 0 Rx payloads"]
121    #[inline(always)]
122    pub fn iso1rxlen(&self) -> ISO1RXLEN_R {
123        ISO1RXLEN_R::new(((self.bits >> 16) & 0xff) as u8)
124    }
125    #[doc = "Bits 0:7 - Negotiated, number of bytes for ISO Channel 0 Tx payloads"]
126    #[inline(always)]
127    pub fn iso1txlen(&self) -> ISO1TXLEN_R {
128        ISO1TXLEN_R::new((self.bits & 0xff) as u8)
129    }
130}
131impl W {
132    #[doc = "Bits 16:23 - Negotiated, maximum expected number of bytes for ISO Channel 0 Rx payloads"]
133    #[inline(always)]
134    pub fn iso1rxlen(&mut self) -> ISO1RXLEN_W {
135        ISO1RXLEN_W { w: self }
136    }
137    #[doc = "Bits 0:7 - Negotiated, number of bytes for ISO Channel 0 Tx payloads"]
138    #[inline(always)]
139    pub fn iso1txlen(&mut self) -> ISO1TXLEN_W {
140        ISO1TXLEN_W { w: self }
141    }
142}