pub type R = crate::R<CTRLrs>;
pub type W = crate::W<CTRLrs>;
pub type EnR = crate::BitReader;
pub type EnW<'a, REG> = crate::BitWriter<'a, REG>;
pub type SlaveR = crate::BitReader;
pub type SlaveW<'a, REG> = crate::BitWriter<'a, REG>;
pub type AutoackR = crate::BitReader;
pub type AutoackW<'a, REG> = crate::BitWriter<'a, REG>;
pub type AutoseR = crate::BitReader;
pub type AutoseW<'a, REG> = crate::BitWriter<'a, REG>;
pub type AutosnR = crate::BitReader;
pub type AutosnW<'a, REG> = crate::BitWriter<'a, REG>;
pub type ArbdisR = crate::BitReader;
pub type ArbdisW<'a, REG> = crate::BitWriter<'a, REG>;
pub type GcamenR = crate::BitReader;
pub type GcamenW<'a, REG> = crate::BitWriter<'a, REG>;
pub type TxbilR = crate::BitReader;
pub type TxbilW<'a, REG> = crate::BitWriter<'a, REG>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum CLHR {
Standard = 0,
Asymmetric = 1,
Fast = 2,
}
impl From<CLHR> for u8 {
#[inline(always)]
fn from(variant: CLHR) -> Self {
variant as _
}
}
impl crate::FieldSpec for CLHR {
type Ux = u8;
}
impl crate::IsEnum for CLHR {}
pub type ClhrR = crate::FieldReader<CLHR>;
impl ClhrR {
#[inline(always)]
pub const fn variant(&self) -> Option<CLHR> {
match self.bits {
0 => Some(CLHR::Standard),
1 => Some(CLHR::Asymmetric),
2 => Some(CLHR::Fast),
_ => None,
}
}
#[inline(always)]
pub fn is_standard(&self) -> bool {
*self == CLHR::Standard
}
#[inline(always)]
pub fn is_asymmetric(&self) -> bool {
*self == CLHR::Asymmetric
}
#[inline(always)]
pub fn is_fast(&self) -> bool {
*self == CLHR::Fast
}
}
pub type ClhrW<'a, REG> = crate::FieldWriter<'a, REG, 2, CLHR>;
impl<'a, REG> ClhrW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn standard(self) -> &'a mut crate::W<REG> {
self.variant(CLHR::Standard)
}
#[inline(always)]
pub fn asymmetric(self) -> &'a mut crate::W<REG> {
self.variant(CLHR::Asymmetric)
}
#[inline(always)]
pub fn fast(self) -> &'a mut crate::W<REG> {
self.variant(CLHR::Fast)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum BITO {
Off = 0,
_40pcc = 1,
_80pcc = 2,
_160pcc = 3,
}
impl From<BITO> for u8 {
#[inline(always)]
fn from(variant: BITO) -> Self {
variant as _
}
}
impl crate::FieldSpec for BITO {
type Ux = u8;
}
impl crate::IsEnum for BITO {}
pub type BitoR = crate::FieldReader<BITO>;
impl BitoR {
#[inline(always)]
pub const fn variant(&self) -> BITO {
match self.bits {
0 => BITO::Off,
1 => BITO::_40pcc,
2 => BITO::_80pcc,
3 => BITO::_160pcc,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_off(&self) -> bool {
*self == BITO::Off
}
#[inline(always)]
pub fn is_40pcc(&self) -> bool {
*self == BITO::_40pcc
}
#[inline(always)]
pub fn is_80pcc(&self) -> bool {
*self == BITO::_80pcc
}
#[inline(always)]
pub fn is_160pcc(&self) -> bool {
*self == BITO::_160pcc
}
}
pub type BitoW<'a, REG> = crate::FieldWriter<'a, REG, 2, BITO, crate::Safe>;
impl<'a, REG> BitoW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn off(self) -> &'a mut crate::W<REG> {
self.variant(BITO::Off)
}
#[inline(always)]
pub fn _40pcc(self) -> &'a mut crate::W<REG> {
self.variant(BITO::_40pcc)
}
#[inline(always)]
pub fn _80pcc(self) -> &'a mut crate::W<REG> {
self.variant(BITO::_80pcc)
}
#[inline(always)]
pub fn _160pcc(self) -> &'a mut crate::W<REG> {
self.variant(BITO::_160pcc)
}
}
pub type GibitoR = crate::BitReader;
pub type GibitoW<'a, REG> = crate::BitWriter<'a, REG>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum CLTO {
Off = 0,
_40pcc = 1,
_80pcc = 2,
_160pcc = 3,
_320pcc = 4,
_1024pcc = 5,
}
impl From<CLTO> for u8 {
#[inline(always)]
fn from(variant: CLTO) -> Self {
variant as _
}
}
impl crate::FieldSpec for CLTO {
type Ux = u8;
}
impl crate::IsEnum for CLTO {}
pub type CltoR = crate::FieldReader<CLTO>;
impl CltoR {
#[inline(always)]
pub const fn variant(&self) -> Option<CLTO> {
match self.bits {
0 => Some(CLTO::Off),
1 => Some(CLTO::_40pcc),
2 => Some(CLTO::_80pcc),
3 => Some(CLTO::_160pcc),
4 => Some(CLTO::_320pcc),
5 => Some(CLTO::_1024pcc),
_ => None,
}
}
#[inline(always)]
pub fn is_off(&self) -> bool {
*self == CLTO::Off
}
#[inline(always)]
pub fn is_40pcc(&self) -> bool {
*self == CLTO::_40pcc
}
#[inline(always)]
pub fn is_80pcc(&self) -> bool {
*self == CLTO::_80pcc
}
#[inline(always)]
pub fn is_160pcc(&self) -> bool {
*self == CLTO::_160pcc
}
#[inline(always)]
pub fn is_320pcc(&self) -> bool {
*self == CLTO::_320pcc
}
#[inline(always)]
pub fn is_1024pcc(&self) -> bool {
*self == CLTO::_1024pcc
}
}
pub type CltoW<'a, REG> = crate::FieldWriter<'a, REG, 3, CLTO>;
impl<'a, REG> CltoW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn off(self) -> &'a mut crate::W<REG> {
self.variant(CLTO::Off)
}
#[inline(always)]
pub fn _40pcc(self) -> &'a mut crate::W<REG> {
self.variant(CLTO::_40pcc)
}
#[inline(always)]
pub fn _80pcc(self) -> &'a mut crate::W<REG> {
self.variant(CLTO::_80pcc)
}
#[inline(always)]
pub fn _160pcc(self) -> &'a mut crate::W<REG> {
self.variant(CLTO::_160pcc)
}
#[inline(always)]
pub fn _320pcc(self) -> &'a mut crate::W<REG> {
self.variant(CLTO::_320pcc)
}
#[inline(always)]
pub fn _1024pcc(self) -> &'a mut crate::W<REG> {
self.variant(CLTO::_1024pcc)
}
}
impl R {
#[inline(always)]
pub fn en(&self) -> EnR {
EnR::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn slave(&self) -> SlaveR {
SlaveR::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn autoack(&self) -> AutoackR {
AutoackR::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn autose(&self) -> AutoseR {
AutoseR::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn autosn(&self) -> AutosnR {
AutosnR::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn arbdis(&self) -> ArbdisR {
ArbdisR::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn gcamen(&self) -> GcamenR {
GcamenR::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn txbil(&self) -> TxbilR {
TxbilR::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn clhr(&self) -> ClhrR {
ClhrR::new(((self.bits >> 8) & 3) as u8)
}
#[inline(always)]
pub fn bito(&self) -> BitoR {
BitoR::new(((self.bits >> 12) & 3) as u8)
}
#[inline(always)]
pub fn gibito(&self) -> GibitoR {
GibitoR::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn clto(&self) -> CltoR {
CltoR::new(((self.bits >> 16) & 7) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CTRL")
.field("en", &self.en())
.field("slave", &self.slave())
.field("autoack", &self.autoack())
.field("autose", &self.autose())
.field("autosn", &self.autosn())
.field("arbdis", &self.arbdis())
.field("gcamen", &self.gcamen())
.field("txbil", &self.txbil())
.field("clhr", &self.clhr())
.field("bito", &self.bito())
.field("gibito", &self.gibito())
.field("clto", &self.clto())
.finish()
}
}
impl W {
#[inline(always)]
pub fn en(&mut self) -> EnW<'_, CTRLrs> {
EnW::new(self, 0)
}
#[inline(always)]
pub fn slave(&mut self) -> SlaveW<'_, CTRLrs> {
SlaveW::new(self, 1)
}
#[inline(always)]
pub fn autoack(&mut self) -> AutoackW<'_, CTRLrs> {
AutoackW::new(self, 2)
}
#[inline(always)]
pub fn autose(&mut self) -> AutoseW<'_, CTRLrs> {
AutoseW::new(self, 3)
}
#[inline(always)]
pub fn autosn(&mut self) -> AutosnW<'_, CTRLrs> {
AutosnW::new(self, 4)
}
#[inline(always)]
pub fn arbdis(&mut self) -> ArbdisW<'_, CTRLrs> {
ArbdisW::new(self, 5)
}
#[inline(always)]
pub fn gcamen(&mut self) -> GcamenW<'_, CTRLrs> {
GcamenW::new(self, 6)
}
#[inline(always)]
pub fn txbil(&mut self) -> TxbilW<'_, CTRLrs> {
TxbilW::new(self, 7)
}
#[inline(always)]
pub fn clhr(&mut self) -> ClhrW<'_, CTRLrs> {
ClhrW::new(self, 8)
}
#[inline(always)]
pub fn bito(&mut self) -> BitoW<'_, CTRLrs> {
BitoW::new(self, 12)
}
#[inline(always)]
pub fn gibito(&mut self) -> GibitoW<'_, CTRLrs> {
GibitoW::new(self, 15)
}
#[inline(always)]
pub fn clto(&mut self) -> CltoW<'_, CTRLrs> {
CltoW::new(self, 16)
}
}
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 {}