1#[doc = "Register `ECC` reader"]
2pub struct R(crate::R<ECC_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<ECC_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<ECC_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<ECC_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Field `SEGCODE` reader - SEGCODE field"]
17pub type SEGCODE_R = crate::FieldReader<u8, u8>;
18#[doc = "Field `DIR` reader - DIR field"]
19pub type DIR_R = crate::BitReader<bool>;
20#[doc = "Field `ERRCODE` reader - ERRCODE field"]
21pub type ERRCODE_R = crate::FieldReader<u8, u8>;
22impl R {
23 #[doc = "Bits 0:4 - SEGCODE field"]
24 #[inline(always)]
25 pub fn segcode(&self) -> SEGCODE_R {
26 SEGCODE_R::new((self.bits & 0x1f) as u8)
27 }
28 #[doc = "Bit 5 - DIR field"]
29 #[inline(always)]
30 pub fn dir(&self) -> DIR_R {
31 DIR_R::new(((self.bits >> 5) & 1) != 0)
32 }
33 #[doc = "Bits 6:7 - ERRCODE field"]
34 #[inline(always)]
35 pub fn errcode(&self) -> ERRCODE_R {
36 ERRCODE_R::new(((self.bits >> 6) & 3) as u8)
37 }
38}
39#[doc = "ECC register\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 [ecc](index.html) module"]
40pub struct ECC_SPEC;
41impl crate::RegisterSpec for ECC_SPEC {
42 type Ux = u32;
43}
44#[doc = "`read()` method returns [ecc::R](R) reader structure"]
45impl crate::Readable for ECC_SPEC {
46 type Reader = R;
47}
48#[doc = "`reset()` method sets ECC to value 0"]
49impl crate::Resettable for ECC_SPEC {
50 #[inline(always)]
51 fn reset_value() -> Self::Ux {
52 0
53 }
54}