pub type R = crate::R<SCANCTRLrs>;
pub type W = crate::W<SCANCTRLrs>;
pub type RepR = crate::BitReader;
pub type RepW<'a, REG> = crate::BitWriter<'a, REG>;
pub type DiffR = crate::BitReader;
pub type DiffW<'a, REG> = crate::BitWriter<'a, REG>;
pub type AdjR = crate::BitReader;
pub type AdjW<'a, REG> = crate::BitWriter<'a, REG>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum RES {
_12bit = 0,
_8bit = 1,
_6bit = 2,
Ovs = 3,
}
impl From<RES> for u8 {
#[inline(always)]
fn from(variant: RES) -> Self {
variant as _
}
}
impl crate::FieldSpec for RES {
type Ux = u8;
}
impl crate::IsEnum for RES {}
pub type ResR = crate::FieldReader<RES>;
impl ResR {
#[inline(always)]
pub const fn variant(&self) -> RES {
match self.bits {
0 => RES::_12bit,
1 => RES::_8bit,
2 => RES::_6bit,
3 => RES::Ovs,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_12bit(&self) -> bool {
*self == RES::_12bit
}
#[inline(always)]
pub fn is_8bit(&self) -> bool {
*self == RES::_8bit
}
#[inline(always)]
pub fn is_6bit(&self) -> bool {
*self == RES::_6bit
}
#[inline(always)]
pub fn is_ovs(&self) -> bool {
*self == RES::Ovs
}
}
pub type ResW<'a, REG> = crate::FieldWriter<'a, REG, 2, RES, crate::Safe>;
impl<'a, REG> ResW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn _12bit(self) -> &'a mut crate::W<REG> {
self.variant(RES::_12bit)
}
#[inline(always)]
pub fn _8bit(self) -> &'a mut crate::W<REG> {
self.variant(RES::_8bit)
}
#[inline(always)]
pub fn _6bit(self) -> &'a mut crate::W<REG> {
self.variant(RES::_6bit)
}
#[inline(always)]
pub fn ovs(self) -> &'a mut crate::W<REG> {
self.variant(RES::Ovs)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum REF {
_1v25 = 0,
_2v5 = 1,
Vdd = 2,
_5v = 3,
Extsingle = 4,
_2xextdiff = 5,
_2xvdd = 6,
Conf = 7,
}
impl From<REF> for u8 {
#[inline(always)]
fn from(variant: REF) -> Self {
variant as _
}
}
impl crate::FieldSpec for REF {
type Ux = u8;
}
impl crate::IsEnum for REF {}
pub type RefR = crate::FieldReader<REF>;
impl RefR {
#[inline(always)]
pub const fn variant(&self) -> REF {
match self.bits {
0 => REF::_1v25,
1 => REF::_2v5,
2 => REF::Vdd,
3 => REF::_5v,
4 => REF::Extsingle,
5 => REF::_2xextdiff,
6 => REF::_2xvdd,
7 => REF::Conf,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_1v25(&self) -> bool {
*self == REF::_1v25
}
#[inline(always)]
pub fn is_2v5(&self) -> bool {
*self == REF::_2v5
}
#[inline(always)]
pub fn is_vdd(&self) -> bool {
*self == REF::Vdd
}
#[inline(always)]
pub fn is_5v(&self) -> bool {
*self == REF::_5v
}
#[inline(always)]
pub fn is_extsingle(&self) -> bool {
*self == REF::Extsingle
}
#[inline(always)]
pub fn is_2xextdiff(&self) -> bool {
*self == REF::_2xextdiff
}
#[inline(always)]
pub fn is_2xvdd(&self) -> bool {
*self == REF::_2xvdd
}
#[inline(always)]
pub fn is_conf(&self) -> bool {
*self == REF::Conf
}
}
pub type RefW<'a, REG> = crate::FieldWriter<'a, REG, 3, REF, crate::Safe>;
impl<'a, REG> RefW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn _1v25(self) -> &'a mut crate::W<REG> {
self.variant(REF::_1v25)
}
#[inline(always)]
pub fn _2v5(self) -> &'a mut crate::W<REG> {
self.variant(REF::_2v5)
}
#[inline(always)]
pub fn vdd(self) -> &'a mut crate::W<REG> {
self.variant(REF::Vdd)
}
#[inline(always)]
pub fn _5v(self) -> &'a mut crate::W<REG> {
self.variant(REF::_5v)
}
#[inline(always)]
pub fn extsingle(self) -> &'a mut crate::W<REG> {
self.variant(REF::Extsingle)
}
#[inline(always)]
pub fn _2xextdiff(self) -> &'a mut crate::W<REG> {
self.variant(REF::_2xextdiff)
}
#[inline(always)]
pub fn _2xvdd(self) -> &'a mut crate::W<REG> {
self.variant(REF::_2xvdd)
}
#[inline(always)]
pub fn conf(self) -> &'a mut crate::W<REG> {
self.variant(REF::Conf)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum AT {
_1cycle = 0,
_2cycles = 1,
_3cycles = 2,
_4cycles = 3,
_8cycles = 4,
_16cycles = 5,
_32cycles = 6,
_64cycles = 7,
_128cycles = 8,
_256cycles = 9,
}
impl From<AT> for u8 {
#[inline(always)]
fn from(variant: AT) -> Self {
variant as _
}
}
impl crate::FieldSpec for AT {
type Ux = u8;
}
impl crate::IsEnum for AT {}
pub type AtR = crate::FieldReader<AT>;
impl AtR {
#[inline(always)]
pub const fn variant(&self) -> Option<AT> {
match self.bits {
0 => Some(AT::_1cycle),
1 => Some(AT::_2cycles),
2 => Some(AT::_3cycles),
3 => Some(AT::_4cycles),
4 => Some(AT::_8cycles),
5 => Some(AT::_16cycles),
6 => Some(AT::_32cycles),
7 => Some(AT::_64cycles),
8 => Some(AT::_128cycles),
9 => Some(AT::_256cycles),
_ => None,
}
}
#[inline(always)]
pub fn is_1cycle(&self) -> bool {
*self == AT::_1cycle
}
#[inline(always)]
pub fn is_2cycles(&self) -> bool {
*self == AT::_2cycles
}
#[inline(always)]
pub fn is_3cycles(&self) -> bool {
*self == AT::_3cycles
}
#[inline(always)]
pub fn is_4cycles(&self) -> bool {
*self == AT::_4cycles
}
#[inline(always)]
pub fn is_8cycles(&self) -> bool {
*self == AT::_8cycles
}
#[inline(always)]
pub fn is_16cycles(&self) -> bool {
*self == AT::_16cycles
}
#[inline(always)]
pub fn is_32cycles(&self) -> bool {
*self == AT::_32cycles
}
#[inline(always)]
pub fn is_64cycles(&self) -> bool {
*self == AT::_64cycles
}
#[inline(always)]
pub fn is_128cycles(&self) -> bool {
*self == AT::_128cycles
}
#[inline(always)]
pub fn is_256cycles(&self) -> bool {
*self == AT::_256cycles
}
}
pub type AtW<'a, REG> = crate::FieldWriter<'a, REG, 4, AT>;
impl<'a, REG> AtW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn _1cycle(self) -> &'a mut crate::W<REG> {
self.variant(AT::_1cycle)
}
#[inline(always)]
pub fn _2cycles(self) -> &'a mut crate::W<REG> {
self.variant(AT::_2cycles)
}
#[inline(always)]
pub fn _3cycles(self) -> &'a mut crate::W<REG> {
self.variant(AT::_3cycles)
}
#[inline(always)]
pub fn _4cycles(self) -> &'a mut crate::W<REG> {
self.variant(AT::_4cycles)
}
#[inline(always)]
pub fn _8cycles(self) -> &'a mut crate::W<REG> {
self.variant(AT::_8cycles)
}
#[inline(always)]
pub fn _16cycles(self) -> &'a mut crate::W<REG> {
self.variant(AT::_16cycles)
}
#[inline(always)]
pub fn _32cycles(self) -> &'a mut crate::W<REG> {
self.variant(AT::_32cycles)
}
#[inline(always)]
pub fn _64cycles(self) -> &'a mut crate::W<REG> {
self.variant(AT::_64cycles)
}
#[inline(always)]
pub fn _128cycles(self) -> &'a mut crate::W<REG> {
self.variant(AT::_128cycles)
}
#[inline(always)]
pub fn _256cycles(self) -> &'a mut crate::W<REG> {
self.variant(AT::_256cycles)
}
}
pub type PrsenR = crate::BitReader;
pub type PrsenW<'a, REG> = crate::BitWriter<'a, REG>;
pub type CmpenR = crate::BitReader;
pub type CmpenW<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn rep(&self) -> RepR {
RepR::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn diff(&self) -> DiffR {
DiffR::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn adj(&self) -> AdjR {
AdjR::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn res(&self) -> ResR {
ResR::new(((self.bits >> 3) & 3) as u8)
}
#[inline(always)]
pub fn ref_(&self) -> RefR {
RefR::new(((self.bits >> 5) & 7) as u8)
}
#[inline(always)]
pub fn at(&self) -> AtR {
AtR::new(((self.bits >> 24) & 0x0f) as u8)
}
#[inline(always)]
pub fn prsen(&self) -> PrsenR {
PrsenR::new(((self.bits >> 29) & 1) != 0)
}
#[inline(always)]
pub fn cmpen(&self) -> CmpenR {
CmpenR::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("SCANCTRL")
.field("rep", &self.rep())
.field("diff", &self.diff())
.field("adj", &self.adj())
.field("res", &self.res())
.field("ref_", &self.ref_())
.field("at", &self.at())
.field("prsen", &self.prsen())
.field("cmpen", &self.cmpen())
.finish()
}
}
impl W {
#[inline(always)]
pub fn rep(&mut self) -> RepW<'_, SCANCTRLrs> {
RepW::new(self, 0)
}
#[inline(always)]
pub fn diff(&mut self) -> DiffW<'_, SCANCTRLrs> {
DiffW::new(self, 1)
}
#[inline(always)]
pub fn adj(&mut self) -> AdjW<'_, SCANCTRLrs> {
AdjW::new(self, 2)
}
#[inline(always)]
pub fn res(&mut self) -> ResW<'_, SCANCTRLrs> {
ResW::new(self, 3)
}
#[inline(always)]
pub fn ref_(&mut self) -> RefW<'_, SCANCTRLrs> {
RefW::new(self, 5)
}
#[inline(always)]
pub fn at(&mut self) -> AtW<'_, SCANCTRLrs> {
AtW::new(self, 24)
}
#[inline(always)]
pub fn prsen(&mut self) -> PrsenW<'_, SCANCTRLrs> {
PrsenW::new(self, 29)
}
#[inline(always)]
pub fn cmpen(&mut self) -> CmpenW<'_, SCANCTRLrs> {
CmpenW::new(self, 31)
}
}
pub struct SCANCTRLrs;
impl crate::RegisterSpec for SCANCTRLrs {
type Ux = u32;
}
impl crate::Readable for SCANCTRLrs {}
impl crate::Writable for SCANCTRLrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for SCANCTRLrs {}