stm32f3_staging/stm32f373/dbgmcu/
idcode.rs

1///Register `IDCODE` reader
2pub type R = crate::R<IDCODErs>;
3///Field `DEV_ID` reader - Device Identifier
4pub type DEV_ID_R = crate::FieldReader<u16>;
5///Field `REV_ID` reader - Revision Identifier
6pub type REV_ID_R = crate::FieldReader<u16>;
7impl R {
8    ///Bits 0:11 - Device Identifier
9    #[inline(always)]
10    pub fn dev_id(&self) -> DEV_ID_R {
11        DEV_ID_R::new((self.bits & 0x0fff) as u16)
12    }
13    ///Bits 16:31 - Revision Identifier
14    #[inline(always)]
15    pub fn rev_id(&self) -> REV_ID_R {
16        REV_ID_R::new(((self.bits >> 16) & 0xffff) as u16)
17    }
18}
19impl core::fmt::Debug for R {
20    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
21        f.debug_struct("IDCODE")
22            .field("dev_id", &self.dev_id())
23            .field("rev_id", &self.rev_id())
24            .finish()
25    }
26}
27/**MCU Device ID Code Register
28
29You can [`read`](crate::Reg::read) this register and get [`idcode::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api).
30
31See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F373.html#DBGMCU:IDCODE)*/
32pub struct IDCODErs;
33impl crate::RegisterSpec for IDCODErs {
34    type Ux = u32;
35}
36///`read()` method returns [`idcode::R`](R) reader structure
37impl crate::Readable for IDCODErs {}
38///`reset()` method sets IDCODE to value 0
39impl crate::Resettable for IDCODErs {
40    const RESET_VALUE: u32 = 0;
41}