1#[doc = "Register `BUSSCNT%s` reader"]
2pub struct R(crate::R<BUSSCNT_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<BUSSCNT_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<BUSSCNT_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<BUSSCNT_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `BUSSCNT%s` writer"]
17pub struct W(crate::W<BUSSCNT_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<BUSSCNT_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<BUSSCNT_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<BUSSCNT_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `ARBMET` reader - Arbitration MethodSpecify the priority between groups"]
38pub type ARBMET_R = crate::FieldReader<u8, ARBMET_A>;
39#[doc = "Arbitration MethodSpecify the priority between groups\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41#[repr(u8)]
42pub enum ARBMET_A {
43 #[doc = "0: fixed priority"]
44 _00 = 0,
45 #[doc = "1: round-robin"]
46 _01 = 1,
47}
48impl From<ARBMET_A> for u8 {
49 #[inline(always)]
50 fn from(variant: ARBMET_A) -> Self {
51 variant as _
52 }
53}
54impl ARBMET_R {
55 #[doc = "Get enumerated values variant"]
56 #[inline(always)]
57 pub fn variant(&self) -> Option<ARBMET_A> {
58 match self.bits {
59 0 => Some(ARBMET_A::_00),
60 1 => Some(ARBMET_A::_01),
61 _ => None,
62 }
63 }
64 #[doc = "Checks if the value of the field is `_00`"]
65 #[inline(always)]
66 pub fn is_00(&self) -> bool {
67 *self == ARBMET_A::_00
68 }
69 #[doc = "Checks if the value of the field is `_01`"]
70 #[inline(always)]
71 pub fn is_01(&self) -> bool {
72 *self == ARBMET_A::_01
73 }
74}
75#[doc = "Field `ARBMET` writer - Arbitration MethodSpecify the priority between groups"]
76pub type ARBMET_W<'a, const O: u8> = crate::FieldWriter<'a, u16, BUSSCNT_SPEC, u8, ARBMET_A, 2, O>;
77impl<'a, const O: u8> ARBMET_W<'a, O> {
78 #[doc = "fixed priority"]
79 #[inline(always)]
80 pub fn _00(self) -> &'a mut W {
81 self.variant(ARBMET_A::_00)
82 }
83 #[doc = "round-robin"]
84 #[inline(always)]
85 pub fn _01(self) -> &'a mut W {
86 self.variant(ARBMET_A::_01)
87 }
88}
89impl R {
90 #[doc = "Bits 4:5 - Arbitration MethodSpecify the priority between groups"]
91 #[inline(always)]
92 pub fn arbmet(&self) -> ARBMET_R {
93 ARBMET_R::new(((self.bits >> 4) & 3) as u8)
94 }
95}
96impl W {
97 #[doc = "Bits 4:5 - Arbitration MethodSpecify the priority between groups"]
98 #[inline(always)]
99 #[must_use]
100 pub fn arbmet(&mut self) -> ARBMET_W<4> {
101 ARBMET_W::new(self)
102 }
103 #[doc = "Writes raw bits to the register."]
104 #[inline(always)]
105 pub unsafe fn bits(&mut self, bits: u16) -> &mut Self {
106 self.0.bits(bits);
107 self
108 }
109}
110#[doc = "Slave Bus Control Register %s\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 [busscnt](index.html) module"]
111pub struct BUSSCNT_SPEC;
112impl crate::RegisterSpec for BUSSCNT_SPEC {
113 type Ux = u16;
114}
115#[doc = "`read()` method returns [busscnt::R](R) reader structure"]
116impl crate::Readable for BUSSCNT_SPEC {
117 type Reader = R;
118}
119#[doc = "`write(|w| ..)` method takes [busscnt::W](W) writer structure"]
120impl crate::Writable for BUSSCNT_SPEC {
121 type Writer = W;
122 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
123 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
124}
125#[doc = "`reset()` method sets BUSSCNT%s to value 0"]
126impl crate::Resettable for BUSSCNT_SPEC {
127 const RESET_VALUE: Self::Ux = 0;
128}