pub type R = crate::R<TIMINGrs>;
pub type W = crate::W<TIMINGrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum TXDELAY {
Disable = 0,
One = 1,
Two = 2,
Three = 3,
Seven = 4,
Tcmp0 = 5,
Tcmp1 = 6,
Tcmp2 = 7,
}
impl From<TXDELAY> for u8 {
#[inline(always)]
fn from(variant: TXDELAY) -> Self {
variant as _
}
}
impl crate::FieldSpec for TXDELAY {
type Ux = u8;
}
impl crate::IsEnum for TXDELAY {}
pub type TxdelayR = crate::FieldReader<TXDELAY>;
impl TxdelayR {
#[inline(always)]
pub const fn variant(&self) -> TXDELAY {
match self.bits {
0 => TXDELAY::Disable,
1 => TXDELAY::One,
2 => TXDELAY::Two,
3 => TXDELAY::Three,
4 => TXDELAY::Seven,
5 => TXDELAY::Tcmp0,
6 => TXDELAY::Tcmp1,
7 => TXDELAY::Tcmp2,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_disable(&self) -> bool {
*self == TXDELAY::Disable
}
#[inline(always)]
pub fn is_one(&self) -> bool {
*self == TXDELAY::One
}
#[inline(always)]
pub fn is_two(&self) -> bool {
*self == TXDELAY::Two
}
#[inline(always)]
pub fn is_three(&self) -> bool {
*self == TXDELAY::Three
}
#[inline(always)]
pub fn is_seven(&self) -> bool {
*self == TXDELAY::Seven
}
#[inline(always)]
pub fn is_tcmp0(&self) -> bool {
*self == TXDELAY::Tcmp0
}
#[inline(always)]
pub fn is_tcmp1(&self) -> bool {
*self == TXDELAY::Tcmp1
}
#[inline(always)]
pub fn is_tcmp2(&self) -> bool {
*self == TXDELAY::Tcmp2
}
}
pub type TxdelayW<'a, REG> = crate::FieldWriter<'a, REG, 3, TXDELAY, crate::Safe>;
impl<'a, REG> TxdelayW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn disable(self) -> &'a mut crate::W<REG> {
self.variant(TXDELAY::Disable)
}
#[inline(always)]
pub fn one(self) -> &'a mut crate::W<REG> {
self.variant(TXDELAY::One)
}
#[inline(always)]
pub fn two(self) -> &'a mut crate::W<REG> {
self.variant(TXDELAY::Two)
}
#[inline(always)]
pub fn three(self) -> &'a mut crate::W<REG> {
self.variant(TXDELAY::Three)
}
#[inline(always)]
pub fn seven(self) -> &'a mut crate::W<REG> {
self.variant(TXDELAY::Seven)
}
#[inline(always)]
pub fn tcmp0(self) -> &'a mut crate::W<REG> {
self.variant(TXDELAY::Tcmp0)
}
#[inline(always)]
pub fn tcmp1(self) -> &'a mut crate::W<REG> {
self.variant(TXDELAY::Tcmp1)
}
#[inline(always)]
pub fn tcmp2(self) -> &'a mut crate::W<REG> {
self.variant(TXDELAY::Tcmp2)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum CSSETUP {
Zero = 0,
One = 1,
Two = 2,
Three = 3,
Seven = 4,
Tcmp0 = 5,
Tcmp1 = 6,
Tcmp2 = 7,
}
impl From<CSSETUP> for u8 {
#[inline(always)]
fn from(variant: CSSETUP) -> Self {
variant as _
}
}
impl crate::FieldSpec for CSSETUP {
type Ux = u8;
}
impl crate::IsEnum for CSSETUP {}
pub type CssetupR = crate::FieldReader<CSSETUP>;
impl CssetupR {
#[inline(always)]
pub const fn variant(&self) -> CSSETUP {
match self.bits {
0 => CSSETUP::Zero,
1 => CSSETUP::One,
2 => CSSETUP::Two,
3 => CSSETUP::Three,
4 => CSSETUP::Seven,
5 => CSSETUP::Tcmp0,
6 => CSSETUP::Tcmp1,
7 => CSSETUP::Tcmp2,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_zero(&self) -> bool {
*self == CSSETUP::Zero
}
#[inline(always)]
pub fn is_one(&self) -> bool {
*self == CSSETUP::One
}
#[inline(always)]
pub fn is_two(&self) -> bool {
*self == CSSETUP::Two
}
#[inline(always)]
pub fn is_three(&self) -> bool {
*self == CSSETUP::Three
}
#[inline(always)]
pub fn is_seven(&self) -> bool {
*self == CSSETUP::Seven
}
#[inline(always)]
pub fn is_tcmp0(&self) -> bool {
*self == CSSETUP::Tcmp0
}
#[inline(always)]
pub fn is_tcmp1(&self) -> bool {
*self == CSSETUP::Tcmp1
}
#[inline(always)]
pub fn is_tcmp2(&self) -> bool {
*self == CSSETUP::Tcmp2
}
}
pub type CssetupW<'a, REG> = crate::FieldWriter<'a, REG, 3, CSSETUP, crate::Safe>;
impl<'a, REG> CssetupW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn zero(self) -> &'a mut crate::W<REG> {
self.variant(CSSETUP::Zero)
}
#[inline(always)]
pub fn one(self) -> &'a mut crate::W<REG> {
self.variant(CSSETUP::One)
}
#[inline(always)]
pub fn two(self) -> &'a mut crate::W<REG> {
self.variant(CSSETUP::Two)
}
#[inline(always)]
pub fn three(self) -> &'a mut crate::W<REG> {
self.variant(CSSETUP::Three)
}
#[inline(always)]
pub fn seven(self) -> &'a mut crate::W<REG> {
self.variant(CSSETUP::Seven)
}
#[inline(always)]
pub fn tcmp0(self) -> &'a mut crate::W<REG> {
self.variant(CSSETUP::Tcmp0)
}
#[inline(always)]
pub fn tcmp1(self) -> &'a mut crate::W<REG> {
self.variant(CSSETUP::Tcmp1)
}
#[inline(always)]
pub fn tcmp2(self) -> &'a mut crate::W<REG> {
self.variant(CSSETUP::Tcmp2)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum ICS {
Zero = 0,
One = 1,
Two = 2,
Three = 3,
Seven = 4,
Tcmp0 = 5,
Tcmp1 = 6,
Tcmp2 = 7,
}
impl From<ICS> for u8 {
#[inline(always)]
fn from(variant: ICS) -> Self {
variant as _
}
}
impl crate::FieldSpec for ICS {
type Ux = u8;
}
impl crate::IsEnum for ICS {}
pub type IcsR = crate::FieldReader<ICS>;
impl IcsR {
#[inline(always)]
pub const fn variant(&self) -> ICS {
match self.bits {
0 => ICS::Zero,
1 => ICS::One,
2 => ICS::Two,
3 => ICS::Three,
4 => ICS::Seven,
5 => ICS::Tcmp0,
6 => ICS::Tcmp1,
7 => ICS::Tcmp2,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_zero(&self) -> bool {
*self == ICS::Zero
}
#[inline(always)]
pub fn is_one(&self) -> bool {
*self == ICS::One
}
#[inline(always)]
pub fn is_two(&self) -> bool {
*self == ICS::Two
}
#[inline(always)]
pub fn is_three(&self) -> bool {
*self == ICS::Three
}
#[inline(always)]
pub fn is_seven(&self) -> bool {
*self == ICS::Seven
}
#[inline(always)]
pub fn is_tcmp0(&self) -> bool {
*self == ICS::Tcmp0
}
#[inline(always)]
pub fn is_tcmp1(&self) -> bool {
*self == ICS::Tcmp1
}
#[inline(always)]
pub fn is_tcmp2(&self) -> bool {
*self == ICS::Tcmp2
}
}
pub type IcsW<'a, REG> = crate::FieldWriter<'a, REG, 3, ICS, crate::Safe>;
impl<'a, REG> IcsW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn zero(self) -> &'a mut crate::W<REG> {
self.variant(ICS::Zero)
}
#[inline(always)]
pub fn one(self) -> &'a mut crate::W<REG> {
self.variant(ICS::One)
}
#[inline(always)]
pub fn two(self) -> &'a mut crate::W<REG> {
self.variant(ICS::Two)
}
#[inline(always)]
pub fn three(self) -> &'a mut crate::W<REG> {
self.variant(ICS::Three)
}
#[inline(always)]
pub fn seven(self) -> &'a mut crate::W<REG> {
self.variant(ICS::Seven)
}
#[inline(always)]
pub fn tcmp0(self) -> &'a mut crate::W<REG> {
self.variant(ICS::Tcmp0)
}
#[inline(always)]
pub fn tcmp1(self) -> &'a mut crate::W<REG> {
self.variant(ICS::Tcmp1)
}
#[inline(always)]
pub fn tcmp2(self) -> &'a mut crate::W<REG> {
self.variant(ICS::Tcmp2)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum CSHOLD {
Zero = 0,
One = 1,
Two = 2,
Three = 3,
Seven = 4,
Tcmp0 = 5,
Tcmp1 = 6,
Tcmp2 = 7,
}
impl From<CSHOLD> for u8 {
#[inline(always)]
fn from(variant: CSHOLD) -> Self {
variant as _
}
}
impl crate::FieldSpec for CSHOLD {
type Ux = u8;
}
impl crate::IsEnum for CSHOLD {}
pub type CsholdR = crate::FieldReader<CSHOLD>;
impl CsholdR {
#[inline(always)]
pub const fn variant(&self) -> CSHOLD {
match self.bits {
0 => CSHOLD::Zero,
1 => CSHOLD::One,
2 => CSHOLD::Two,
3 => CSHOLD::Three,
4 => CSHOLD::Seven,
5 => CSHOLD::Tcmp0,
6 => CSHOLD::Tcmp1,
7 => CSHOLD::Tcmp2,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_zero(&self) -> bool {
*self == CSHOLD::Zero
}
#[inline(always)]
pub fn is_one(&self) -> bool {
*self == CSHOLD::One
}
#[inline(always)]
pub fn is_two(&self) -> bool {
*self == CSHOLD::Two
}
#[inline(always)]
pub fn is_three(&self) -> bool {
*self == CSHOLD::Three
}
#[inline(always)]
pub fn is_seven(&self) -> bool {
*self == CSHOLD::Seven
}
#[inline(always)]
pub fn is_tcmp0(&self) -> bool {
*self == CSHOLD::Tcmp0
}
#[inline(always)]
pub fn is_tcmp1(&self) -> bool {
*self == CSHOLD::Tcmp1
}
#[inline(always)]
pub fn is_tcmp2(&self) -> bool {
*self == CSHOLD::Tcmp2
}
}
pub type CsholdW<'a, REG> = crate::FieldWriter<'a, REG, 3, CSHOLD, crate::Safe>;
impl<'a, REG> CsholdW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn zero(self) -> &'a mut crate::W<REG> {
self.variant(CSHOLD::Zero)
}
#[inline(always)]
pub fn one(self) -> &'a mut crate::W<REG> {
self.variant(CSHOLD::One)
}
#[inline(always)]
pub fn two(self) -> &'a mut crate::W<REG> {
self.variant(CSHOLD::Two)
}
#[inline(always)]
pub fn three(self) -> &'a mut crate::W<REG> {
self.variant(CSHOLD::Three)
}
#[inline(always)]
pub fn seven(self) -> &'a mut crate::W<REG> {
self.variant(CSHOLD::Seven)
}
#[inline(always)]
pub fn tcmp0(self) -> &'a mut crate::W<REG> {
self.variant(CSHOLD::Tcmp0)
}
#[inline(always)]
pub fn tcmp1(self) -> &'a mut crate::W<REG> {
self.variant(CSHOLD::Tcmp1)
}
#[inline(always)]
pub fn tcmp2(self) -> &'a mut crate::W<REG> {
self.variant(CSHOLD::Tcmp2)
}
}
impl R {
#[inline(always)]
pub fn txdelay(&self) -> TxdelayR {
TxdelayR::new(((self.bits >> 16) & 7) as u8)
}
#[inline(always)]
pub fn cssetup(&self) -> CssetupR {
CssetupR::new(((self.bits >> 20) & 7) as u8)
}
#[inline(always)]
pub fn ics(&self) -> IcsR {
IcsR::new(((self.bits >> 24) & 7) as u8)
}
#[inline(always)]
pub fn cshold(&self) -> CsholdR {
CsholdR::new(((self.bits >> 28) & 7) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TIMING")
.field("txdelay", &self.txdelay())
.field("cssetup", &self.cssetup())
.field("ics", &self.ics())
.field("cshold", &self.cshold())
.finish()
}
}
impl W {
#[inline(always)]
pub fn txdelay(&mut self) -> TxdelayW<'_, TIMINGrs> {
TxdelayW::new(self, 16)
}
#[inline(always)]
pub fn cssetup(&mut self) -> CssetupW<'_, TIMINGrs> {
CssetupW::new(self, 20)
}
#[inline(always)]
pub fn ics(&mut self) -> IcsW<'_, TIMINGrs> {
IcsW::new(self, 24)
}
#[inline(always)]
pub fn cshold(&mut self) -> CsholdW<'_, TIMINGrs> {
CsholdW::new(self, 28)
}
}
pub struct TIMINGrs;
impl crate::RegisterSpec for TIMINGrs {
type Ux = u32;
}
impl crate::Readable for TIMINGrs {}
impl crate::Writable for TIMINGrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for TIMINGrs {}