corstone300_pac/scc/
id.rs

1// Copyright 2022 Arm Limited and/or its affiliates <open-source-office@arm.com>
2//
3// SPDX-License-Identifier: MIT
4
5#[doc = "Register `ID` reader"]
6pub struct R(crate::R<ID_SPEC>);
7impl core::ops::Deref for R {
8    type Target = crate::R<ID_SPEC>;
9    #[inline(always)]
10    fn deref(&self) -> &Self::Target {
11        &self.0
12    }
13}
14impl From<crate::R<ID_SPEC>> for R {
15    #[inline(always)]
16    fn from(reader: crate::R<ID_SPEC>) -> Self {
17        R(reader)
18    }
19}
20#[doc = "Field `APP_REV` reader - Application note IP revision number"]
21pub type APP_REV_R = crate::FieldReader<u8, u8>;
22#[doc = "Field `PRI_NUM` reader - Primary Part Number: 521 = AN521"]
23pub type PRI_NUM_R = crate::FieldReader<u16, u16>;
24#[doc = "Field `IP_ARCH` reader - IP Architecture: 0x4 = AHB"]
25pub type IP_ARCH_R = crate::FieldReader<u8, u8>;
26#[doc = "Field `APP_NOTE_VAR` reader - Application note IP variant number"]
27pub type APP_NOTE_VAR_R = crate::FieldReader<u8, u8>;
28#[doc = "Field `IMPLEMENTER_ID` reader - Implementer ID: 0x41 = ARM"]
29pub type IMPLEMENTER_ID_R = crate::FieldReader<u8, u8>;
30impl R {
31    #[doc = "Bits 0:3 - Application note IP revision number"]
32    #[inline(always)]
33    pub fn app_rev(&self) -> APP_REV_R {
34        APP_REV_R::new((self.bits & 0x0f) as u8)
35    }
36    #[doc = "Bits 4:15 - Primary Part Number: 521 = AN521"]
37    #[inline(always)]
38    pub fn pri_num(&self) -> PRI_NUM_R {
39        PRI_NUM_R::new(((self.bits >> 4) & 0x0fff) as u16)
40    }
41    #[doc = "Bits 16:19 - IP Architecture: 0x4 = AHB"]
42    #[inline(always)]
43    pub fn ip_arch(&self) -> IP_ARCH_R {
44        IP_ARCH_R::new(((self.bits >> 16) & 0x0f) as u8)
45    }
46    #[doc = "Bits 20:23 - Application note IP variant number"]
47    #[inline(always)]
48    pub fn app_note_var(&self) -> APP_NOTE_VAR_R {
49        APP_NOTE_VAR_R::new(((self.bits >> 20) & 0x0f) as u8)
50    }
51    #[doc = "Bits 24:31 - Implementer ID: 0x41 = ARM"]
52    #[inline(always)]
53    pub fn implementer_id(&self) -> IMPLEMENTER_ID_R {
54        IMPLEMENTER_ID_R::new(((self.bits >> 24) & 0xff) as u8)
55    }
56}
57#[doc = "\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [id](index.html) module"]
58pub struct ID_SPEC;
59impl crate::RegisterSpec for ID_SPEC {
60    type Ux = u32;
61}
62#[doc = "`read()` method returns [id::R](R) reader structure"]
63impl crate::Readable for ID_SPEC {
64    type Reader = R;
65}
66#[doc = "`reset()` method sets ID to value 0"]
67impl crate::Resettable for ID_SPEC {
68    #[inline(always)]
69    fn reset_value() -> Self::Ux {
70        0
71    }
72}