rp2040_pac/ppb/
mpu_type.rs

1#[doc = "Register `MPU_TYPE` reader"]
2pub type R = crate::R<MPU_TYPE_SPEC>;
3#[doc = "Field `SEPARATE` reader - Indicates support for separate instruction and data address maps. Reads as 0 as ARMv6-M only supports a unified MPU."]
4pub type SEPARATE_R = crate::BitReader;
5#[doc = "Field `DREGION` reader - Number of regions supported by the MPU."]
6pub type DREGION_R = crate::FieldReader;
7#[doc = "Field `IREGION` reader - Instruction region. Reads as zero as ARMv6-M only supports a unified MPU."]
8pub type IREGION_R = crate::FieldReader;
9impl R {
10    #[doc = "Bit 0 - Indicates support for separate instruction and data address maps. Reads as 0 as ARMv6-M only supports a unified MPU."]
11    #[inline(always)]
12    pub fn separate(&self) -> SEPARATE_R {
13        SEPARATE_R::new((self.bits & 1) != 0)
14    }
15    #[doc = "Bits 8:15 - Number of regions supported by the MPU."]
16    #[inline(always)]
17    pub fn dregion(&self) -> DREGION_R {
18        DREGION_R::new(((self.bits >> 8) & 0xff) as u8)
19    }
20    #[doc = "Bits 16:23 - Instruction region. Reads as zero as ARMv6-M only supports a unified MPU."]
21    #[inline(always)]
22    pub fn iregion(&self) -> IREGION_R {
23        IREGION_R::new(((self.bits >> 16) & 0xff) as u8)
24    }
25}
26#[doc = "Read the MPU Type Register to determine if the processor implements an MPU, and how many regions the MPU supports.  
27
28You can [`read`](crate::generic::Reg::read) this register and get [`mpu_type::R`](R).  See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
29pub struct MPU_TYPE_SPEC;
30impl crate::RegisterSpec for MPU_TYPE_SPEC {
31    type Ux = u32;
32}
33#[doc = "`read()` method returns [`mpu_type::R`](R) reader structure"]
34impl crate::Readable for MPU_TYPE_SPEC {}
35#[doc = "`reset()` method sets MPU_TYPE to value 0x0800"]
36impl crate::Resettable for MPU_TYPE_SPEC {
37    const RESET_VALUE: u32 = 0x0800;
38}