stm32f7_staging/stm32f779/spdifrx/
csr.rs

1///Register `CSR` reader
2pub type R = crate::R<CSRrs>;
3///Field `USR` reader - User data information
4pub type USR_R = crate::FieldReader<u16>;
5///Field `CS` reader - Channel A status information
6pub type CS_R = crate::FieldReader;
7///Field `SOB` reader - Start Of Block
8pub type SOB_R = crate::BitReader;
9impl R {
10    ///Bits 0:15 - User data information
11    #[inline(always)]
12    pub fn usr(&self) -> USR_R {
13        USR_R::new((self.bits & 0xffff) as u16)
14    }
15    ///Bits 16:23 - Channel A status information
16    #[inline(always)]
17    pub fn cs(&self) -> CS_R {
18        CS_R::new(((self.bits >> 16) & 0xff) as u8)
19    }
20    ///Bit 24 - Start Of Block
21    #[inline(always)]
22    pub fn sob(&self) -> SOB_R {
23        SOB_R::new(((self.bits >> 24) & 1) != 0)
24    }
25}
26impl core::fmt::Debug for R {
27    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
28        f.debug_struct("CSR")
29            .field("usr", &self.usr())
30            .field("cs", &self.cs())
31            .field("sob", &self.sob())
32            .finish()
33    }
34}
35/**Channel Status register
36
37You can [`read`](crate::Reg::read) this register and get [`csr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api).
38
39See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F779.html#SPDIFRX:CSR)*/
40pub struct CSRrs;
41impl crate::RegisterSpec for CSRrs {
42    type Ux = u32;
43}
44///`read()` method returns [`csr::R`](R) reader structure
45impl crate::Readable for CSRrs {}
46///`reset()` method sets CSR to value 0
47impl crate::Resettable for CSRrs {}