esp32c6/systimer/
target_conf.rs

1#[doc = "Register `TARGET%s_CONF` reader"]
2pub type R = crate::R<TARGET_CONF_SPEC>;
3#[doc = "Register `TARGET%s_CONF` writer"]
4pub type W = crate::W<TARGET_CONF_SPEC>;
5#[doc = "Field `PERIOD` reader - target0 period"]
6pub type PERIOD_R = crate::FieldReader<u32>;
7#[doc = "Field `PERIOD` writer - target0 period"]
8pub type PERIOD_W<'a, REG> = crate::FieldWriter<'a, REG, 26, u32>;
9#[doc = "Field `PERIOD_MODE` reader - Set target0 to period mode"]
10pub type PERIOD_MODE_R = crate::BitReader;
11#[doc = "Field `PERIOD_MODE` writer - Set target0 to period mode"]
12pub type PERIOD_MODE_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `TIMER_UNIT_SEL` reader - select which unit to compare"]
14pub type TIMER_UNIT_SEL_R = crate::BitReader;
15#[doc = "Field `TIMER_UNIT_SEL` writer - select which unit to compare"]
16pub type TIMER_UNIT_SEL_W<'a, REG> = crate::BitWriter<'a, REG>;
17impl R {
18    #[doc = "Bits 0:25 - target0 period"]
19    #[inline(always)]
20    pub fn period(&self) -> PERIOD_R {
21        PERIOD_R::new(self.bits & 0x03ff_ffff)
22    }
23    #[doc = "Bit 30 - Set target0 to period mode"]
24    #[inline(always)]
25    pub fn period_mode(&self) -> PERIOD_MODE_R {
26        PERIOD_MODE_R::new(((self.bits >> 30) & 1) != 0)
27    }
28    #[doc = "Bit 31 - select which unit to compare"]
29    #[inline(always)]
30    pub fn timer_unit_sel(&self) -> TIMER_UNIT_SEL_R {
31        TIMER_UNIT_SEL_R::new(((self.bits >> 31) & 1) != 0)
32    }
33}
34#[cfg(feature = "impl-register-debug")]
35impl core::fmt::Debug for R {
36    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
37        f.debug_struct("TARGET_CONF")
38            .field("period", &self.period())
39            .field("period_mode", &self.period_mode())
40            .field("timer_unit_sel", &self.timer_unit_sel())
41            .finish()
42    }
43}
44impl W {
45    #[doc = "Bits 0:25 - target0 period"]
46    #[inline(always)]
47    pub fn period(&mut self) -> PERIOD_W<TARGET_CONF_SPEC> {
48        PERIOD_W::new(self, 0)
49    }
50    #[doc = "Bit 30 - Set target0 to period mode"]
51    #[inline(always)]
52    pub fn period_mode(&mut self) -> PERIOD_MODE_W<TARGET_CONF_SPEC> {
53        PERIOD_MODE_W::new(self, 30)
54    }
55    #[doc = "Bit 31 - select which unit to compare"]
56    #[inline(always)]
57    pub fn timer_unit_sel(&mut self) -> TIMER_UNIT_SEL_W<TARGET_CONF_SPEC> {
58        TIMER_UNIT_SEL_W::new(self, 31)
59    }
60}
61#[doc = "system timer comp%s target mode register\n\nYou can [`read`](crate::Reg::read) this register and get [`target_conf::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`target_conf::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
62pub struct TARGET_CONF_SPEC;
63impl crate::RegisterSpec for TARGET_CONF_SPEC {
64    type Ux = u32;
65}
66#[doc = "`read()` method returns [`target_conf::R`](R) reader structure"]
67impl crate::Readable for TARGET_CONF_SPEC {}
68#[doc = "`write(|w| ..)` method takes [`target_conf::W`](W) writer structure"]
69impl crate::Writable for TARGET_CONF_SPEC {
70    type Safety = crate::Unsafe;
71    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
72    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
73}
74#[doc = "`reset()` method sets TARGET%s_CONF to value 0"]
75impl crate::Resettable for TARGET_CONF_SPEC {
76    const RESET_VALUE: u32 = 0;
77}