pub type R = crate::R<CHSELR1rs>;
pub type W = crate::W<CHSELR1rs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum SQ1 {
Ch0 = 0,
Ch1 = 1,
Ch2 = 2,
Ch3 = 3,
Ch4 = 4,
Ch5 = 5,
Ch6 = 6,
Ch7 = 7,
Ch8 = 8,
Ch9 = 9,
Ch10 = 10,
Ch11 = 11,
Ch12 = 12,
Ch13 = 13,
Ch14 = 14,
Eos = 15,
}
impl From<SQ1> for u8 {
#[inline(always)]
fn from(variant: SQ1) -> Self {
variant as _
}
}
impl crate::FieldSpec for SQ1 {
type Ux = u8;
}
impl crate::IsEnum for SQ1 {}
pub type SQ_R = crate::FieldReader<SQ1>;
impl SQ_R {
#[inline(always)]
pub const fn variant(&self) -> SQ1 {
match self.bits {
0 => SQ1::Ch0,
1 => SQ1::Ch1,
2 => SQ1::Ch2,
3 => SQ1::Ch3,
4 => SQ1::Ch4,
5 => SQ1::Ch5,
6 => SQ1::Ch6,
7 => SQ1::Ch7,
8 => SQ1::Ch8,
9 => SQ1::Ch9,
10 => SQ1::Ch10,
11 => SQ1::Ch11,
12 => SQ1::Ch12,
13 => SQ1::Ch13,
14 => SQ1::Ch14,
15 => SQ1::Eos,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_ch0(&self) -> bool {
*self == SQ1::Ch0
}
#[inline(always)]
pub fn is_ch1(&self) -> bool {
*self == SQ1::Ch1
}
#[inline(always)]
pub fn is_ch2(&self) -> bool {
*self == SQ1::Ch2
}
#[inline(always)]
pub fn is_ch3(&self) -> bool {
*self == SQ1::Ch3
}
#[inline(always)]
pub fn is_ch4(&self) -> bool {
*self == SQ1::Ch4
}
#[inline(always)]
pub fn is_ch5(&self) -> bool {
*self == SQ1::Ch5
}
#[inline(always)]
pub fn is_ch6(&self) -> bool {
*self == SQ1::Ch6
}
#[inline(always)]
pub fn is_ch7(&self) -> bool {
*self == SQ1::Ch7
}
#[inline(always)]
pub fn is_ch8(&self) -> bool {
*self == SQ1::Ch8
}
#[inline(always)]
pub fn is_ch9(&self) -> bool {
*self == SQ1::Ch9
}
#[inline(always)]
pub fn is_ch10(&self) -> bool {
*self == SQ1::Ch10
}
#[inline(always)]
pub fn is_ch11(&self) -> bool {
*self == SQ1::Ch11
}
#[inline(always)]
pub fn is_ch12(&self) -> bool {
*self == SQ1::Ch12
}
#[inline(always)]
pub fn is_ch13(&self) -> bool {
*self == SQ1::Ch13
}
#[inline(always)]
pub fn is_ch14(&self) -> bool {
*self == SQ1::Ch14
}
#[inline(always)]
pub fn is_eos(&self) -> bool {
*self == SQ1::Eos
}
}
pub type SQ_W<'a, REG> = crate::FieldWriter<'a, REG, 4, SQ1, crate::Safe>;
impl<'a, REG> SQ_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn ch0(self) -> &'a mut crate::W<REG> {
self.variant(SQ1::Ch0)
}
#[inline(always)]
pub fn ch1(self) -> &'a mut crate::W<REG> {
self.variant(SQ1::Ch1)
}
#[inline(always)]
pub fn ch2(self) -> &'a mut crate::W<REG> {
self.variant(SQ1::Ch2)
}
#[inline(always)]
pub fn ch3(self) -> &'a mut crate::W<REG> {
self.variant(SQ1::Ch3)
}
#[inline(always)]
pub fn ch4(self) -> &'a mut crate::W<REG> {
self.variant(SQ1::Ch4)
}
#[inline(always)]
pub fn ch5(self) -> &'a mut crate::W<REG> {
self.variant(SQ1::Ch5)
}
#[inline(always)]
pub fn ch6(self) -> &'a mut crate::W<REG> {
self.variant(SQ1::Ch6)
}
#[inline(always)]
pub fn ch7(self) -> &'a mut crate::W<REG> {
self.variant(SQ1::Ch7)
}
#[inline(always)]
pub fn ch8(self) -> &'a mut crate::W<REG> {
self.variant(SQ1::Ch8)
}
#[inline(always)]
pub fn ch9(self) -> &'a mut crate::W<REG> {
self.variant(SQ1::Ch9)
}
#[inline(always)]
pub fn ch10(self) -> &'a mut crate::W<REG> {
self.variant(SQ1::Ch10)
}
#[inline(always)]
pub fn ch11(self) -> &'a mut crate::W<REG> {
self.variant(SQ1::Ch11)
}
#[inline(always)]
pub fn ch12(self) -> &'a mut crate::W<REG> {
self.variant(SQ1::Ch12)
}
#[inline(always)]
pub fn ch13(self) -> &'a mut crate::W<REG> {
self.variant(SQ1::Ch13)
}
#[inline(always)]
pub fn ch14(self) -> &'a mut crate::W<REG> {
self.variant(SQ1::Ch14)
}
#[inline(always)]
pub fn eos(self) -> &'a mut crate::W<REG> {
self.variant(SQ1::Eos)
}
}
impl R {
#[inline(always)]
pub fn sq(&self, n: u8) -> SQ_R {
#[allow(clippy::no_effect)]
[(); 8][n as usize];
SQ_R::new(((self.bits >> (n * 4)) & 0x0f) as u8)
}
#[inline(always)]
pub fn sq_iter(&self) -> impl Iterator<Item = SQ_R> + '_ {
(0..8).map(move |n| SQ_R::new(((self.bits >> (n * 4)) & 0x0f) as u8))
}
#[inline(always)]
pub fn sq1(&self) -> SQ_R {
SQ_R::new((self.bits & 0x0f) as u8)
}
#[inline(always)]
pub fn sq2(&self) -> SQ_R {
SQ_R::new(((self.bits >> 4) & 0x0f) as u8)
}
#[inline(always)]
pub fn sq3(&self) -> SQ_R {
SQ_R::new(((self.bits >> 8) & 0x0f) as u8)
}
#[inline(always)]
pub fn sq4(&self) -> SQ_R {
SQ_R::new(((self.bits >> 12) & 0x0f) as u8)
}
#[inline(always)]
pub fn sq5(&self) -> SQ_R {
SQ_R::new(((self.bits >> 16) & 0x0f) as u8)
}
#[inline(always)]
pub fn sq6(&self) -> SQ_R {
SQ_R::new(((self.bits >> 20) & 0x0f) as u8)
}
#[inline(always)]
pub fn sq7(&self) -> SQ_R {
SQ_R::new(((self.bits >> 24) & 0x0f) as u8)
}
#[inline(always)]
pub fn sq8(&self) -> SQ_R {
SQ_R::new(((self.bits >> 28) & 0x0f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CHSELR1")
.field("sq1", &self.sq1())
.field("sq2", &self.sq2())
.field("sq3", &self.sq3())
.field("sq4", &self.sq4())
.field("sq5", &self.sq5())
.field("sq6", &self.sq6())
.field("sq7", &self.sq7())
.field("sq8", &self.sq8())
.finish()
}
}
impl W {
#[inline(always)]
pub fn sq(&mut self, n: u8) -> SQ_W<CHSELR1rs> {
#[allow(clippy::no_effect)]
[(); 8][n as usize];
SQ_W::new(self, n * 4)
}
#[inline(always)]
pub fn sq1(&mut self) -> SQ_W<CHSELR1rs> {
SQ_W::new(self, 0)
}
#[inline(always)]
pub fn sq2(&mut self) -> SQ_W<CHSELR1rs> {
SQ_W::new(self, 4)
}
#[inline(always)]
pub fn sq3(&mut self) -> SQ_W<CHSELR1rs> {
SQ_W::new(self, 8)
}
#[inline(always)]
pub fn sq4(&mut self) -> SQ_W<CHSELR1rs> {
SQ_W::new(self, 12)
}
#[inline(always)]
pub fn sq5(&mut self) -> SQ_W<CHSELR1rs> {
SQ_W::new(self, 16)
}
#[inline(always)]
pub fn sq6(&mut self) -> SQ_W<CHSELR1rs> {
SQ_W::new(self, 20)
}
#[inline(always)]
pub fn sq7(&mut self) -> SQ_W<CHSELR1rs> {
SQ_W::new(self, 24)
}
#[inline(always)]
pub fn sq8(&mut self) -> SQ_W<CHSELR1rs> {
SQ_W::new(self, 28)
}
}
pub struct CHSELR1rs;
impl crate::RegisterSpec for CHSELR1rs {
type Ux = u32;
}
impl crate::Readable for CHSELR1rs {}
impl crate::Writable for CHSELR1rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CHSELR1rs {}