esp32c6/ieee802154/
dtm_config.rs1#[doc = "Register `DTM_CONFIG` reader"]
2pub type R = crate::R<DTM_CONFIG_SPEC>;
3#[doc = "Register `DTM_CONFIG` writer"]
4pub type W = crate::W<DTM_CONFIG_SPEC>;
5#[doc = "Field `DTMCH_TX_LENGTH` reader - "]
6pub type DTMCH_TX_LENGTH_R = crate::FieldReader;
7#[doc = "Field `DTMCH_TX_LENGTH` writer - "]
8pub type DTMCH_TX_LENGTH_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `DTM_TX_PLD_TYPE` reader - "]
10pub type DTM_TX_PLD_TYPE_R = crate::FieldReader;
11#[doc = "Field `DTM_TX_PLD_TYPE` writer - "]
12pub type DTM_TX_PLD_TYPE_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
13#[doc = "Field `DTM_HOP_FREQ` reader - "]
14pub type DTM_HOP_FREQ_R = crate::FieldReader;
15#[doc = "Field `DTM_HOP_FREQ` writer - "]
16pub type DTM_HOP_FREQ_W<'a, REG> = crate::FieldWriter<'a, REG, 6>;
17#[doc = "Field `DTM_CONTRX_EN` reader - "]
18pub type DTM_CONTRX_EN_R = crate::BitReader;
19#[doc = "Field `DTM_CONTRX_EN` writer - "]
20pub type DTM_CONTRX_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `DTM_ON` reader - "]
22pub type DTM_ON_R = crate::BitReader;
23#[doc = "Field `DTM_ON` writer - "]
24pub type DTM_ON_W<'a, REG> = crate::BitWriter<'a, REG>;
25impl R {
26 #[doc = "Bits 0:7"]
27 #[inline(always)]
28 pub fn dtmch_tx_length(&self) -> DTMCH_TX_LENGTH_R {
29 DTMCH_TX_LENGTH_R::new((self.bits & 0xff) as u8)
30 }
31 #[doc = "Bits 8:11"]
32 #[inline(always)]
33 pub fn dtm_tx_pld_type(&self) -> DTM_TX_PLD_TYPE_R {
34 DTM_TX_PLD_TYPE_R::new(((self.bits >> 8) & 0x0f) as u8)
35 }
36 #[doc = "Bits 16:21"]
37 #[inline(always)]
38 pub fn dtm_hop_freq(&self) -> DTM_HOP_FREQ_R {
39 DTM_HOP_FREQ_R::new(((self.bits >> 16) & 0x3f) as u8)
40 }
41 #[doc = "Bit 24"]
42 #[inline(always)]
43 pub fn dtm_contrx_en(&self) -> DTM_CONTRX_EN_R {
44 DTM_CONTRX_EN_R::new(((self.bits >> 24) & 1) != 0)
45 }
46 #[doc = "Bit 25"]
47 #[inline(always)]
48 pub fn dtm_on(&self) -> DTM_ON_R {
49 DTM_ON_R::new(((self.bits >> 25) & 1) != 0)
50 }
51}
52#[cfg(feature = "impl-register-debug")]
53impl core::fmt::Debug for R {
54 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
55 f.debug_struct("DTM_CONFIG")
56 .field("dtmch_tx_length", &self.dtmch_tx_length())
57 .field("dtm_tx_pld_type", &self.dtm_tx_pld_type())
58 .field("dtm_hop_freq", &self.dtm_hop_freq())
59 .field("dtm_contrx_en", &self.dtm_contrx_en())
60 .field("dtm_on", &self.dtm_on())
61 .finish()
62 }
63}
64impl W {
65 #[doc = "Bits 0:7"]
66 #[inline(always)]
67 pub fn dtmch_tx_length(&mut self) -> DTMCH_TX_LENGTH_W<DTM_CONFIG_SPEC> {
68 DTMCH_TX_LENGTH_W::new(self, 0)
69 }
70 #[doc = "Bits 8:11"]
71 #[inline(always)]
72 pub fn dtm_tx_pld_type(&mut self) -> DTM_TX_PLD_TYPE_W<DTM_CONFIG_SPEC> {
73 DTM_TX_PLD_TYPE_W::new(self, 8)
74 }
75 #[doc = "Bits 16:21"]
76 #[inline(always)]
77 pub fn dtm_hop_freq(&mut self) -> DTM_HOP_FREQ_W<DTM_CONFIG_SPEC> {
78 DTM_HOP_FREQ_W::new(self, 16)
79 }
80 #[doc = "Bit 24"]
81 #[inline(always)]
82 pub fn dtm_contrx_en(&mut self) -> DTM_CONTRX_EN_W<DTM_CONFIG_SPEC> {
83 DTM_CONTRX_EN_W::new(self, 24)
84 }
85 #[doc = "Bit 25"]
86 #[inline(always)]
87 pub fn dtm_on(&mut self) -> DTM_ON_W<DTM_CONFIG_SPEC> {
88 DTM_ON_W::new(self, 25)
89 }
90}
91#[doc = "\n\nYou can [`read`](crate::Reg::read) this register and get [`dtm_config::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`dtm_config::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
92pub struct DTM_CONFIG_SPEC;
93impl crate::RegisterSpec for DTM_CONFIG_SPEC {
94 type Ux = u32;
95}
96#[doc = "`read()` method returns [`dtm_config::R`](R) reader structure"]
97impl crate::Readable for DTM_CONFIG_SPEC {}
98#[doc = "`write(|w| ..)` method takes [`dtm_config::W`](W) writer structure"]
99impl crate::Writable for DTM_CONFIG_SPEC {
100 type Safety = crate::Unsafe;
101 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
102 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
103}
104#[doc = "`reset()` method sets DTM_CONFIG to value 0"]
105impl crate::Resettable for DTM_CONFIG_SPEC {
106 const RESET_VALUE: u32 = 0;
107}