1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
///Register `LFEPRESC0` reader
pub type R = crate::R<LFEPRESC0rs>;
///Register `LFEPRESC0` writer
pub type W = crate::W<LFEPRESC0rs>;
///Real-Time Counter and Calendar Prescaler
///
///Value on reset: 0
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum RTCC {
///0: LFECLKRTCC = LFECLK
Div1 = 0,
}
impl From<RTCC> for u8 {
#[inline(always)]
fn from(variant: RTCC) -> Self {
variant as _
}
}
impl crate::FieldSpec for RTCC {
type Ux = u8;
}
impl crate::IsEnum for RTCC {}
///Field `RTCC` reader - Real-Time Counter and Calendar Prescaler
pub type RtccR = crate::FieldReader<RTCC>;
impl RtccR {
///Get enumerated values variant
#[inline(always)]
pub const fn variant(&self) -> Option<RTCC> {
match self.bits {
0 => Some(RTCC::Div1),
_ => None,
}
}
///LFECLKRTCC = LFECLK
#[inline(always)]
pub fn is_div1(&self) -> bool {
*self == RTCC::Div1
}
}
impl R {
///Bits 0:3 - Real-Time Counter and Calendar Prescaler
#[inline(always)]
pub fn rtcc(&self) -> RtccR {
RtccR::new((self.bits & 0x0f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("LFEPRESC0")
.field("rtcc", &self.rtcc())
.finish()
}
}
impl W {}
///Low Frequency E Prescaler Register 0 (Async Reg)
///
///You can [`read`](crate::Reg::read) this register and get [`lfepresc0::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`lfepresc0::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
pub struct LFEPRESC0rs;
impl crate::RegisterSpec for LFEPRESC0rs {
type Ux = u32;
}
///`read()` method returns [`lfepresc0::R`](R) reader structure
impl crate::Readable for LFEPRESC0rs {}
///`write(|w| ..)` method takes [`lfepresc0::W`](W) writer structure
impl crate::Writable for LFEPRESC0rs {
type Safety = crate::Unsafe;
}
///`reset()` method sets LFEPRESC0 to value 0
impl crate::Resettable for LFEPRESC0rs {}