lpc55_pac/powerquad/
length.rs

1#[doc = "Register `LENGTH` reader"]
2pub struct R(crate::R<LENGTH_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<LENGTH_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<LENGTH_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<LENGTH_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `LENGTH` writer"]
17pub struct W(crate::W<LENGTH_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<LENGTH_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<LENGTH_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<LENGTH_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `inst_length` reader - Length register. When FIR : fir_xlength = inst_length\\[15:0\\]
38, fir_tlength = inst_len\\[31:16\\]. When MTX : rows_a = inst_length\\[4:0\\]
39, cols_a = inst_length\\[12:8\\]
40, cols_b = inst_length\\[20:16\\]"]
41pub struct INST_LENGTH_R(crate::FieldReader<u32, u32>);
42impl INST_LENGTH_R {
43    #[inline(always)]
44    pub(crate) fn new(bits: u32) -> Self {
45        INST_LENGTH_R(crate::FieldReader::new(bits))
46    }
47}
48impl core::ops::Deref for INST_LENGTH_R {
49    type Target = crate::FieldReader<u32, u32>;
50    #[inline(always)]
51    fn deref(&self) -> &Self::Target {
52        &self.0
53    }
54}
55#[doc = "Field `inst_length` writer - Length register. When FIR : fir_xlength = inst_length\\[15:0\\]
56, fir_tlength = inst_len\\[31:16\\]. When MTX : rows_a = inst_length\\[4:0\\]
57, cols_a = inst_length\\[12:8\\]
58, cols_b = inst_length\\[20:16\\]"]
59pub struct INST_LENGTH_W<'a> {
60    w: &'a mut W,
61}
62impl<'a> INST_LENGTH_W<'a> {
63    #[doc = r"Writes raw bits to the field"]
64    #[inline(always)]
65    pub unsafe fn bits(self, value: u32) -> &'a mut W {
66        self.w.bits = value as u32;
67        self.w
68    }
69}
70impl R {
71    #[doc = "Bits 0:31 - Length register. When FIR : fir_xlength = inst_length\\[15:0\\]
72, fir_tlength = inst_len\\[31:16\\]. When MTX : rows_a = inst_length\\[4:0\\]
73, cols_a = inst_length\\[12:8\\]
74, cols_b = inst_length\\[20:16\\]"]
75    #[inline(always)]
76    pub fn inst_length(&self) -> INST_LENGTH_R {
77        INST_LENGTH_R::new(self.bits as u32)
78    }
79}
80impl W {
81    #[doc = "Bits 0:31 - Length register. When FIR : fir_xlength = inst_length\\[15:0\\]
82, fir_tlength = inst_len\\[31:16\\]. When MTX : rows_a = inst_length\\[4:0\\]
83, cols_a = inst_length\\[12:8\\]
84, cols_b = inst_length\\[20:16\\]"]
85    #[inline(always)]
86    pub fn inst_length(&mut self) -> INST_LENGTH_W {
87        INST_LENGTH_W { w: self }
88    }
89    #[doc = "Writes raw bits to the register."]
90    #[inline(always)]
91    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
92        self.0.bits(bits);
93        self
94    }
95}
96#[doc = "Length register\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 [length](index.html) module"]
97pub struct LENGTH_SPEC;
98impl crate::RegisterSpec for LENGTH_SPEC {
99    type Ux = u32;
100}
101#[doc = "`read()` method returns [length::R](R) reader structure"]
102impl crate::Readable for LENGTH_SPEC {
103    type Reader = R;
104}
105#[doc = "`write(|w| ..)` method takes [length::W](W) writer structure"]
106impl crate::Writable for LENGTH_SPEC {
107    type Writer = W;
108}
109#[doc = "`reset()` method sets LENGTH to value 0"]
110impl crate::Resettable for LENGTH_SPEC {
111    #[inline(always)]
112    fn reset_value() -> Self::Ux {
113        0
114    }
115}