pub type R = crate::R<CTRLrs>;
pub type W = crate::W<CTRLrs>;
pub type SevonprsR = crate::BitReader;
pub type SevonprsW<'a, REG> = crate::BitWriter<'a, REG>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum SEVONPRSSEL {
Prsch0 = 0,
Prsch1 = 1,
Prsch2 = 2,
Prsch3 = 3,
Prsch4 = 4,
Prsch5 = 5,
Prsch6 = 6,
Prsch7 = 7,
Prsch8 = 8,
Prsch9 = 9,
Prsch10 = 10,
Prsch11 = 11,
}
impl From<SEVONPRSSEL> for u8 {
#[inline(always)]
fn from(variant: SEVONPRSSEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for SEVONPRSSEL {
type Ux = u8;
}
impl crate::IsEnum for SEVONPRSSEL {}
pub type SevonprsselR = crate::FieldReader<SEVONPRSSEL>;
impl SevonprsselR {
#[inline(always)]
pub const fn variant(&self) -> Option<SEVONPRSSEL> {
match self.bits {
0 => Some(SEVONPRSSEL::Prsch0),
1 => Some(SEVONPRSSEL::Prsch1),
2 => Some(SEVONPRSSEL::Prsch2),
3 => Some(SEVONPRSSEL::Prsch3),
4 => Some(SEVONPRSSEL::Prsch4),
5 => Some(SEVONPRSSEL::Prsch5),
6 => Some(SEVONPRSSEL::Prsch6),
7 => Some(SEVONPRSSEL::Prsch7),
8 => Some(SEVONPRSSEL::Prsch8),
9 => Some(SEVONPRSSEL::Prsch9),
10 => Some(SEVONPRSSEL::Prsch10),
11 => Some(SEVONPRSSEL::Prsch11),
_ => None,
}
}
#[inline(always)]
pub fn is_prsch0(&self) -> bool {
*self == SEVONPRSSEL::Prsch0
}
#[inline(always)]
pub fn is_prsch1(&self) -> bool {
*self == SEVONPRSSEL::Prsch1
}
#[inline(always)]
pub fn is_prsch2(&self) -> bool {
*self == SEVONPRSSEL::Prsch2
}
#[inline(always)]
pub fn is_prsch3(&self) -> bool {
*self == SEVONPRSSEL::Prsch3
}
#[inline(always)]
pub fn is_prsch4(&self) -> bool {
*self == SEVONPRSSEL::Prsch4
}
#[inline(always)]
pub fn is_prsch5(&self) -> bool {
*self == SEVONPRSSEL::Prsch5
}
#[inline(always)]
pub fn is_prsch6(&self) -> bool {
*self == SEVONPRSSEL::Prsch6
}
#[inline(always)]
pub fn is_prsch7(&self) -> bool {
*self == SEVONPRSSEL::Prsch7
}
#[inline(always)]
pub fn is_prsch8(&self) -> bool {
*self == SEVONPRSSEL::Prsch8
}
#[inline(always)]
pub fn is_prsch9(&self) -> bool {
*self == SEVONPRSSEL::Prsch9
}
#[inline(always)]
pub fn is_prsch10(&self) -> bool {
*self == SEVONPRSSEL::Prsch10
}
#[inline(always)]
pub fn is_prsch11(&self) -> bool {
*self == SEVONPRSSEL::Prsch11
}
}
pub type SevonprsselW<'a, REG> = crate::FieldWriter<'a, REG, 4, SEVONPRSSEL>;
impl<'a, REG> SevonprsselW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn prsch0(self) -> &'a mut crate::W<REG> {
self.variant(SEVONPRSSEL::Prsch0)
}
#[inline(always)]
pub fn prsch1(self) -> &'a mut crate::W<REG> {
self.variant(SEVONPRSSEL::Prsch1)
}
#[inline(always)]
pub fn prsch2(self) -> &'a mut crate::W<REG> {
self.variant(SEVONPRSSEL::Prsch2)
}
#[inline(always)]
pub fn prsch3(self) -> &'a mut crate::W<REG> {
self.variant(SEVONPRSSEL::Prsch3)
}
#[inline(always)]
pub fn prsch4(self) -> &'a mut crate::W<REG> {
self.variant(SEVONPRSSEL::Prsch4)
}
#[inline(always)]
pub fn prsch5(self) -> &'a mut crate::W<REG> {
self.variant(SEVONPRSSEL::Prsch5)
}
#[inline(always)]
pub fn prsch6(self) -> &'a mut crate::W<REG> {
self.variant(SEVONPRSSEL::Prsch6)
}
#[inline(always)]
pub fn prsch7(self) -> &'a mut crate::W<REG> {
self.variant(SEVONPRSSEL::Prsch7)
}
#[inline(always)]
pub fn prsch8(self) -> &'a mut crate::W<REG> {
self.variant(SEVONPRSSEL::Prsch8)
}
#[inline(always)]
pub fn prsch9(self) -> &'a mut crate::W<REG> {
self.variant(SEVONPRSSEL::Prsch9)
}
#[inline(always)]
pub fn prsch10(self) -> &'a mut crate::W<REG> {
self.variant(SEVONPRSSEL::Prsch10)
}
#[inline(always)]
pub fn prsch11(self) -> &'a mut crate::W<REG> {
self.variant(SEVONPRSSEL::Prsch11)
}
}
impl R {
#[inline(always)]
pub fn sevonprs(&self) -> SevonprsR {
SevonprsR::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn sevonprssel(&self) -> SevonprsselR {
SevonprsselR::new(((self.bits >> 1) & 0x0f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CTRL")
.field("sevonprs", &self.sevonprs())
.field("sevonprssel", &self.sevonprssel())
.finish()
}
}
impl W {
#[inline(always)]
pub fn sevonprs(&mut self) -> SevonprsW<'_, CTRLrs> {
SevonprsW::new(self, 0)
}
#[inline(always)]
pub fn sevonprssel(&mut self) -> SevonprsselW<'_, CTRLrs> {
SevonprsselW::new(self, 1)
}
}
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 {}