stm32f4/stm32f407/can1/rx/
rdhr.rs

1///Register `RDHR` reader
2pub type R = crate::R<RDHRrs>;
3///Field `DATA(4-7)` reader - DATA%s
4pub type DATA_R = crate::FieldReader;
5impl R {
6    ///DATA(4-7)
7    ///
8    ///<div class="warning">`n` is number of field in register. `n == 0` corresponds to `DATA4` field.</div>
9    #[inline(always)]
10    pub fn data(&self, n: u8) -> DATA_R {
11        #[allow(clippy::no_effect)]
12        [(); 4][n as usize];
13        DATA_R::new(((self.bits >> (n * 8)) & 0xff) as u8)
14    }
15    ///Iterator for array of:
16    ///DATA(4-7)
17    #[inline(always)]
18    pub fn data_iter(&self) -> impl Iterator<Item = DATA_R> + '_ {
19        (0..4).map(move |n| DATA_R::new(((self.bits >> (n * 8)) & 0xff) as u8))
20    }
21    ///Bits 0:7 - DATA4
22    #[inline(always)]
23    pub fn data4(&self) -> DATA_R {
24        DATA_R::new((self.bits & 0xff) as u8)
25    }
26    ///Bits 8:15 - DATA5
27    #[inline(always)]
28    pub fn data5(&self) -> DATA_R {
29        DATA_R::new(((self.bits >> 8) & 0xff) as u8)
30    }
31    ///Bits 16:23 - DATA6
32    #[inline(always)]
33    pub fn data6(&self) -> DATA_R {
34        DATA_R::new(((self.bits >> 16) & 0xff) as u8)
35    }
36    ///Bits 24:31 - DATA7
37    #[inline(always)]
38    pub fn data7(&self) -> DATA_R {
39        DATA_R::new(((self.bits >> 24) & 0xff) as u8)
40    }
41}
42impl core::fmt::Debug for R {
43    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
44        f.debug_struct("RDHR")
45            .field("data4", &self.data4())
46            .field("data5", &self.data5())
47            .field("data6", &self.data6())
48            .field("data7", &self.data7())
49            .finish()
50    }
51}
52/**receive FIFO mailbox data high register
53
54You can [`read`](crate::Reg::read) this register and get [`rdhr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api).*/
55pub struct RDHRrs;
56impl crate::RegisterSpec for RDHRrs {
57    type Ux = u32;
58}
59///`read()` method returns [`rdhr::R`](R) reader structure
60impl crate::Readable for RDHRrs {}
61///`reset()` method sets RDHR to value 0
62impl crate::Resettable for RDHRrs {}