pub type R = crate::R<AWSCDRrs>;
pub type W = crate::W<AWSCDRrs>;
pub type SCDT_R = crate::FieldReader;
pub type SCDT_W<'a, REG> = crate::FieldWriter<'a, REG, 8, u8, crate::Safe>;
pub type BKSCD_R = crate::FieldReader;
pub type BKSCD_W<'a, REG> = crate::FieldWriter<'a, REG, 4, u8, crate::Safe>;
pub type AWFOSR_R = crate::FieldReader;
pub type AWFOSR_W<'a, REG> = crate::FieldWriter<'a, REG, 5, u8, crate::Safe>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum AWFORD {
FastSinc = 0,
Sinc1 = 1,
Sinc2 = 2,
Sinc3 = 3,
}
impl From<AWFORD> for u8 {
#[inline(always)]
fn from(variant: AWFORD) -> Self {
variant as _
}
}
impl crate::FieldSpec for AWFORD {
type Ux = u8;
}
impl crate::IsEnum for AWFORD {}
pub type AWFORD_R = crate::FieldReader<AWFORD>;
impl AWFORD_R {
#[inline(always)]
pub const fn variant(&self) -> AWFORD {
match self.bits {
0 => AWFORD::FastSinc,
1 => AWFORD::Sinc1,
2 => AWFORD::Sinc2,
3 => AWFORD::Sinc3,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_fast_sinc(&self) -> bool {
*self == AWFORD::FastSinc
}
#[inline(always)]
pub fn is_sinc1(&self) -> bool {
*self == AWFORD::Sinc1
}
#[inline(always)]
pub fn is_sinc2(&self) -> bool {
*self == AWFORD::Sinc2
}
#[inline(always)]
pub fn is_sinc3(&self) -> bool {
*self == AWFORD::Sinc3
}
}
pub type AWFORD_W<'a, REG> = crate::FieldWriter<'a, REG, 2, AWFORD, crate::Safe>;
impl<'a, REG> AWFORD_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn fast_sinc(self) -> &'a mut crate::W<REG> {
self.variant(AWFORD::FastSinc)
}
#[inline(always)]
pub fn sinc1(self) -> &'a mut crate::W<REG> {
self.variant(AWFORD::Sinc1)
}
#[inline(always)]
pub fn sinc2(self) -> &'a mut crate::W<REG> {
self.variant(AWFORD::Sinc2)
}
#[inline(always)]
pub fn sinc3(self) -> &'a mut crate::W<REG> {
self.variant(AWFORD::Sinc3)
}
}
impl R {
#[inline(always)]
pub fn scdt(&self) -> SCDT_R {
SCDT_R::new((self.bits & 0xff) as u8)
}
#[inline(always)]
pub fn bkscd(&self) -> BKSCD_R {
BKSCD_R::new(((self.bits >> 12) & 0x0f) as u8)
}
#[inline(always)]
pub fn awfosr(&self) -> AWFOSR_R {
AWFOSR_R::new(((self.bits >> 16) & 0x1f) as u8)
}
#[inline(always)]
pub fn awford(&self) -> AWFORD_R {
AWFORD_R::new(((self.bits >> 22) & 3) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("AWSCDR")
.field("scdt", &self.scdt())
.field("bkscd", &self.bkscd())
.field("awfosr", &self.awfosr())
.field("awford", &self.awford())
.finish()
}
}
impl W {
#[inline(always)]
pub fn scdt(&mut self) -> SCDT_W<AWSCDRrs> {
SCDT_W::new(self, 0)
}
#[inline(always)]
pub fn bkscd(&mut self) -> BKSCD_W<AWSCDRrs> {
BKSCD_W::new(self, 12)
}
#[inline(always)]
pub fn awfosr(&mut self) -> AWFOSR_W<AWSCDRrs> {
AWFOSR_W::new(self, 16)
}
#[inline(always)]
pub fn awford(&mut self) -> AWFORD_W<AWSCDRrs> {
AWFORD_W::new(self, 22)
}
}
pub struct AWSCDRrs;
impl crate::RegisterSpec for AWSCDRrs {
type Ux = u32;
}
impl crate::Readable for AWSCDRrs {}
impl crate::Writable for AWSCDRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for AWSCDRrs {}