pub type R = crate::R<SMPRrs>;
pub type W = crate::W<SMPRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum SMP {
Cycles1_5 = 0,
Cycles3_5 = 1,
Cycles7_5 = 2,
Cycles12_5 = 3,
Cycles19_5 = 4,
Cycles39_5 = 5,
Cycles79_5 = 6,
Cycles160_5 = 7,
}
impl From<SMP> for u8 {
#[inline(always)]
fn from(variant: SMP) -> Self {
variant as _
}
}
impl crate::FieldSpec for SMP {
type Ux = u8;
}
impl crate::IsEnum for SMP {}
pub type SMP_R = crate::FieldReader<SMP>;
impl SMP_R {
#[inline(always)]
pub const fn variant(&self) -> SMP {
match self.bits {
0 => SMP::Cycles1_5,
1 => SMP::Cycles3_5,
2 => SMP::Cycles7_5,
3 => SMP::Cycles12_5,
4 => SMP::Cycles19_5,
5 => SMP::Cycles39_5,
6 => SMP::Cycles79_5,
7 => SMP::Cycles160_5,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_cycles1_5(&self) -> bool {
*self == SMP::Cycles1_5
}
#[inline(always)]
pub fn is_cycles3_5(&self) -> bool {
*self == SMP::Cycles3_5
}
#[inline(always)]
pub fn is_cycles7_5(&self) -> bool {
*self == SMP::Cycles7_5
}
#[inline(always)]
pub fn is_cycles12_5(&self) -> bool {
*self == SMP::Cycles12_5
}
#[inline(always)]
pub fn is_cycles19_5(&self) -> bool {
*self == SMP::Cycles19_5
}
#[inline(always)]
pub fn is_cycles39_5(&self) -> bool {
*self == SMP::Cycles39_5
}
#[inline(always)]
pub fn is_cycles79_5(&self) -> bool {
*self == SMP::Cycles79_5
}
#[inline(always)]
pub fn is_cycles160_5(&self) -> bool {
*self == SMP::Cycles160_5
}
}
pub type SMP_W<'a, REG> = crate::FieldWriter<'a, REG, 3, SMP, crate::Safe>;
impl<'a, REG> SMP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn cycles1_5(self) -> &'a mut crate::W<REG> {
self.variant(SMP::Cycles1_5)
}
#[inline(always)]
pub fn cycles3_5(self) -> &'a mut crate::W<REG> {
self.variant(SMP::Cycles3_5)
}
#[inline(always)]
pub fn cycles7_5(self) -> &'a mut crate::W<REG> {
self.variant(SMP::Cycles7_5)
}
#[inline(always)]
pub fn cycles12_5(self) -> &'a mut crate::W<REG> {
self.variant(SMP::Cycles12_5)
}
#[inline(always)]
pub fn cycles19_5(self) -> &'a mut crate::W<REG> {
self.variant(SMP::Cycles19_5)
}
#[inline(always)]
pub fn cycles39_5(self) -> &'a mut crate::W<REG> {
self.variant(SMP::Cycles39_5)
}
#[inline(always)]
pub fn cycles79_5(self) -> &'a mut crate::W<REG> {
self.variant(SMP::Cycles79_5)
}
#[inline(always)]
pub fn cycles160_5(self) -> &'a mut crate::W<REG> {
self.variant(SMP::Cycles160_5)
}
}
impl R {
#[inline(always)]
pub fn smp(&self) -> SMP_R {
SMP_R::new((self.bits & 7) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SMPR").field("smp", &self.smp()).finish()
}
}
impl W {
#[inline(always)]
pub fn smp(&mut self) -> SMP_W<SMPRrs> {
SMP_W::new(self, 0)
}
}
pub struct SMPRrs;
impl crate::RegisterSpec for SMPRrs {
type Ux = u32;
}
impl crate::Readable for SMPRrs {}
impl crate::Writable for SMPRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for SMPRrs {}