bl702_pac/i2s/
i2s_io_config.rs1#[doc = "Register `i2s_io_config` reader"]
2pub struct R(crate::R<I2S_IO_CONFIG_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<I2S_IO_CONFIG_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<I2S_IO_CONFIG_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<I2S_IO_CONFIG_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `i2s_io_config` writer"]
17pub struct W(crate::W<I2S_IO_CONFIG_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<I2S_IO_CONFIG_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<I2S_IO_CONFIG_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<I2S_IO_CONFIG_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `cr_i2s_txd_inv` reader - "]
38pub type CR_I2S_TXD_INV_R = crate::BitReader<bool>;
39#[doc = "Field `cr_i2s_txd_inv` writer - "]
40pub type CR_I2S_TXD_INV_W<'a, const O: u8> = crate::BitWriter<'a, u32, I2S_IO_CONFIG_SPEC, bool, O>;
41#[doc = "Field `cr_i2s_rxd_inv` reader - "]
42pub type CR_I2S_RXD_INV_R = crate::BitReader<bool>;
43#[doc = "Field `cr_i2s_rxd_inv` writer - "]
44pub type CR_I2S_RXD_INV_W<'a, const O: u8> = crate::BitWriter<'a, u32, I2S_IO_CONFIG_SPEC, bool, O>;
45#[doc = "Field `cr_i2s_fs_inv` reader - "]
46pub type CR_I2S_FS_INV_R = crate::BitReader<bool>;
47#[doc = "Field `cr_i2s_fs_inv` writer - "]
48pub type CR_I2S_FS_INV_W<'a, const O: u8> = crate::BitWriter<'a, u32, I2S_IO_CONFIG_SPEC, bool, O>;
49#[doc = "Field `cr_i2s_bclk_inv` reader - "]
50pub type CR_I2S_BCLK_INV_R = crate::BitReader<bool>;
51#[doc = "Field `cr_i2s_bclk_inv` writer - "]
52pub type CR_I2S_BCLK_INV_W<'a, const O: u8> =
53 crate::BitWriter<'a, u32, I2S_IO_CONFIG_SPEC, bool, O>;
54#[doc = "Field `cr_deg_cnt` reader - "]
55pub type CR_DEG_CNT_R = crate::FieldReader<u8, u8>;
56#[doc = "Field `cr_deg_cnt` writer - "]
57pub type CR_DEG_CNT_W<'a, const O: u8> =
58 crate::FieldWriter<'a, u32, I2S_IO_CONFIG_SPEC, u8, u8, 3, O>;
59#[doc = "Field `cr_deg_en` reader - "]
60pub type CR_DEG_EN_R = crate::BitReader<bool>;
61#[doc = "Field `cr_deg_en` writer - "]
62pub type CR_DEG_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, I2S_IO_CONFIG_SPEC, bool, O>;
63impl R {
64 #[doc = "Bit 0"]
65 #[inline(always)]
66 pub fn cr_i2s_txd_inv(&self) -> CR_I2S_TXD_INV_R {
67 CR_I2S_TXD_INV_R::new((self.bits & 1) != 0)
68 }
69 #[doc = "Bit 1"]
70 #[inline(always)]
71 pub fn cr_i2s_rxd_inv(&self) -> CR_I2S_RXD_INV_R {
72 CR_I2S_RXD_INV_R::new(((self.bits >> 1) & 1) != 0)
73 }
74 #[doc = "Bit 2"]
75 #[inline(always)]
76 pub fn cr_i2s_fs_inv(&self) -> CR_I2S_FS_INV_R {
77 CR_I2S_FS_INV_R::new(((self.bits >> 2) & 1) != 0)
78 }
79 #[doc = "Bit 3"]
80 #[inline(always)]
81 pub fn cr_i2s_bclk_inv(&self) -> CR_I2S_BCLK_INV_R {
82 CR_I2S_BCLK_INV_R::new(((self.bits >> 3) & 1) != 0)
83 }
84 #[doc = "Bits 4:6"]
85 #[inline(always)]
86 pub fn cr_deg_cnt(&self) -> CR_DEG_CNT_R {
87 CR_DEG_CNT_R::new(((self.bits >> 4) & 7) as u8)
88 }
89 #[doc = "Bit 7"]
90 #[inline(always)]
91 pub fn cr_deg_en(&self) -> CR_DEG_EN_R {
92 CR_DEG_EN_R::new(((self.bits >> 7) & 1) != 0)
93 }
94}
95impl W {
96 #[doc = "Bit 0"]
97 #[inline(always)]
98 #[must_use]
99 pub fn cr_i2s_txd_inv(&mut self) -> CR_I2S_TXD_INV_W<0> {
100 CR_I2S_TXD_INV_W::new(self)
101 }
102 #[doc = "Bit 1"]
103 #[inline(always)]
104 #[must_use]
105 pub fn cr_i2s_rxd_inv(&mut self) -> CR_I2S_RXD_INV_W<1> {
106 CR_I2S_RXD_INV_W::new(self)
107 }
108 #[doc = "Bit 2"]
109 #[inline(always)]
110 #[must_use]
111 pub fn cr_i2s_fs_inv(&mut self) -> CR_I2S_FS_INV_W<2> {
112 CR_I2S_FS_INV_W::new(self)
113 }
114 #[doc = "Bit 3"]
115 #[inline(always)]
116 #[must_use]
117 pub fn cr_i2s_bclk_inv(&mut self) -> CR_I2S_BCLK_INV_W<3> {
118 CR_I2S_BCLK_INV_W::new(self)
119 }
120 #[doc = "Bits 4:6"]
121 #[inline(always)]
122 #[must_use]
123 pub fn cr_deg_cnt(&mut self) -> CR_DEG_CNT_W<4> {
124 CR_DEG_CNT_W::new(self)
125 }
126 #[doc = "Bit 7"]
127 #[inline(always)]
128 #[must_use]
129 pub fn cr_deg_en(&mut self) -> CR_DEG_EN_W<7> {
130 CR_DEG_EN_W::new(self)
131 }
132 #[doc = "Writes raw bits to the register."]
133 #[inline(always)]
134 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
135 self.0.bits(bits);
136 self
137 }
138}
139#[doc = "i2s_io_config.\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 [i2s_io_config](index.html) module"]
140pub struct I2S_IO_CONFIG_SPEC;
141impl crate::RegisterSpec for I2S_IO_CONFIG_SPEC {
142 type Ux = u32;
143}
144#[doc = "`read()` method returns [i2s_io_config::R](R) reader structure"]
145impl crate::Readable for I2S_IO_CONFIG_SPEC {
146 type Reader = R;
147}
148#[doc = "`write(|w| ..)` method takes [i2s_io_config::W](W) writer structure"]
149impl crate::Writable for I2S_IO_CONFIG_SPEC {
150 type Writer = W;
151 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
152 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
153}
154#[doc = "`reset()` method sets i2s_io_config to value 0"]
155impl crate::Resettable for I2S_IO_CONFIG_SPEC {
156 const RESET_VALUE: Self::Ux = 0;
157}