pub type R = crate::R<FCRrs>;
pub type W = crate::W<FCRrs>;
pub type IOSR_R = crate::FieldReader;
pub type IOSR_W<'a, REG> = crate::FieldWriter<'a, REG, 8, u8, crate::Safe>;
pub type FOSR_R = crate::FieldReader<u16>;
pub type FOSR_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16, crate::Safe>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum FORD {
FastSinc = 0,
Sinc1 = 1,
Sinc2 = 2,
Sinc3 = 3,
Sinc4 = 4,
Sinc5 = 5,
}
impl From<FORD> for u8 {
#[inline(always)]
fn from(variant: FORD) -> Self {
variant as _
}
}
impl crate::FieldSpec for FORD {
type Ux = u8;
}
impl crate::IsEnum for FORD {}
pub type FORD_R = crate::FieldReader<FORD>;
impl FORD_R {
#[inline(always)]
pub const fn variant(&self) -> Option<FORD> {
match self.bits {
0 => Some(FORD::FastSinc),
1 => Some(FORD::Sinc1),
2 => Some(FORD::Sinc2),
3 => Some(FORD::Sinc3),
4 => Some(FORD::Sinc4),
5 => Some(FORD::Sinc5),
_ => None,
}
}
#[inline(always)]
pub fn is_fast_sinc(&self) -> bool {
*self == FORD::FastSinc
}
#[inline(always)]
pub fn is_sinc1(&self) -> bool {
*self == FORD::Sinc1
}
#[inline(always)]
pub fn is_sinc2(&self) -> bool {
*self == FORD::Sinc2
}
#[inline(always)]
pub fn is_sinc3(&self) -> bool {
*self == FORD::Sinc3
}
#[inline(always)]
pub fn is_sinc4(&self) -> bool {
*self == FORD::Sinc4
}
#[inline(always)]
pub fn is_sinc5(&self) -> bool {
*self == FORD::Sinc5
}
}
pub type FORD_W<'a, REG> = crate::FieldWriter<'a, REG, 3, FORD>;
impl<'a, REG> FORD_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(FORD::FastSinc)
}
#[inline(always)]
pub fn sinc1(self) -> &'a mut crate::W<REG> {
self.variant(FORD::Sinc1)
}
#[inline(always)]
pub fn sinc2(self) -> &'a mut crate::W<REG> {
self.variant(FORD::Sinc2)
}
#[inline(always)]
pub fn sinc3(self) -> &'a mut crate::W<REG> {
self.variant(FORD::Sinc3)
}
#[inline(always)]
pub fn sinc4(self) -> &'a mut crate::W<REG> {
self.variant(FORD::Sinc4)
}
#[inline(always)]
pub fn sinc5(self) -> &'a mut crate::W<REG> {
self.variant(FORD::Sinc5)
}
}
impl R {
#[inline(always)]
pub fn iosr(&self) -> IOSR_R {
IOSR_R::new((self.bits & 0xff) as u8)
}
#[inline(always)]
pub fn fosr(&self) -> FOSR_R {
FOSR_R::new(((self.bits >> 16) & 0x03ff) as u16)
}
#[inline(always)]
pub fn ford(&self) -> FORD_R {
FORD_R::new(((self.bits >> 29) & 7) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("FCR")
.field("iosr", &self.iosr())
.field("fosr", &self.fosr())
.field("ford", &self.ford())
.finish()
}
}
impl W {
#[inline(always)]
pub fn iosr(&mut self) -> IOSR_W<FCRrs> {
IOSR_W::new(self, 0)
}
#[inline(always)]
pub fn fosr(&mut self) -> FOSR_W<FCRrs> {
FOSR_W::new(self, 16)
}
#[inline(always)]
pub fn ford(&mut self) -> FORD_W<FCRrs> {
FORD_W::new(self, 29)
}
}
pub struct FCRrs;
impl crate::RegisterSpec for FCRrs {
type Ux = u32;
}
impl crate::Readable for FCRrs {}
impl crate::Writable for FCRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for FCRrs {}