cyt3bb_a/m0/srss/
pwr_buck_ctl.rs

1#[doc = "Register `PWR_BUCK_CTL` reader"]
2pub struct R(crate::R<PWR_BUCK_CTL_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<PWR_BUCK_CTL_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<PWR_BUCK_CTL_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<PWR_BUCK_CTL_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `PWR_BUCK_CTL` writer"]
17pub struct W(crate::W<PWR_BUCK_CTL_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<PWR_BUCK_CTL_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<PWR_BUCK_CTL_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<PWR_BUCK_CTL_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `BUCK_OUT1_SEL` reader - Voltage output selection for vccbuck1 output. This register is only reset by XRES, HIBERNATE wakeup, or supply supervision reset. When increasing the voltage, it can take up to 200us for the output voltage to settle. When decreasing the voltage, the settling time depends on the load current. 0: 0.85V 1: 0.875V 2: 0.90V 3: 0.95V 4: 1.05V 5: 1.10V 6: 1.15V 7: 1.20V"]
38pub type BUCK_OUT1_SEL_R = crate::FieldReader<u8, u8>;
39#[doc = "Field `BUCK_OUT1_SEL` writer - Voltage output selection for vccbuck1 output. This register is only reset by XRES, HIBERNATE wakeup, or supply supervision reset. When increasing the voltage, it can take up to 200us for the output voltage to settle. When decreasing the voltage, the settling time depends on the load current. 0: 0.85V 1: 0.875V 2: 0.90V 3: 0.95V 4: 1.05V 5: 1.10V 6: 1.15V 7: 1.20V"]
40pub type BUCK_OUT1_SEL_W<'a, const O: u8> =
41    crate::FieldWriter<'a, u32, PWR_BUCK_CTL_SPEC, u8, u8, 3, O>;
42#[doc = "Field `BUCK_EN` reader - Master enable for buck converter. This register is only reset by XRES, HIBERNATE wakeup, or supply supervision reset."]
43pub type BUCK_EN_R = crate::BitReader<bool>;
44#[doc = "Field `BUCK_EN` writer - Master enable for buck converter. This register is only reset by XRES, HIBERNATE wakeup, or supply supervision reset."]
45pub type BUCK_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PWR_BUCK_CTL_SPEC, bool, O>;
46#[doc = "Field `BUCK_OUT1_EN` reader - Enable for vccbuck1 output. The value in this register is ignored unless PWR_BUCK_CTL.BUCK_EN==1. This register is only reset by XRES, HIBERNATE wakeup, or supply supervision reset. The regulator takes up to 600us to charge the external capacitor. If there is additional load current while charging, this will increase the startup time. The TRM specifies the required sequence when transitioning vccd from the LDO to SIMO Buck output #1."]
47pub type BUCK_OUT1_EN_R = crate::BitReader<bool>;
48#[doc = "Field `BUCK_OUT1_EN` writer - Enable for vccbuck1 output. The value in this register is ignored unless PWR_BUCK_CTL.BUCK_EN==1. This register is only reset by XRES, HIBERNATE wakeup, or supply supervision reset. The regulator takes up to 600us to charge the external capacitor. If there is additional load current while charging, this will increase the startup time. The TRM specifies the required sequence when transitioning vccd from the LDO to SIMO Buck output #1."]
49pub type BUCK_OUT1_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PWR_BUCK_CTL_SPEC, bool, O>;
50impl R {
51    #[doc = "Bits 0:2 - Voltage output selection for vccbuck1 output. This register is only reset by XRES, HIBERNATE wakeup, or supply supervision reset. When increasing the voltage, it can take up to 200us for the output voltage to settle. When decreasing the voltage, the settling time depends on the load current. 0: 0.85V 1: 0.875V 2: 0.90V 3: 0.95V 4: 1.05V 5: 1.10V 6: 1.15V 7: 1.20V"]
52    #[inline(always)]
53    pub fn buck_out1_sel(&self) -> BUCK_OUT1_SEL_R {
54        BUCK_OUT1_SEL_R::new((self.bits & 7) as u8)
55    }
56    #[doc = "Bit 30 - Master enable for buck converter. This register is only reset by XRES, HIBERNATE wakeup, or supply supervision reset."]
57    #[inline(always)]
58    pub fn buck_en(&self) -> BUCK_EN_R {
59        BUCK_EN_R::new(((self.bits >> 30) & 1) != 0)
60    }
61    #[doc = "Bit 31 - Enable for vccbuck1 output. The value in this register is ignored unless PWR_BUCK_CTL.BUCK_EN==1. This register is only reset by XRES, HIBERNATE wakeup, or supply supervision reset. The regulator takes up to 600us to charge the external capacitor. If there is additional load current while charging, this will increase the startup time. The TRM specifies the required sequence when transitioning vccd from the LDO to SIMO Buck output #1."]
62    #[inline(always)]
63    pub fn buck_out1_en(&self) -> BUCK_OUT1_EN_R {
64        BUCK_OUT1_EN_R::new(((self.bits >> 31) & 1) != 0)
65    }
66}
67impl W {
68    #[doc = "Bits 0:2 - Voltage output selection for vccbuck1 output. This register is only reset by XRES, HIBERNATE wakeup, or supply supervision reset. When increasing the voltage, it can take up to 200us for the output voltage to settle. When decreasing the voltage, the settling time depends on the load current. 0: 0.85V 1: 0.875V 2: 0.90V 3: 0.95V 4: 1.05V 5: 1.10V 6: 1.15V 7: 1.20V"]
69    #[inline(always)]
70    #[must_use]
71    pub fn buck_out1_sel(&mut self) -> BUCK_OUT1_SEL_W<0> {
72        BUCK_OUT1_SEL_W::new(self)
73    }
74    #[doc = "Bit 30 - Master enable for buck converter. This register is only reset by XRES, HIBERNATE wakeup, or supply supervision reset."]
75    #[inline(always)]
76    #[must_use]
77    pub fn buck_en(&mut self) -> BUCK_EN_W<30> {
78        BUCK_EN_W::new(self)
79    }
80    #[doc = "Bit 31 - Enable for vccbuck1 output. The value in this register is ignored unless PWR_BUCK_CTL.BUCK_EN==1. This register is only reset by XRES, HIBERNATE wakeup, or supply supervision reset. The regulator takes up to 600us to charge the external capacitor. If there is additional load current while charging, this will increase the startup time. The TRM specifies the required sequence when transitioning vccd from the LDO to SIMO Buck output #1."]
81    #[inline(always)]
82    #[must_use]
83    pub fn buck_out1_en(&mut self) -> BUCK_OUT1_EN_W<31> {
84        BUCK_OUT1_EN_W::new(self)
85    }
86    #[doc = "Writes raw bits to the register."]
87    #[inline(always)]
88    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
89        self.0.bits(bits);
90        self
91    }
92}
93#[doc = "Buck Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pwr_buck_ctl](index.html) module"]
94pub struct PWR_BUCK_CTL_SPEC;
95impl crate::RegisterSpec for PWR_BUCK_CTL_SPEC {
96    type Ux = u32;
97}
98#[doc = "`read()` method returns [pwr_buck_ctl::R](R) reader structure"]
99impl crate::Readable for PWR_BUCK_CTL_SPEC {
100    type Reader = R;
101}
102#[doc = "`write(|w| ..)` method takes [pwr_buck_ctl::W](W) writer structure"]
103impl crate::Writable for PWR_BUCK_CTL_SPEC {
104    type Writer = W;
105    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
106    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
107}
108#[doc = "`reset()` method sets PWR_BUCK_CTL to value 0x05"]
109impl crate::Resettable for PWR_BUCK_CTL_SPEC {
110    const RESET_VALUE: Self::Ux = 0x05;
111}