pub type R = crate::R<LFAPRESC0rs>;
pub type W = crate::W<LFAPRESC0rs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum LETIMER0 {
Div1 = 0,
Div2 = 1,
Div4 = 2,
Div8 = 3,
Div16 = 4,
Div32 = 5,
Div64 = 6,
Div128 = 7,
Div256 = 8,
Div512 = 9,
Div1024 = 10,
Div2048 = 11,
Div4096 = 12,
Div8192 = 13,
Div16384 = 14,
Div32768 = 15,
}
impl From<LETIMER0> for u8 {
#[inline(always)]
fn from(variant: LETIMER0) -> Self {
variant as _
}
}
impl crate::FieldSpec for LETIMER0 {
type Ux = u8;
}
impl crate::IsEnum for LETIMER0 {}
pub type Letimer0R = crate::FieldReader<LETIMER0>;
impl Letimer0R {
#[inline(always)]
pub const fn variant(&self) -> LETIMER0 {
match self.bits {
0 => LETIMER0::Div1,
1 => LETIMER0::Div2,
2 => LETIMER0::Div4,
3 => LETIMER0::Div8,
4 => LETIMER0::Div16,
5 => LETIMER0::Div32,
6 => LETIMER0::Div64,
7 => LETIMER0::Div128,
8 => LETIMER0::Div256,
9 => LETIMER0::Div512,
10 => LETIMER0::Div1024,
11 => LETIMER0::Div2048,
12 => LETIMER0::Div4096,
13 => LETIMER0::Div8192,
14 => LETIMER0::Div16384,
15 => LETIMER0::Div32768,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_div1(&self) -> bool {
*self == LETIMER0::Div1
}
#[inline(always)]
pub fn is_div2(&self) -> bool {
*self == LETIMER0::Div2
}
#[inline(always)]
pub fn is_div4(&self) -> bool {
*self == LETIMER0::Div4
}
#[inline(always)]
pub fn is_div8(&self) -> bool {
*self == LETIMER0::Div8
}
#[inline(always)]
pub fn is_div16(&self) -> bool {
*self == LETIMER0::Div16
}
#[inline(always)]
pub fn is_div32(&self) -> bool {
*self == LETIMER0::Div32
}
#[inline(always)]
pub fn is_div64(&self) -> bool {
*self == LETIMER0::Div64
}
#[inline(always)]
pub fn is_div128(&self) -> bool {
*self == LETIMER0::Div128
}
#[inline(always)]
pub fn is_div256(&self) -> bool {
*self == LETIMER0::Div256
}
#[inline(always)]
pub fn is_div512(&self) -> bool {
*self == LETIMER0::Div512
}
#[inline(always)]
pub fn is_div1024(&self) -> bool {
*self == LETIMER0::Div1024
}
#[inline(always)]
pub fn is_div2048(&self) -> bool {
*self == LETIMER0::Div2048
}
#[inline(always)]
pub fn is_div4096(&self) -> bool {
*self == LETIMER0::Div4096
}
#[inline(always)]
pub fn is_div8192(&self) -> bool {
*self == LETIMER0::Div8192
}
#[inline(always)]
pub fn is_div16384(&self) -> bool {
*self == LETIMER0::Div16384
}
#[inline(always)]
pub fn is_div32768(&self) -> bool {
*self == LETIMER0::Div32768
}
}
pub type Letimer0W<'a, REG> = crate::FieldWriter<'a, REG, 4, LETIMER0, crate::Safe>;
impl<'a, REG> Letimer0W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn div1(self) -> &'a mut crate::W<REG> {
self.variant(LETIMER0::Div1)
}
#[inline(always)]
pub fn div2(self) -> &'a mut crate::W<REG> {
self.variant(LETIMER0::Div2)
}
#[inline(always)]
pub fn div4(self) -> &'a mut crate::W<REG> {
self.variant(LETIMER0::Div4)
}
#[inline(always)]
pub fn div8(self) -> &'a mut crate::W<REG> {
self.variant(LETIMER0::Div8)
}
#[inline(always)]
pub fn div16(self) -> &'a mut crate::W<REG> {
self.variant(LETIMER0::Div16)
}
#[inline(always)]
pub fn div32(self) -> &'a mut crate::W<REG> {
self.variant(LETIMER0::Div32)
}
#[inline(always)]
pub fn div64(self) -> &'a mut crate::W<REG> {
self.variant(LETIMER0::Div64)
}
#[inline(always)]
pub fn div128(self) -> &'a mut crate::W<REG> {
self.variant(LETIMER0::Div128)
}
#[inline(always)]
pub fn div256(self) -> &'a mut crate::W<REG> {
self.variant(LETIMER0::Div256)
}
#[inline(always)]
pub fn div512(self) -> &'a mut crate::W<REG> {
self.variant(LETIMER0::Div512)
}
#[inline(always)]
pub fn div1024(self) -> &'a mut crate::W<REG> {
self.variant(LETIMER0::Div1024)
}
#[inline(always)]
pub fn div2048(self) -> &'a mut crate::W<REG> {
self.variant(LETIMER0::Div2048)
}
#[inline(always)]
pub fn div4096(self) -> &'a mut crate::W<REG> {
self.variant(LETIMER0::Div4096)
}
#[inline(always)]
pub fn div8192(self) -> &'a mut crate::W<REG> {
self.variant(LETIMER0::Div8192)
}
#[inline(always)]
pub fn div16384(self) -> &'a mut crate::W<REG> {
self.variant(LETIMER0::Div16384)
}
#[inline(always)]
pub fn div32768(self) -> &'a mut crate::W<REG> {
self.variant(LETIMER0::Div32768)
}
}
impl R {
#[inline(always)]
pub fn letimer0(&self) -> Letimer0R {
Letimer0R::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("LFAPRESC0")
.field("letimer0", &self.letimer0())
.finish()
}
}
impl W {
#[inline(always)]
pub fn letimer0(&mut self) -> Letimer0W<'_, LFAPRESC0rs> {
Letimer0W::new(self, 0)
}
}
pub struct LFAPRESC0rs;
impl crate::RegisterSpec for LFAPRESC0rs {
type Ux = u32;
}
impl crate::Readable for LFAPRESC0rs {}
impl crate::Writable for LFAPRESC0rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for LFAPRESC0rs {}