stm32wb_pac/fpu_cpacr/
cpacr.rs1#[doc = "Reader of register CPACR"]
2pub type R = crate::R<u32, super::CPACR>;
3#[doc = "Writer for register CPACR"]
4pub type W = crate::W<u32, super::CPACR>;
5#[doc = "Register CPACR `reset()`'s with value 0"]
6impl crate::ResetValue for super::CPACR {
7 type Type = u32;
8 #[inline(always)]
9 fn reset_value() -> Self::Type {
10 0
11 }
12}
13#[doc = "Reader of field `CP`"]
14pub type CP_R = crate::R<u8, u8>;
15#[doc = "Write proxy for field `CP`"]
16pub struct CP_W<'a> {
17 w: &'a mut W,
18}
19impl<'a> CP_W<'a> {
20 #[doc = r"Writes raw bits to the field"]
21 #[inline(always)]
22 pub unsafe fn bits(self, value: u8) -> &'a mut W {
23 self.w.bits = (self.w.bits & !(0x0f << 20)) | (((value as u32) & 0x0f) << 20);
24 self.w
25 }
26}
27impl R {
28 #[doc = "Bits 20:23 - CP"]
29 #[inline(always)]
30 pub fn cp(&self) -> CP_R {
31 CP_R::new(((self.bits >> 20) & 0x0f) as u8)
32 }
33}
34impl W {
35 #[doc = "Bits 20:23 - CP"]
36 #[inline(always)]
37 pub fn cp(&mut self) -> CP_W {
38 CP_W { w: self }
39 }
40}