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