pub type R = crate::R<FCRrs>;
pub type W = crate::W<FCRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum FTH {
Quarter = 0,
Half = 1,
ThreeQuarters = 2,
Full = 3,
}
impl From<FTH> for u8 {
#[inline(always)]
fn from(variant: FTH) -> Self {
variant as _
}
}
impl crate::FieldSpec for FTH {
type Ux = u8;
}
impl crate::IsEnum for FTH {}
pub type FTH_R = crate::FieldReader<FTH>;
impl FTH_R {
#[inline(always)]
pub const fn variant(&self) -> FTH {
match self.bits {
0 => FTH::Quarter,
1 => FTH::Half,
2 => FTH::ThreeQuarters,
3 => FTH::Full,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_quarter(&self) -> bool {
*self == FTH::Quarter
}
#[inline(always)]
pub fn is_half(&self) -> bool {
*self == FTH::Half
}
#[inline(always)]
pub fn is_three_quarters(&self) -> bool {
*self == FTH::ThreeQuarters
}
#[inline(always)]
pub fn is_full(&self) -> bool {
*self == FTH::Full
}
}
pub type FTH_W<'a, REG> = crate::FieldWriter<'a, REG, 2, FTH, crate::Safe>;
impl<'a, REG> FTH_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn quarter(self) -> &'a mut crate::W<REG> {
self.variant(FTH::Quarter)
}
#[inline(always)]
pub fn half(self) -> &'a mut crate::W<REG> {
self.variant(FTH::Half)
}
#[inline(always)]
pub fn three_quarters(self) -> &'a mut crate::W<REG> {
self.variant(FTH::ThreeQuarters)
}
#[inline(always)]
pub fn full(self) -> &'a mut crate::W<REG> {
self.variant(FTH::Full)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DMDIS {
Enabled = 0,
Disabled = 1,
}
impl From<DMDIS> for bool {
#[inline(always)]
fn from(variant: DMDIS) -> Self {
variant as u8 != 0
}
}
pub type DMDIS_R = crate::BitReader<DMDIS>;
impl DMDIS_R {
#[inline(always)]
pub const fn variant(&self) -> DMDIS {
match self.bits {
false => DMDIS::Enabled,
true => DMDIS::Disabled,
}
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == DMDIS::Enabled
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == DMDIS::Disabled
}
}
pub type DMDIS_W<'a, REG> = crate::BitWriter<'a, REG, DMDIS>;
impl<'a, REG> DMDIS_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(DMDIS::Enabled)
}
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(DMDIS::Disabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum FS {
Quarter1 = 0,
Quarter2 = 1,
Quarter3 = 2,
Quarter4 = 3,
Empty = 4,
Full = 5,
}
impl From<FS> for u8 {
#[inline(always)]
fn from(variant: FS) -> Self {
variant as _
}
}
impl crate::FieldSpec for FS {
type Ux = u8;
}
impl crate::IsEnum for FS {}
pub type FS_R = crate::FieldReader<FS>;
impl FS_R {
#[inline(always)]
pub const fn variant(&self) -> Option<FS> {
match self.bits {
0 => Some(FS::Quarter1),
1 => Some(FS::Quarter2),
2 => Some(FS::Quarter3),
3 => Some(FS::Quarter4),
4 => Some(FS::Empty),
5 => Some(FS::Full),
_ => None,
}
}
#[inline(always)]
pub fn is_quarter1(&self) -> bool {
*self == FS::Quarter1
}
#[inline(always)]
pub fn is_quarter2(&self) -> bool {
*self == FS::Quarter2
}
#[inline(always)]
pub fn is_quarter3(&self) -> bool {
*self == FS::Quarter3
}
#[inline(always)]
pub fn is_quarter4(&self) -> bool {
*self == FS::Quarter4
}
#[inline(always)]
pub fn is_empty(&self) -> bool {
*self == FS::Empty
}
#[inline(always)]
pub fn is_full(&self) -> bool {
*self == FS::Full
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FEIE {
Disabled = 0,
Enabled = 1,
}
impl From<FEIE> for bool {
#[inline(always)]
fn from(variant: FEIE) -> Self {
variant as u8 != 0
}
}
pub type FEIE_R = crate::BitReader<FEIE>;
impl FEIE_R {
#[inline(always)]
pub const fn variant(&self) -> FEIE {
match self.bits {
false => FEIE::Disabled,
true => FEIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == FEIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == FEIE::Enabled
}
}
pub type FEIE_W<'a, REG> = crate::BitWriter<'a, REG, FEIE>;
impl<'a, REG> FEIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(FEIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(FEIE::Enabled)
}
}
impl R {
#[inline(always)]
pub fn fth(&self) -> FTH_R {
FTH_R::new((self.bits & 3) as u8)
}
#[inline(always)]
pub fn dmdis(&self) -> DMDIS_R {
DMDIS_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn fs(&self) -> FS_R {
FS_R::new(((self.bits >> 3) & 7) as u8)
}
#[inline(always)]
pub fn feie(&self) -> FEIE_R {
FEIE_R::new(((self.bits >> 7) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("FCR")
.field("feie", &self.feie())
.field("fs", &self.fs())
.field("dmdis", &self.dmdis())
.field("fth", &self.fth())
.finish()
}
}
impl W {
#[inline(always)]
pub fn fth(&mut self) -> FTH_W<FCRrs> {
FTH_W::new(self, 0)
}
#[inline(always)]
pub fn dmdis(&mut self) -> DMDIS_W<FCRrs> {
DMDIS_W::new(self, 2)
}
#[inline(always)]
pub fn feie(&mut self) -> FEIE_W<FCRrs> {
FEIE_W::new(self, 7)
}
}
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 {
const RESET_VALUE: u32 = 0x21;
}