1#[doc = "Register `MISC` reader"]
2pub type R = crate::R<MISC_SPEC>;
3#[doc = "Register `MISC` writer"]
4pub type W = crate::W<MISC_SPEC>;
5#[doc = "Field `CS0_DIS` reader - SPI_CS0 pin enable, 1: disable SPI_CS0, 0: SPI_CS0 pin is active to select SPI device, such as flash, external RAM and so on."]
6pub type CS0_DIS_R = crate::BitReader;
7#[doc = "Field `CS0_DIS` writer - SPI_CS0 pin enable, 1: disable SPI_CS0, 0: SPI_CS0 pin is active to select SPI device, such as flash, external RAM and so on."]
8pub type CS0_DIS_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `CS1_DIS` reader - SPI_CS1 pin enable, 1: disable SPI_CS1, 0: SPI_CS1 pin is active to select SPI device, such as flash, external RAM and so on."]
10pub type CS1_DIS_R = crate::BitReader;
11#[doc = "Field `CS1_DIS` writer - SPI_CS1 pin enable, 1: disable SPI_CS1, 0: SPI_CS1 pin is active to select SPI device, such as flash, external RAM and so on."]
12pub type CS1_DIS_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `CK_IDLE_EDGE` reader - 1: spi clk line is high when idle 0: spi clk line is low when idle"]
14pub type CK_IDLE_EDGE_R = crate::BitReader;
15#[doc = "Field `CK_IDLE_EDGE` writer - 1: spi clk line is high when idle 0: spi clk line is low when idle"]
16pub type CK_IDLE_EDGE_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `CS_KEEP_ACTIVE` reader - spi cs line keep low when the bit is set."]
18pub type CS_KEEP_ACTIVE_R = crate::BitReader;
19#[doc = "Field `CS_KEEP_ACTIVE` writer - spi cs line keep low when the bit is set."]
20pub type CS_KEEP_ACTIVE_W<'a, REG> = crate::BitWriter<'a, REG>;
21impl R {
22 #[doc = "Bit 0 - SPI_CS0 pin enable, 1: disable SPI_CS0, 0: SPI_CS0 pin is active to select SPI device, such as flash, external RAM and so on."]
23 #[inline(always)]
24 pub fn cs0_dis(&self) -> CS0_DIS_R {
25 CS0_DIS_R::new((self.bits & 1) != 0)
26 }
27 #[doc = "Bit 1 - SPI_CS1 pin enable, 1: disable SPI_CS1, 0: SPI_CS1 pin is active to select SPI device, such as flash, external RAM and so on."]
28 #[inline(always)]
29 pub fn cs1_dis(&self) -> CS1_DIS_R {
30 CS1_DIS_R::new(((self.bits >> 1) & 1) != 0)
31 }
32 #[doc = "Bit 9 - 1: spi clk line is high when idle 0: spi clk line is low when idle"]
33 #[inline(always)]
34 pub fn ck_idle_edge(&self) -> CK_IDLE_EDGE_R {
35 CK_IDLE_EDGE_R::new(((self.bits >> 9) & 1) != 0)
36 }
37 #[doc = "Bit 10 - spi cs line keep low when the bit is set."]
38 #[inline(always)]
39 pub fn cs_keep_active(&self) -> CS_KEEP_ACTIVE_R {
40 CS_KEEP_ACTIVE_R::new(((self.bits >> 10) & 1) != 0)
41 }
42}
43#[cfg(feature = "impl-register-debug")]
44impl core::fmt::Debug for R {
45 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
46 f.debug_struct("MISC")
47 .field("cs0_dis", &format_args!("{}", self.cs0_dis().bit()))
48 .field("cs1_dis", &format_args!("{}", self.cs1_dis().bit()))
49 .field(
50 "ck_idle_edge",
51 &format_args!("{}", self.ck_idle_edge().bit()),
52 )
53 .field(
54 "cs_keep_active",
55 &format_args!("{}", self.cs_keep_active().bit()),
56 )
57 .finish()
58 }
59}
60#[cfg(feature = "impl-register-debug")]
61impl core::fmt::Debug for crate::generic::Reg<MISC_SPEC> {
62 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
63 core::fmt::Debug::fmt(&self.read(), f)
64 }
65}
66impl W {
67 #[doc = "Bit 0 - SPI_CS0 pin enable, 1: disable SPI_CS0, 0: SPI_CS0 pin is active to select SPI device, such as flash, external RAM and so on."]
68 #[inline(always)]
69 #[must_use]
70 pub fn cs0_dis(&mut self) -> CS0_DIS_W<MISC_SPEC> {
71 CS0_DIS_W::new(self, 0)
72 }
73 #[doc = "Bit 1 - SPI_CS1 pin enable, 1: disable SPI_CS1, 0: SPI_CS1 pin is active to select SPI device, such as flash, external RAM and so on."]
74 #[inline(always)]
75 #[must_use]
76 pub fn cs1_dis(&mut self) -> CS1_DIS_W<MISC_SPEC> {
77 CS1_DIS_W::new(self, 1)
78 }
79 #[doc = "Bit 9 - 1: spi clk line is high when idle 0: spi clk line is low when idle"]
80 #[inline(always)]
81 #[must_use]
82 pub fn ck_idle_edge(&mut self) -> CK_IDLE_EDGE_W<MISC_SPEC> {
83 CK_IDLE_EDGE_W::new(self, 9)
84 }
85 #[doc = "Bit 10 - spi cs line keep low when the bit is set."]
86 #[inline(always)]
87 #[must_use]
88 pub fn cs_keep_active(&mut self) -> CS_KEEP_ACTIVE_W<MISC_SPEC> {
89 CS_KEEP_ACTIVE_W::new(self, 10)
90 }
91}
92#[doc = "SPI1 misc register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`misc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`misc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
93pub struct MISC_SPEC;
94impl crate::RegisterSpec for MISC_SPEC {
95 type Ux = u32;
96}
97#[doc = "`read()` method returns [`misc::R`](R) reader structure"]
98impl crate::Readable for MISC_SPEC {}
99#[doc = "`write(|w| ..)` method takes [`misc::W`](W) writer structure"]
100impl crate::Writable for MISC_SPEC {
101 type Safety = crate::Unsafe;
102 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
103 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
104}
105#[doc = "`reset()` method sets MISC to value 0x02"]
106impl crate::Resettable for MISC_SPEC {
107 const RESET_VALUE: u32 = 0x02;
108}