corstone300_pac/isram0mpc/
pidr4.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 `PIDR4` reader"]
6pub struct R(crate::R<PIDR4_SPEC>);
7impl core::ops::Deref for R {
8    type Target = crate::R<PIDR4_SPEC>;
9    #[inline(always)]
10    fn deref(&self) -> &Self::Target {
11        &self.0
12    }
13}
14impl From<crate::R<PIDR4_SPEC>> for R {
15    #[inline(always)]
16    fn from(reader: crate::R<PIDR4_SPEC>) -> Self {
17        R(reader)
18    }
19}
20#[doc = "Field `jep106_c_code` reader - jep106_c_code"]
21pub type JEP106_C_CODE_R = crate::FieldReader<u8, u8>;
22#[doc = "Field `block_count` reader - block count"]
23pub type BLOCK_COUNT_R = crate::FieldReader<u8, u8>;
24impl R {
25    #[doc = "Bits 0:3 - jep106_c_code"]
26    #[inline(always)]
27    pub fn jep106_c_code(&self) -> JEP106_C_CODE_R {
28        JEP106_C_CODE_R::new((self.bits & 0x0f) as u8)
29    }
30    #[doc = "Bits 4:7 - block count"]
31    #[inline(always)]
32    pub fn block_count(&self) -> BLOCK_COUNT_R {
33        BLOCK_COUNT_R::new(((self.bits >> 4) & 0x0f) as u8)
34    }
35}
36#[doc = "Peripheral ID 4\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 [pidr4](index.html) module"]
37pub struct PIDR4_SPEC;
38impl crate::RegisterSpec for PIDR4_SPEC {
39    type Ux = u32;
40}
41#[doc = "`read()` method returns [pidr4::R](R) reader structure"]
42impl crate::Readable for PIDR4_SPEC {
43    type Reader = R;
44}
45#[doc = "`reset()` method sets PIDR4 to value 0x04"]
46impl crate::Resettable for PIDR4_SPEC {
47    #[inline(always)]
48    fn reset_value() -> Self::Ux {
49        0x04
50    }
51}