esp32c3/rmt/
chcarrier_duty.rs1#[doc = "Register `CH%sCARRIER_DUTY` reader"]
2pub type R = crate::R<CHCARRIER_DUTY_SPEC>;
3#[doc = "Register `CH%sCARRIER_DUTY` writer"]
4pub type W = crate::W<CHCARRIER_DUTY_SPEC>;
5#[doc = "Field `CARRIER_LOW` reader - reg_carrier_low_ch0."]
6pub type CARRIER_LOW_R = crate::FieldReader<u16>;
7#[doc = "Field `CARRIER_LOW` writer - reg_carrier_low_ch0."]
8pub type CARRIER_LOW_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
9#[doc = "Field `CARRIER_HIGH` reader - reg_carrier_high_ch0."]
10pub type CARRIER_HIGH_R = crate::FieldReader<u16>;
11#[doc = "Field `CARRIER_HIGH` writer - reg_carrier_high_ch0."]
12pub type CARRIER_HIGH_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
13impl R {
14 #[doc = "Bits 0:15 - reg_carrier_low_ch0."]
15 #[inline(always)]
16 pub fn carrier_low(&self) -> CARRIER_LOW_R {
17 CARRIER_LOW_R::new((self.bits & 0xffff) as u16)
18 }
19 #[doc = "Bits 16:31 - reg_carrier_high_ch0."]
20 #[inline(always)]
21 pub fn carrier_high(&self) -> CARRIER_HIGH_R {
22 CARRIER_HIGH_R::new(((self.bits >> 16) & 0xffff) as u16)
23 }
24}
25#[cfg(feature = "impl-register-debug")]
26impl core::fmt::Debug for R {
27 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
28 f.debug_struct("CHCARRIER_DUTY")
29 .field("carrier_low", &self.carrier_low())
30 .field("carrier_high", &self.carrier_high())
31 .finish()
32 }
33}
34impl W {
35 #[doc = "Bits 0:15 - reg_carrier_low_ch0."]
36 #[inline(always)]
37 pub fn carrier_low(&mut self) -> CARRIER_LOW_W<CHCARRIER_DUTY_SPEC> {
38 CARRIER_LOW_W::new(self, 0)
39 }
40 #[doc = "Bits 16:31 - reg_carrier_high_ch0."]
41 #[inline(always)]
42 pub fn carrier_high(&mut self) -> CARRIER_HIGH_W<CHCARRIER_DUTY_SPEC> {
43 CARRIER_HIGH_W::new(self, 16)
44 }
45}
46#[doc = "RMT_CH%sCARRIER_DUTY_REG.\n\nYou can [`read`](crate::Reg::read) this register and get [`chcarrier_duty::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`chcarrier_duty::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
47pub struct CHCARRIER_DUTY_SPEC;
48impl crate::RegisterSpec for CHCARRIER_DUTY_SPEC {
49 type Ux = u32;
50}
51#[doc = "`read()` method returns [`chcarrier_duty::R`](R) reader structure"]
52impl crate::Readable for CHCARRIER_DUTY_SPEC {}
53#[doc = "`write(|w| ..)` method takes [`chcarrier_duty::W`](W) writer structure"]
54impl crate::Writable for CHCARRIER_DUTY_SPEC {
55 type Safety = crate::Unsafe;
56 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
57 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
58}
59#[doc = "`reset()` method sets CH%sCARRIER_DUTY to value 0x0040_0040"]
60impl crate::Resettable for CHCARRIER_DUTY_SPEC {
61 const RESET_VALUE: u32 = 0x0040_0040;
62}