pub type R = crate::R<CTRLrs>;
pub type W = crate::W<CTRLrs>;
pub type SyncR = crate::BitReader;
pub type SyncW<'a, REG> = crate::BitWriter<'a, REG>;
pub type LoopbkR = crate::BitReader;
pub type LoopbkW<'a, REG> = crate::BitWriter<'a, REG>;
pub type CcenR = crate::BitReader;
pub type CcenW<'a, REG> = crate::BitWriter<'a, REG>;
pub type MpmR = crate::BitReader;
pub type MpmW<'a, REG> = crate::BitWriter<'a, REG>;
pub type MpabR = crate::BitReader;
pub type MpabW<'a, REG> = crate::BitWriter<'a, REG>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum OVS {
X16 = 0,
X8 = 1,
X6 = 2,
X4 = 3,
}
impl From<OVS> for u8 {
#[inline(always)]
fn from(variant: OVS) -> Self {
variant as _
}
}
impl crate::FieldSpec for OVS {
type Ux = u8;
}
impl crate::IsEnum for OVS {}
pub type OvsR = crate::FieldReader<OVS>;
impl OvsR {
#[inline(always)]
pub const fn variant(&self) -> OVS {
match self.bits {
0 => OVS::X16,
1 => OVS::X8,
2 => OVS::X6,
3 => OVS::X4,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_x16(&self) -> bool {
*self == OVS::X16
}
#[inline(always)]
pub fn is_x8(&self) -> bool {
*self == OVS::X8
}
#[inline(always)]
pub fn is_x6(&self) -> bool {
*self == OVS::X6
}
#[inline(always)]
pub fn is_x4(&self) -> bool {
*self == OVS::X4
}
}
pub type OvsW<'a, REG> = crate::FieldWriter<'a, REG, 2, OVS, crate::Safe>;
impl<'a, REG> OvsW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn x16(self) -> &'a mut crate::W<REG> {
self.variant(OVS::X16)
}
#[inline(always)]
pub fn x8(self) -> &'a mut crate::W<REG> {
self.variant(OVS::X8)
}
#[inline(always)]
pub fn x6(self) -> &'a mut crate::W<REG> {
self.variant(OVS::X6)
}
#[inline(always)]
pub fn x4(self) -> &'a mut crate::W<REG> {
self.variant(OVS::X4)
}
}
pub type ClkpolR = crate::BitReader;
pub type ClkpolW<'a, REG> = crate::BitWriter<'a, REG>;
pub type ClkphaR = crate::BitReader;
pub type ClkphaW<'a, REG> = crate::BitWriter<'a, REG>;
pub type MsbfR = crate::BitReader;
pub type MsbfW<'a, REG> = crate::BitWriter<'a, REG>;
pub type CsmaR = crate::BitReader;
pub type CsmaW<'a, REG> = crate::BitWriter<'a, REG>;
pub type TxbilR = crate::BitReader;
pub type TxbilW<'a, REG> = crate::BitWriter<'a, REG>;
pub type RxinvR = crate::BitReader;
pub type RxinvW<'a, REG> = crate::BitWriter<'a, REG>;
pub type TxinvR = crate::BitReader;
pub type TxinvW<'a, REG> = crate::BitWriter<'a, REG>;
pub type CsinvR = crate::BitReader;
pub type CsinvW<'a, REG> = crate::BitWriter<'a, REG>;
pub type AutocsR = crate::BitReader;
pub type AutocsW<'a, REG> = crate::BitWriter<'a, REG>;
pub type AutotriR = crate::BitReader;
pub type AutotriW<'a, REG> = crate::BitWriter<'a, REG>;
pub type ScmodeR = crate::BitReader;
pub type ScmodeW<'a, REG> = crate::BitWriter<'a, REG>;
pub type ScretransR = crate::BitReader;
pub type ScretransW<'a, REG> = crate::BitWriter<'a, REG>;
pub type SkipperrfR = crate::BitReader;
pub type SkipperrfW<'a, REG> = crate::BitWriter<'a, REG>;
pub type Bit8dvR = crate::BitReader;
pub type Bit8dvW<'a, REG> = crate::BitWriter<'a, REG>;
pub type ErrsdmaR = crate::BitReader;
pub type ErrsdmaW<'a, REG> = crate::BitWriter<'a, REG>;
pub type ErrsrxR = crate::BitReader;
pub type ErrsrxW<'a, REG> = crate::BitWriter<'a, REG>;
pub type ErrstxR = crate::BitReader;
pub type ErrstxW<'a, REG> = crate::BitWriter<'a, REG>;
pub type SssearlyR = crate::BitReader;
pub type SssearlyW<'a, REG> = crate::BitWriter<'a, REG>;
pub type ByteswapR = crate::BitReader;
pub type ByteswapW<'a, REG> = crate::BitWriter<'a, REG>;
pub type AutotxR = crate::BitReader;
pub type AutotxW<'a, REG> = crate::BitWriter<'a, REG>;
pub type MvdisR = crate::BitReader;
pub type MvdisW<'a, REG> = crate::BitWriter<'a, REG>;
pub type SmsdelayR = crate::BitReader;
pub type SmsdelayW<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn sync(&self) -> SyncR {
SyncR::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn loopbk(&self) -> LoopbkR {
LoopbkR::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn ccen(&self) -> CcenR {
CcenR::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn mpm(&self) -> MpmR {
MpmR::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn mpab(&self) -> MpabR {
MpabR::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn ovs(&self) -> OvsR {
OvsR::new(((self.bits >> 5) & 3) as u8)
}
#[inline(always)]
pub fn clkpol(&self) -> ClkpolR {
ClkpolR::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn clkpha(&self) -> ClkphaR {
ClkphaR::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn msbf(&self) -> MsbfR {
MsbfR::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn csma(&self) -> CsmaR {
CsmaR::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn txbil(&self) -> TxbilR {
TxbilR::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn rxinv(&self) -> RxinvR {
RxinvR::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn txinv(&self) -> TxinvR {
TxinvR::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn csinv(&self) -> CsinvR {
CsinvR::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn autocs(&self) -> AutocsR {
AutocsR::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn autotri(&self) -> AutotriR {
AutotriR::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn scmode(&self) -> ScmodeR {
ScmodeR::new(((self.bits >> 18) & 1) != 0)
}
#[inline(always)]
pub fn scretrans(&self) -> ScretransR {
ScretransR::new(((self.bits >> 19) & 1) != 0)
}
#[inline(always)]
pub fn skipperrf(&self) -> SkipperrfR {
SkipperrfR::new(((self.bits >> 20) & 1) != 0)
}
#[inline(always)]
pub fn bit8dv(&self) -> Bit8dvR {
Bit8dvR::new(((self.bits >> 21) & 1) != 0)
}
#[inline(always)]
pub fn errsdma(&self) -> ErrsdmaR {
ErrsdmaR::new(((self.bits >> 22) & 1) != 0)
}
#[inline(always)]
pub fn errsrx(&self) -> ErrsrxR {
ErrsrxR::new(((self.bits >> 23) & 1) != 0)
}
#[inline(always)]
pub fn errstx(&self) -> ErrstxR {
ErrstxR::new(((self.bits >> 24) & 1) != 0)
}
#[inline(always)]
pub fn sssearly(&self) -> SssearlyR {
SssearlyR::new(((self.bits >> 25) & 1) != 0)
}
#[inline(always)]
pub fn byteswap(&self) -> ByteswapR {
ByteswapR::new(((self.bits >> 28) & 1) != 0)
}
#[inline(always)]
pub fn autotx(&self) -> AutotxR {
AutotxR::new(((self.bits >> 29) & 1) != 0)
}
#[inline(always)]
pub fn mvdis(&self) -> MvdisR {
MvdisR::new(((self.bits >> 30) & 1) != 0)
}
#[inline(always)]
pub fn smsdelay(&self) -> SmsdelayR {
SmsdelayR::new(((self.bits >> 31) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CTRL")
.field("sync", &self.sync())
.field("loopbk", &self.loopbk())
.field("ccen", &self.ccen())
.field("mpm", &self.mpm())
.field("mpab", &self.mpab())
.field("ovs", &self.ovs())
.field("clkpol", &self.clkpol())
.field("clkpha", &self.clkpha())
.field("msbf", &self.msbf())
.field("csma", &self.csma())
.field("txbil", &self.txbil())
.field("rxinv", &self.rxinv())
.field("txinv", &self.txinv())
.field("csinv", &self.csinv())
.field("autocs", &self.autocs())
.field("autotri", &self.autotri())
.field("scmode", &self.scmode())
.field("scretrans", &self.scretrans())
.field("skipperrf", &self.skipperrf())
.field("bit8dv", &self.bit8dv())
.field("errsdma", &self.errsdma())
.field("errsrx", &self.errsrx())
.field("errstx", &self.errstx())
.field("sssearly", &self.sssearly())
.field("byteswap", &self.byteswap())
.field("autotx", &self.autotx())
.field("mvdis", &self.mvdis())
.field("smsdelay", &self.smsdelay())
.finish()
}
}
impl W {
#[inline(always)]
pub fn sync(&mut self) -> SyncW<'_, CTRLrs> {
SyncW::new(self, 0)
}
#[inline(always)]
pub fn loopbk(&mut self) -> LoopbkW<'_, CTRLrs> {
LoopbkW::new(self, 1)
}
#[inline(always)]
pub fn ccen(&mut self) -> CcenW<'_, CTRLrs> {
CcenW::new(self, 2)
}
#[inline(always)]
pub fn mpm(&mut self) -> MpmW<'_, CTRLrs> {
MpmW::new(self, 3)
}
#[inline(always)]
pub fn mpab(&mut self) -> MpabW<'_, CTRLrs> {
MpabW::new(self, 4)
}
#[inline(always)]
pub fn ovs(&mut self) -> OvsW<'_, CTRLrs> {
OvsW::new(self, 5)
}
#[inline(always)]
pub fn clkpol(&mut self) -> ClkpolW<'_, CTRLrs> {
ClkpolW::new(self, 8)
}
#[inline(always)]
pub fn clkpha(&mut self) -> ClkphaW<'_, CTRLrs> {
ClkphaW::new(self, 9)
}
#[inline(always)]
pub fn msbf(&mut self) -> MsbfW<'_, CTRLrs> {
MsbfW::new(self, 10)
}
#[inline(always)]
pub fn csma(&mut self) -> CsmaW<'_, CTRLrs> {
CsmaW::new(self, 11)
}
#[inline(always)]
pub fn txbil(&mut self) -> TxbilW<'_, CTRLrs> {
TxbilW::new(self, 12)
}
#[inline(always)]
pub fn rxinv(&mut self) -> RxinvW<'_, CTRLrs> {
RxinvW::new(self, 13)
}
#[inline(always)]
pub fn txinv(&mut self) -> TxinvW<'_, CTRLrs> {
TxinvW::new(self, 14)
}
#[inline(always)]
pub fn csinv(&mut self) -> CsinvW<'_, CTRLrs> {
CsinvW::new(self, 15)
}
#[inline(always)]
pub fn autocs(&mut self) -> AutocsW<'_, CTRLrs> {
AutocsW::new(self, 16)
}
#[inline(always)]
pub fn autotri(&mut self) -> AutotriW<'_, CTRLrs> {
AutotriW::new(self, 17)
}
#[inline(always)]
pub fn scmode(&mut self) -> ScmodeW<'_, CTRLrs> {
ScmodeW::new(self, 18)
}
#[inline(always)]
pub fn scretrans(&mut self) -> ScretransW<'_, CTRLrs> {
ScretransW::new(self, 19)
}
#[inline(always)]
pub fn skipperrf(&mut self) -> SkipperrfW<'_, CTRLrs> {
SkipperrfW::new(self, 20)
}
#[inline(always)]
pub fn bit8dv(&mut self) -> Bit8dvW<'_, CTRLrs> {
Bit8dvW::new(self, 21)
}
#[inline(always)]
pub fn errsdma(&mut self) -> ErrsdmaW<'_, CTRLrs> {
ErrsdmaW::new(self, 22)
}
#[inline(always)]
pub fn errsrx(&mut self) -> ErrsrxW<'_, CTRLrs> {
ErrsrxW::new(self, 23)
}
#[inline(always)]
pub fn errstx(&mut self) -> ErrstxW<'_, CTRLrs> {
ErrstxW::new(self, 24)
}
#[inline(always)]
pub fn sssearly(&mut self) -> SssearlyW<'_, CTRLrs> {
SssearlyW::new(self, 25)
}
#[inline(always)]
pub fn byteswap(&mut self) -> ByteswapW<'_, CTRLrs> {
ByteswapW::new(self, 28)
}
#[inline(always)]
pub fn autotx(&mut self) -> AutotxW<'_, CTRLrs> {
AutotxW::new(self, 29)
}
#[inline(always)]
pub fn mvdis(&mut self) -> MvdisW<'_, CTRLrs> {
MvdisW::new(self, 30)
}
#[inline(always)]
pub fn smsdelay(&mut self) -> SmsdelayW<'_, CTRLrs> {
SmsdelayW::new(self, 31)
}
}
pub struct CTRLrs;
impl crate::RegisterSpec for CTRLrs {
type Ux = u32;
}
impl crate::Readable for CTRLrs {}
impl crate::Writable for CTRLrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CTRLrs {}