stm32f1_staging/stm32f100/cec/
csr.rs

1///Register `CSR` reader
2pub type R = crate::R<CSRrs>;
3///Register `CSR` writer
4pub type W = crate::W<CSRrs>;
5///Field `TSOM` reader - Tx start of message
6pub type TSOM_R = crate::BitReader;
7///Field `TSOM` writer - Tx start of message
8pub type TSOM_W<'a, REG> = crate::BitWriter<'a, REG>;
9///Field `TEOM` reader - Tx end of message
10pub type TEOM_R = crate::BitReader;
11///Field `TEOM` writer - Tx end of message
12pub type TEOM_W<'a, REG> = crate::BitWriter<'a, REG>;
13///Field `TERR` reader - Tx error
14pub type TERR_R = crate::BitReader;
15///Field `TERR` writer - Tx error
16pub type TERR_W<'a, REG> = crate::BitWriter<'a, REG>;
17///Field `TBTRF` reader - Tx byte transfer request or block transfer finished
18pub type TBTRF_R = crate::BitReader;
19///Field `TBTRF` writer - Tx byte transfer request or block transfer finished
20pub type TBTRF_W<'a, REG> = crate::BitWriter<'a, REG>;
21///Field `RSOM` reader - Rx start of message
22pub type RSOM_R = crate::BitReader;
23///Field `RSOM` writer - Rx start of message
24pub type RSOM_W<'a, REG> = crate::BitWriter<'a, REG>;
25///Field `REOM` reader - Rx end of message
26pub type REOM_R = crate::BitReader;
27///Field `REOM` writer - Rx end of message
28pub type REOM_W<'a, REG> = crate::BitWriter<'a, REG>;
29///Field `RERR` reader - Rx error
30pub type RERR_R = crate::BitReader;
31///Field `RERR` writer - Rx error
32pub type RERR_W<'a, REG> = crate::BitWriter<'a, REG>;
33///Field `RBTF` reader - Rx byte/block transfer finished
34pub type RBTF_R = crate::BitReader;
35///Field `RBTF` writer - Rx byte/block transfer finished
36pub type RBTF_W<'a, REG> = crate::BitWriter<'a, REG>;
37impl R {
38    ///Bit 0 - Tx start of message
39    #[inline(always)]
40    pub fn tsom(&self) -> TSOM_R {
41        TSOM_R::new((self.bits & 1) != 0)
42    }
43    ///Bit 1 - Tx end of message
44    #[inline(always)]
45    pub fn teom(&self) -> TEOM_R {
46        TEOM_R::new(((self.bits >> 1) & 1) != 0)
47    }
48    ///Bit 2 - Tx error
49    #[inline(always)]
50    pub fn terr(&self) -> TERR_R {
51        TERR_R::new(((self.bits >> 2) & 1) != 0)
52    }
53    ///Bit 3 - Tx byte transfer request or block transfer finished
54    #[inline(always)]
55    pub fn tbtrf(&self) -> TBTRF_R {
56        TBTRF_R::new(((self.bits >> 3) & 1) != 0)
57    }
58    ///Bit 4 - Rx start of message
59    #[inline(always)]
60    pub fn rsom(&self) -> RSOM_R {
61        RSOM_R::new(((self.bits >> 4) & 1) != 0)
62    }
63    ///Bit 5 - Rx end of message
64    #[inline(always)]
65    pub fn reom(&self) -> REOM_R {
66        REOM_R::new(((self.bits >> 5) & 1) != 0)
67    }
68    ///Bit 6 - Rx error
69    #[inline(always)]
70    pub fn rerr(&self) -> RERR_R {
71        RERR_R::new(((self.bits >> 6) & 1) != 0)
72    }
73    ///Bit 7 - Rx byte/block transfer finished
74    #[inline(always)]
75    pub fn rbtf(&self) -> RBTF_R {
76        RBTF_R::new(((self.bits >> 7) & 1) != 0)
77    }
78}
79impl core::fmt::Debug for R {
80    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
81        f.debug_struct("CSR")
82            .field("tsom", &self.tsom())
83            .field("teom", &self.teom())
84            .field("terr", &self.terr())
85            .field("tbtrf", &self.tbtrf())
86            .field("rsom", &self.rsom())
87            .field("reom", &self.reom())
88            .field("rerr", &self.rerr())
89            .field("rbtf", &self.rbtf())
90            .finish()
91    }
92}
93impl W {
94    ///Bit 0 - Tx start of message
95    #[inline(always)]
96    pub fn tsom(&mut self) -> TSOM_W<CSRrs> {
97        TSOM_W::new(self, 0)
98    }
99    ///Bit 1 - Tx end of message
100    #[inline(always)]
101    pub fn teom(&mut self) -> TEOM_W<CSRrs> {
102        TEOM_W::new(self, 1)
103    }
104    ///Bit 2 - Tx error
105    #[inline(always)]
106    pub fn terr(&mut self) -> TERR_W<CSRrs> {
107        TERR_W::new(self, 2)
108    }
109    ///Bit 3 - Tx byte transfer request or block transfer finished
110    #[inline(always)]
111    pub fn tbtrf(&mut self) -> TBTRF_W<CSRrs> {
112        TBTRF_W::new(self, 3)
113    }
114    ///Bit 4 - Rx start of message
115    #[inline(always)]
116    pub fn rsom(&mut self) -> RSOM_W<CSRrs> {
117        RSOM_W::new(self, 4)
118    }
119    ///Bit 5 - Rx end of message
120    #[inline(always)]
121    pub fn reom(&mut self) -> REOM_W<CSRrs> {
122        REOM_W::new(self, 5)
123    }
124    ///Bit 6 - Rx error
125    #[inline(always)]
126    pub fn rerr(&mut self) -> RERR_W<CSRrs> {
127        RERR_W::new(self, 6)
128    }
129    ///Bit 7 - Rx byte/block transfer finished
130    #[inline(always)]
131    pub fn rbtf(&mut self) -> RBTF_W<CSRrs> {
132        RBTF_W::new(self, 7)
133    }
134}
135/**CEC control and status register
136
137You can [`read`](crate::Reg::read) this register and get [`csr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`csr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
138
139See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F100.html#CEC:CSR)*/
140pub struct CSRrs;
141impl crate::RegisterSpec for CSRrs {
142    type Ux = u32;
143}
144///`read()` method returns [`csr::R`](R) reader structure
145impl crate::Readable for CSRrs {}
146///`write(|w| ..)` method takes [`csr::W`](W) writer structure
147impl crate::Writable for CSRrs {
148    type Safety = crate::Unsafe;
149}
150///`reset()` method sets CSR to value 0
151impl crate::Resettable for CSRrs {}