cyt4bb_b/m7/ipc/struct_/
acquire.rs1#[doc = "Register `ACQUIRE` reader"]
2pub struct R(crate::R<ACQUIRE_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<ACQUIRE_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<ACQUIRE_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<ACQUIRE_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Field `P` reader - User/privileged access control: '0': user mode. '1': privileged mode. This field is set with the user/privileged access control of the access that successfully acquired the lock."]
17pub type P_R = crate::BitReader<bool>;
18#[doc = "Field `NS` reader - Secure/non-secure access control: '0': secure. '1': non-secure. This field is set with the secure/non-secure access control of the access that successfully acquired the lock."]
19pub type NS_R = crate::BitReader<bool>;
20#[doc = "Field `PC` reader - This field specifies the protection context that successfully acquired the lock."]
21pub type PC_R = crate::FieldReader<u8, u8>;
22#[doc = "Field `MS` reader - This field specifies the bus master identifier that successfully acquired the lock."]
23pub type MS_R = crate::FieldReader<u8, u8>;
24#[doc = "Field `SUCCESS` reader - Specifies if the lock is successfully acquired or not (reading the ACQUIRE register can have affect on SUCCESS and LOCK_STATUS.ACQUIRED): '0': Not successfully acquired; i.e. the lock was already acquired by another read transaction and not released. The P, NS, PC and MS fields reflect the access attributes of the transaction that previously successfully acuired the lock; the fields are NOT affected by the current access. '1': Successfully acquired. The P, NS, PC and MS fields reflect the access attributes of the current access. Note that this field is NOT SW writable. A lock is released by writing to the associated RELEASE register (irrespective of the write value)."]
25pub type SUCCESS_R = crate::BitReader<bool>;
26impl R {
27 #[doc = "Bit 0 - User/privileged access control: '0': user mode. '1': privileged mode. This field is set with the user/privileged access control of the access that successfully acquired the lock."]
28 #[inline(always)]
29 pub fn p(&self) -> P_R {
30 P_R::new((self.bits & 1) != 0)
31 }
32 #[doc = "Bit 1 - Secure/non-secure access control: '0': secure. '1': non-secure. This field is set with the secure/non-secure access control of the access that successfully acquired the lock."]
33 #[inline(always)]
34 pub fn ns(&self) -> NS_R {
35 NS_R::new(((self.bits >> 1) & 1) != 0)
36 }
37 #[doc = "Bits 4:7 - This field specifies the protection context that successfully acquired the lock."]
38 #[inline(always)]
39 pub fn pc(&self) -> PC_R {
40 PC_R::new(((self.bits >> 4) & 0x0f) as u8)
41 }
42 #[doc = "Bits 8:11 - This field specifies the bus master identifier that successfully acquired the lock."]
43 #[inline(always)]
44 pub fn ms(&self) -> MS_R {
45 MS_R::new(((self.bits >> 8) & 0x0f) as u8)
46 }
47 #[doc = "Bit 31 - Specifies if the lock is successfully acquired or not (reading the ACQUIRE register can have affect on SUCCESS and LOCK_STATUS.ACQUIRED): '0': Not successfully acquired; i.e. the lock was already acquired by another read transaction and not released. The P, NS, PC and MS fields reflect the access attributes of the transaction that previously successfully acuired the lock; the fields are NOT affected by the current access. '1': Successfully acquired. The P, NS, PC and MS fields reflect the access attributes of the current access. Note that this field is NOT SW writable. A lock is released by writing to the associated RELEASE register (irrespective of the write value)."]
48 #[inline(always)]
49 pub fn success(&self) -> SUCCESS_R {
50 SUCCESS_R::new(((self.bits >> 31) & 1) != 0)
51 }
52}
53#[doc = "IPC acquire\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 [acquire](index.html) module"]
54pub struct ACQUIRE_SPEC;
55impl crate::RegisterSpec for ACQUIRE_SPEC {
56 type Ux = u32;
57}
58#[doc = "`read()` method returns [acquire::R](R) reader structure"]
59impl crate::Readable for ACQUIRE_SPEC {
60 type Reader = R;
61}
62#[doc = "`reset()` method sets ACQUIRE to value 0"]
63impl crate::Resettable for ACQUIRE_SPEC {
64 const RESET_VALUE: Self::Ux = 0;
65}