pub type R = crate::R<LFBPRESC0rs>;
pub type W = crate::W<LFBPRESC0rs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum LEUART0 {
Div1 = 0,
Div2 = 1,
Div4 = 2,
Div8 = 3,
}
impl From<LEUART0> for u8 {
#[inline(always)]
fn from(variant: LEUART0) -> Self {
variant as _
}
}
impl crate::FieldSpec for LEUART0 {
type Ux = u8;
}
impl crate::IsEnum for LEUART0 {}
pub type Leuart0R = crate::FieldReader<LEUART0>;
impl Leuart0R {
#[inline(always)]
pub const fn variant(&self) -> LEUART0 {
match self.bits {
0 => LEUART0::Div1,
1 => LEUART0::Div2,
2 => LEUART0::Div4,
3 => LEUART0::Div8,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_div1(&self) -> bool {
*self == LEUART0::Div1
}
#[inline(always)]
pub fn is_div2(&self) -> bool {
*self == LEUART0::Div2
}
#[inline(always)]
pub fn is_div4(&self) -> bool {
*self == LEUART0::Div4
}
#[inline(always)]
pub fn is_div8(&self) -> bool {
*self == LEUART0::Div8
}
}
pub type Leuart0W<'a, REG> = crate::FieldWriter<'a, REG, 2, LEUART0, crate::Safe>;
impl<'a, REG> Leuart0W<'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(LEUART0::Div1)
}
#[inline(always)]
pub fn div2(self) -> &'a mut crate::W<REG> {
self.variant(LEUART0::Div2)
}
#[inline(always)]
pub fn div4(self) -> &'a mut crate::W<REG> {
self.variant(LEUART0::Div4)
}
#[inline(always)]
pub fn div8(self) -> &'a mut crate::W<REG> {
self.variant(LEUART0::Div8)
}
}
impl R {
#[inline(always)]
pub fn leuart0(&self) -> Leuart0R {
Leuart0R::new((self.bits & 3) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("LFBPRESC0")
.field("leuart0", &self.leuart0())
.finish()
}
}
impl W {
#[inline(always)]
pub fn leuart0(&mut self) -> Leuart0W<'_, LFBPRESC0rs> {
Leuart0W::new(self, 0)
}
}
pub struct LFBPRESC0rs;
impl crate::RegisterSpec for LFBPRESC0rs {
type Ux = u32;
}
impl crate::Readable for LFBPRESC0rs {}
impl crate::Writable for LFBPRESC0rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for LFBPRESC0rs {}