1#[doc = "Register `CH%sSTATUS` reader"]
2pub type R = crate::R<CHSTATUS_SPEC>;
3#[doc = "Field `MEM_WADDR_EX` reader - This register records the memory address offset when receiver of CHANNEL%s is using the RAM."]
4pub type MEM_WADDR_EX_R = crate::FieldReader<u16>;
5#[doc = "Field `MEM_RADDR_EX` reader - This register records the memory address offset when transmitter of CHANNEL%s is using the RAM."]
6pub type MEM_RADDR_EX_R = crate::FieldReader<u16>;
7#[doc = "Field `STATE` reader - This register records the FSM status of CHANNEL%s."]
8pub type STATE_R = crate::FieldReader;
9#[doc = "Field `MEM_OWNER_ERR` reader - This status bit will be set when the ownership of memory block is wrong."]
10pub type MEM_OWNER_ERR_R = crate::BitReader;
11#[doc = "Field `MEM_FULL` reader - This status bit will be set if the receiver receives more data than the memory size."]
12pub type MEM_FULL_R = crate::BitReader;
13#[doc = "Field `MEM_EMPTY` reader - This status bit will be set when the data to be set is more than memory size and the wraparound mode is disabled."]
14pub type MEM_EMPTY_R = crate::BitReader;
15#[doc = "Field `APB_MEM_WR_ERR` reader - This status bit will be set if the offset address out of memory size when writes via APB bus."]
16pub type APB_MEM_WR_ERR_R = crate::BitReader;
17#[doc = "Field `APB_MEM_RD_ERR` reader - This status bit will be set if the offset address out of memory size when reads via APB bus."]
18pub type APB_MEM_RD_ERR_R = crate::BitReader;
19impl R {
20 #[doc = "Bits 0:8 - This register records the memory address offset when receiver of CHANNEL%s is using the RAM."]
21 #[inline(always)]
22 pub fn mem_waddr_ex(&self) -> MEM_WADDR_EX_R {
23 MEM_WADDR_EX_R::new((self.bits & 0x01ff) as u16)
24 }
25 #[doc = "Bits 10:18 - This register records the memory address offset when transmitter of CHANNEL%s is using the RAM."]
26 #[inline(always)]
27 pub fn mem_raddr_ex(&self) -> MEM_RADDR_EX_R {
28 MEM_RADDR_EX_R::new(((self.bits >> 10) & 0x01ff) as u16)
29 }
30 #[doc = "Bits 20:22 - This register records the FSM status of CHANNEL%s."]
31 #[inline(always)]
32 pub fn state(&self) -> STATE_R {
33 STATE_R::new(((self.bits >> 20) & 7) as u8)
34 }
35 #[doc = "Bit 23 - This status bit will be set when the ownership of memory block is wrong."]
36 #[inline(always)]
37 pub fn mem_owner_err(&self) -> MEM_OWNER_ERR_R {
38 MEM_OWNER_ERR_R::new(((self.bits >> 23) & 1) != 0)
39 }
40 #[doc = "Bit 24 - This status bit will be set if the receiver receives more data than the memory size."]
41 #[inline(always)]
42 pub fn mem_full(&self) -> MEM_FULL_R {
43 MEM_FULL_R::new(((self.bits >> 24) & 1) != 0)
44 }
45 #[doc = "Bit 25 - This status bit will be set when the data to be set is more than memory size and the wraparound mode is disabled."]
46 #[inline(always)]
47 pub fn mem_empty(&self) -> MEM_EMPTY_R {
48 MEM_EMPTY_R::new(((self.bits >> 25) & 1) != 0)
49 }
50 #[doc = "Bit 26 - This status bit will be set if the offset address out of memory size when writes via APB bus."]
51 #[inline(always)]
52 pub fn apb_mem_wr_err(&self) -> APB_MEM_WR_ERR_R {
53 APB_MEM_WR_ERR_R::new(((self.bits >> 26) & 1) != 0)
54 }
55 #[doc = "Bit 27 - This status bit will be set if the offset address out of memory size when reads via APB bus."]
56 #[inline(always)]
57 pub fn apb_mem_rd_err(&self) -> APB_MEM_RD_ERR_R {
58 APB_MEM_RD_ERR_R::new(((self.bits >> 27) & 1) != 0)
59 }
60}
61#[cfg(feature = "impl-register-debug")]
62impl core::fmt::Debug for R {
63 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
64 f.debug_struct("CHSTATUS")
65 .field("mem_waddr_ex", &self.mem_waddr_ex())
66 .field("mem_raddr_ex", &self.mem_raddr_ex())
67 .field("state", &self.state())
68 .field("mem_owner_err", &self.mem_owner_err())
69 .field("mem_full", &self.mem_full())
70 .field("mem_empty", &self.mem_empty())
71 .field("apb_mem_wr_err", &self.apb_mem_wr_err())
72 .field("apb_mem_rd_err", &self.apb_mem_rd_err())
73 .finish()
74 }
75}
76#[doc = "Channel %s status register\n\nYou can [`read`](crate::Reg::read) this register and get [`chstatus::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
77pub struct CHSTATUS_SPEC;
78impl crate::RegisterSpec for CHSTATUS_SPEC {
79 type Ux = u32;
80}
81#[doc = "`read()` method returns [`chstatus::R`](R) reader structure"]
82impl crate::Readable for CHSTATUS_SPEC {}
83#[doc = "`reset()` method sets CH%sSTATUS to value 0"]
84impl crate::Resettable for CHSTATUS_SPEC {}