corstone300_pac/scc/
sys_cfgctrl.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 `SYS_CFGCTRL` reader"]
6pub struct R(crate::R<SYS_CFGCTRL_SPEC>);
7impl core::ops::Deref for R {
8    type Target = crate::R<SYS_CFGCTRL_SPEC>;
9    #[inline(always)]
10    fn deref(&self) -> &Self::Target {
11        &self.0
12    }
13}
14impl From<crate::R<SYS_CFGCTRL_SPEC>> for R {
15    #[inline(always)]
16    fn from(reader: crate::R<SYS_CFGCTRL_SPEC>) -> Self {
17        R(reader)
18    }
19}
20#[doc = "Register `SYS_CFGCTRL` writer"]
21pub struct W(crate::W<SYS_CFGCTRL_SPEC>);
22impl core::ops::Deref for W {
23    type Target = crate::W<SYS_CFGCTRL_SPEC>;
24    #[inline(always)]
25    fn deref(&self) -> &Self::Target {
26        &self.0
27    }
28}
29impl core::ops::DerefMut for W {
30    #[inline(always)]
31    fn deref_mut(&mut self) -> &mut Self::Target {
32        &mut self.0
33    }
34}
35impl From<crate::W<SYS_CFGCTRL_SPEC>> for W {
36    #[inline(always)]
37    fn from(writer: crate::W<SYS_CFGCTRL_SPEC>) -> Self {
38        W(writer)
39    }
40}
41#[doc = "Field `DEVICE` reader - Device (value of 0/1/2 for supported clocks"]
42pub type DEVICE_R = crate::FieldReader<u16, u16>;
43#[doc = "Field `DEVICE` writer - Device (value of 0/1/2 for supported clocks"]
44pub type DEVICE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SYS_CFGCTRL_SPEC, u16, u16, 12, O>;
45#[doc = "Field `RFUNCVAL` reader - Function Value"]
46pub type RFUNCVAL_R = crate::FieldReader<u8, u8>;
47#[doc = "Field `RFUNCVAL` writer - Function Value"]
48pub type RFUNCVAL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SYS_CFGCTRL_SPEC, u8, u8, 6, O>;
49#[doc = "Field `RW_ACCESS` reader - Read/Write Access"]
50pub type RW_ACCESS_R = crate::BitReader<bool>;
51#[doc = "Field `RW_ACCESS` writer - Read/Write Access"]
52pub type RW_ACCESS_W<'a, const O: u8> = crate::BitWriter<'a, u32, SYS_CFGCTRL_SPEC, bool, O>;
53#[doc = "Field `START` reader - Start: generates interrupt on write to this bit"]
54pub type START_R = crate::BitReader<bool>;
55#[doc = "Field `START` writer - Start: generates interrupt on write to this bit"]
56pub type START_W<'a, const O: u8> = crate::BitWriter<'a, u32, SYS_CFGCTRL_SPEC, bool, O>;
57impl R {
58    #[doc = "Bits 0:11 - Device (value of 0/1/2 for supported clocks"]
59    #[inline(always)]
60    pub fn device(&self) -> DEVICE_R {
61        DEVICE_R::new((self.bits & 0x0fff) as u16)
62    }
63    #[doc = "Bits 20:25 - Function Value"]
64    #[inline(always)]
65    pub fn rfuncval(&self) -> RFUNCVAL_R {
66        RFUNCVAL_R::new(((self.bits >> 20) & 0x3f) as u8)
67    }
68    #[doc = "Bit 30 - Read/Write Access"]
69    #[inline(always)]
70    pub fn rw_access(&self) -> RW_ACCESS_R {
71        RW_ACCESS_R::new(((self.bits >> 30) & 1) != 0)
72    }
73    #[doc = "Bit 31 - Start: generates interrupt on write to this bit"]
74    #[inline(always)]
75    pub fn start(&self) -> START_R {
76        START_R::new(((self.bits >> 31) & 1) != 0)
77    }
78}
79impl W {
80    #[doc = "Bits 0:11 - Device (value of 0/1/2 for supported clocks"]
81    #[inline(always)]
82    pub fn device(&mut self) -> DEVICE_W<0> {
83        DEVICE_W::new(self)
84    }
85    #[doc = "Bits 20:25 - Function Value"]
86    #[inline(always)]
87    pub fn rfuncval(&mut self) -> RFUNCVAL_W<20> {
88        RFUNCVAL_W::new(self)
89    }
90    #[doc = "Bit 30 - Read/Write Access"]
91    #[inline(always)]
92    pub fn rw_access(&mut self) -> RW_ACCESS_W<30> {
93        RW_ACCESS_W::new(self)
94    }
95    #[doc = "Bit 31 - Start: generates interrupt on write to this bit"]
96    #[inline(always)]
97    pub fn start(&mut self) -> START_W<31> {
98        START_W::new(self)
99    }
100    #[doc = "Writes raw bits to the register."]
101    #[inline(always)]
102    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
103        self.0.bits(bits);
104        self
105    }
106}
107#[doc = "\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sys_cfgctrl](index.html) module"]
108pub struct SYS_CFGCTRL_SPEC;
109impl crate::RegisterSpec for SYS_CFGCTRL_SPEC {
110    type Ux = u32;
111}
112#[doc = "`read()` method returns [sys_cfgctrl::R](R) reader structure"]
113impl crate::Readable for SYS_CFGCTRL_SPEC {
114    type Reader = R;
115}
116#[doc = "`write(|w| ..)` method takes [sys_cfgctrl::W](W) writer structure"]
117impl crate::Writable for SYS_CFGCTRL_SPEC {
118    type Writer = W;
119}
120#[doc = "`reset()` method sets SYS_CFGCTRL to value 0"]
121impl crate::Resettable for SYS_CFGCTRL_SPEC {
122    #[inline(always)]
123    fn reset_value() -> Self::Ux {
124        0
125    }
126}