pub type R = crate::R<DIFSELrs>;
pub type W = crate::W<DIFSELrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DIFSEL0 {
SingleEnded = 0,
Differential = 1,
}
impl From<DIFSEL0> for bool {
#[inline(always)]
fn from(variant: DIFSEL0) -> Self {
variant as u8 != 0
}
}
pub type DIFSEL_R = crate::BitReader<DIFSEL0>;
impl DIFSEL_R {
#[inline(always)]
pub const fn variant(&self) -> DIFSEL0 {
match self.bits {
false => DIFSEL0::SingleEnded,
true => DIFSEL0::Differential,
}
}
#[inline(always)]
pub fn is_single_ended(&self) -> bool {
*self == DIFSEL0::SingleEnded
}
#[inline(always)]
pub fn is_differential(&self) -> bool {
*self == DIFSEL0::Differential
}
}
pub type DIFSEL_W<'a, REG> = crate::BitWriter<'a, REG, DIFSEL0>;
impl<'a, REG> DIFSEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn single_ended(self) -> &'a mut crate::W<REG> {
self.variant(DIFSEL0::SingleEnded)
}
#[inline(always)]
pub fn differential(self) -> &'a mut crate::W<REG> {
self.variant(DIFSEL0::Differential)
}
}
impl R {
#[inline(always)]
pub fn difsel(&self, n: u8) -> DIFSEL_R {
#[allow(clippy::no_effect)] [(); 19][n as usize];
DIFSEL_R::new(((self.bits >> n) & 1) != 0)
}
#[inline(always)]
pub fn difsel_iter(&self) -> impl Iterator<Item = DIFSEL_R> + '_ {
(0..19).map(move |n| DIFSEL_R::new(((self.bits >> n) & 1) != 0))
}
#[inline(always)]
pub fn difsel0(&self) -> DIFSEL_R {
DIFSEL_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn difsel1(&self) -> DIFSEL_R {
DIFSEL_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn difsel2(&self) -> DIFSEL_R {
DIFSEL_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn difsel3(&self) -> DIFSEL_R {
DIFSEL_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn difsel4(&self) -> DIFSEL_R {
DIFSEL_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn difsel5(&self) -> DIFSEL_R {
DIFSEL_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn difsel6(&self) -> DIFSEL_R {
DIFSEL_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn difsel7(&self) -> DIFSEL_R {
DIFSEL_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn difsel8(&self) -> DIFSEL_R {
DIFSEL_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn difsel9(&self) -> DIFSEL_R {
DIFSEL_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn difsel10(&self) -> DIFSEL_R {
DIFSEL_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn difsel11(&self) -> DIFSEL_R {
DIFSEL_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn difsel12(&self) -> DIFSEL_R {
DIFSEL_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn difsel13(&self) -> DIFSEL_R {
DIFSEL_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn difsel14(&self) -> DIFSEL_R {
DIFSEL_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn difsel15(&self) -> DIFSEL_R {
DIFSEL_R::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn difsel16(&self) -> DIFSEL_R {
DIFSEL_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn difsel17(&self) -> DIFSEL_R {
DIFSEL_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn difsel18(&self) -> DIFSEL_R {
DIFSEL_R::new(((self.bits >> 18) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("DIFSEL")
.field("difsel0", &self.difsel0())
.field("difsel1", &self.difsel1())
.field("difsel2", &self.difsel2())
.field("difsel3", &self.difsel3())
.field("difsel4", &self.difsel4())
.field("difsel5", &self.difsel5())
.field("difsel6", &self.difsel6())
.field("difsel7", &self.difsel7())
.field("difsel8", &self.difsel8())
.field("difsel9", &self.difsel9())
.field("difsel10", &self.difsel10())
.field("difsel11", &self.difsel11())
.field("difsel12", &self.difsel12())
.field("difsel13", &self.difsel13())
.field("difsel14", &self.difsel14())
.field("difsel15", &self.difsel15())
.field("difsel16", &self.difsel16())
.field("difsel17", &self.difsel17())
.field("difsel18", &self.difsel18())
.finish()
}
}
impl W {
#[inline(always)]
pub fn difsel(&mut self, n: u8) -> DIFSEL_W<DIFSELrs> {
#[allow(clippy::no_effect)] [(); 19][n as usize];
DIFSEL_W::new(self, n)
}
#[inline(always)]
pub fn difsel0(&mut self) -> DIFSEL_W<DIFSELrs> {
DIFSEL_W::new(self, 0)
}
#[inline(always)]
pub fn difsel1(&mut self) -> DIFSEL_W<DIFSELrs> {
DIFSEL_W::new(self, 1)
}
#[inline(always)]
pub fn difsel2(&mut self) -> DIFSEL_W<DIFSELrs> {
DIFSEL_W::new(self, 2)
}
#[inline(always)]
pub fn difsel3(&mut self) -> DIFSEL_W<DIFSELrs> {
DIFSEL_W::new(self, 3)
}
#[inline(always)]
pub fn difsel4(&mut self) -> DIFSEL_W<DIFSELrs> {
DIFSEL_W::new(self, 4)
}
#[inline(always)]
pub fn difsel5(&mut self) -> DIFSEL_W<DIFSELrs> {
DIFSEL_W::new(self, 5)
}
#[inline(always)]
pub fn difsel6(&mut self) -> DIFSEL_W<DIFSELrs> {
DIFSEL_W::new(self, 6)
}
#[inline(always)]
pub fn difsel7(&mut self) -> DIFSEL_W<DIFSELrs> {
DIFSEL_W::new(self, 7)
}
#[inline(always)]
pub fn difsel8(&mut self) -> DIFSEL_W<DIFSELrs> {
DIFSEL_W::new(self, 8)
}
#[inline(always)]
pub fn difsel9(&mut self) -> DIFSEL_W<DIFSELrs> {
DIFSEL_W::new(self, 9)
}
#[inline(always)]
pub fn difsel10(&mut self) -> DIFSEL_W<DIFSELrs> {
DIFSEL_W::new(self, 10)
}
#[inline(always)]
pub fn difsel11(&mut self) -> DIFSEL_W<DIFSELrs> {
DIFSEL_W::new(self, 11)
}
#[inline(always)]
pub fn difsel12(&mut self) -> DIFSEL_W<DIFSELrs> {
DIFSEL_W::new(self, 12)
}
#[inline(always)]
pub fn difsel13(&mut self) -> DIFSEL_W<DIFSELrs> {
DIFSEL_W::new(self, 13)
}
#[inline(always)]
pub fn difsel14(&mut self) -> DIFSEL_W<DIFSELrs> {
DIFSEL_W::new(self, 14)
}
#[inline(always)]
pub fn difsel15(&mut self) -> DIFSEL_W<DIFSELrs> {
DIFSEL_W::new(self, 15)
}
#[inline(always)]
pub fn difsel16(&mut self) -> DIFSEL_W<DIFSELrs> {
DIFSEL_W::new(self, 16)
}
#[inline(always)]
pub fn difsel17(&mut self) -> DIFSEL_W<DIFSELrs> {
DIFSEL_W::new(self, 17)
}
#[inline(always)]
pub fn difsel18(&mut self) -> DIFSEL_W<DIFSELrs> {
DIFSEL_W::new(self, 18)
}
}
pub struct DIFSELrs;
impl crate::RegisterSpec for DIFSELrs {
type Ux = u32;
}
impl crate::Readable for DIFSELrs {}
impl crate::Writable for DIFSELrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for DIFSELrs {}