pub type R = crate::R<CSELRrs>;
pub type W = crate::W<CSELRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum C1S {
NoMapping = 0,
Map1 = 1,
Map2 = 2,
Map3 = 3,
Map4 = 4,
Map5 = 5,
Map6 = 6,
Map7 = 7,
Map8 = 8,
Map9 = 9,
Map10 = 10,
Map11 = 11,
Map12 = 12,
Map13 = 13,
Map14 = 14,
Map15 = 15,
}
impl From<C1S> for u8 {
#[inline(always)]
fn from(variant: C1S) -> Self {
variant as _
}
}
impl crate::FieldSpec for C1S {
type Ux = u8;
}
impl crate::IsEnum for C1S {}
pub type C1S_R = crate::FieldReader<C1S>;
impl C1S_R {
#[inline(always)]
pub const fn variant(&self) -> C1S {
match self.bits {
0 => C1S::NoMapping,
1 => C1S::Map1,
2 => C1S::Map2,
3 => C1S::Map3,
4 => C1S::Map4,
5 => C1S::Map5,
6 => C1S::Map6,
7 => C1S::Map7,
8 => C1S::Map8,
9 => C1S::Map9,
10 => C1S::Map10,
11 => C1S::Map11,
12 => C1S::Map12,
13 => C1S::Map13,
14 => C1S::Map14,
15 => C1S::Map15,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_no_mapping(&self) -> bool {
*self == C1S::NoMapping
}
#[inline(always)]
pub fn is_map1(&self) -> bool {
*self == C1S::Map1
}
#[inline(always)]
pub fn is_map2(&self) -> bool {
*self == C1S::Map2
}
#[inline(always)]
pub fn is_map3(&self) -> bool {
*self == C1S::Map3
}
#[inline(always)]
pub fn is_map4(&self) -> bool {
*self == C1S::Map4
}
#[inline(always)]
pub fn is_map5(&self) -> bool {
*self == C1S::Map5
}
#[inline(always)]
pub fn is_map6(&self) -> bool {
*self == C1S::Map6
}
#[inline(always)]
pub fn is_map7(&self) -> bool {
*self == C1S::Map7
}
#[inline(always)]
pub fn is_map8(&self) -> bool {
*self == C1S::Map8
}
#[inline(always)]
pub fn is_map9(&self) -> bool {
*self == C1S::Map9
}
#[inline(always)]
pub fn is_map10(&self) -> bool {
*self == C1S::Map10
}
#[inline(always)]
pub fn is_map11(&self) -> bool {
*self == C1S::Map11
}
#[inline(always)]
pub fn is_map12(&self) -> bool {
*self == C1S::Map12
}
#[inline(always)]
pub fn is_map13(&self) -> bool {
*self == C1S::Map13
}
#[inline(always)]
pub fn is_map14(&self) -> bool {
*self == C1S::Map14
}
#[inline(always)]
pub fn is_map15(&self) -> bool {
*self == C1S::Map15
}
}
pub type C1S_W<'a, REG> = crate::FieldWriter<'a, REG, 4, C1S, crate::Safe>;
impl<'a, REG> C1S_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn no_mapping(self) -> &'a mut crate::W<REG> {
self.variant(C1S::NoMapping)
}
#[inline(always)]
pub fn map1(self) -> &'a mut crate::W<REG> {
self.variant(C1S::Map1)
}
#[inline(always)]
pub fn map2(self) -> &'a mut crate::W<REG> {
self.variant(C1S::Map2)
}
#[inline(always)]
pub fn map3(self) -> &'a mut crate::W<REG> {
self.variant(C1S::Map3)
}
#[inline(always)]
pub fn map4(self) -> &'a mut crate::W<REG> {
self.variant(C1S::Map4)
}
#[inline(always)]
pub fn map5(self) -> &'a mut crate::W<REG> {
self.variant(C1S::Map5)
}
#[inline(always)]
pub fn map6(self) -> &'a mut crate::W<REG> {
self.variant(C1S::Map6)
}
#[inline(always)]
pub fn map7(self) -> &'a mut crate::W<REG> {
self.variant(C1S::Map7)
}
#[inline(always)]
pub fn map8(self) -> &'a mut crate::W<REG> {
self.variant(C1S::Map8)
}
#[inline(always)]
pub fn map9(self) -> &'a mut crate::W<REG> {
self.variant(C1S::Map9)
}
#[inline(always)]
pub fn map10(self) -> &'a mut crate::W<REG> {
self.variant(C1S::Map10)
}
#[inline(always)]
pub fn map11(self) -> &'a mut crate::W<REG> {
self.variant(C1S::Map11)
}
#[inline(always)]
pub fn map12(self) -> &'a mut crate::W<REG> {
self.variant(C1S::Map12)
}
#[inline(always)]
pub fn map13(self) -> &'a mut crate::W<REG> {
self.variant(C1S::Map13)
}
#[inline(always)]
pub fn map14(self) -> &'a mut crate::W<REG> {
self.variant(C1S::Map14)
}
#[inline(always)]
pub fn map15(self) -> &'a mut crate::W<REG> {
self.variant(C1S::Map15)
}
}
pub use C1S_R as C2S_R;
pub use C1S_R as C3S_R;
pub use C1S_R as C4S_R;
pub use C1S_R as C5S_R;
pub use C1S_R as C6S_R;
pub use C1S_R as C7S_R;
pub use C1S_W as C2S_W;
pub use C1S_W as C3S_W;
pub use C1S_W as C4S_W;
pub use C1S_W as C5S_W;
pub use C1S_W as C6S_W;
pub use C1S_W as C7S_W;
impl R {
#[inline(always)]
pub fn c1s(&self) -> C1S_R {
C1S_R::new((self.bits & 0x0f) as u8)
}
#[inline(always)]
pub fn c2s(&self) -> C2S_R {
C2S_R::new(((self.bits >> 4) & 0x0f) as u8)
}
#[inline(always)]
pub fn c3s(&self) -> C3S_R {
C3S_R::new(((self.bits >> 8) & 0x0f) as u8)
}
#[inline(always)]
pub fn c4s(&self) -> C4S_R {
C4S_R::new(((self.bits >> 12) & 0x0f) as u8)
}
#[inline(always)]
pub fn c5s(&self) -> C5S_R {
C5S_R::new(((self.bits >> 16) & 0x0f) as u8)
}
#[inline(always)]
pub fn c6s(&self) -> C6S_R {
C6S_R::new(((self.bits >> 20) & 0x0f) as u8)
}
#[inline(always)]
pub fn c7s(&self) -> C7S_R {
C7S_R::new(((self.bits >> 24) & 0x0f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CSELR")
.field("c1s", &self.c1s())
.field("c7s", &self.c7s())
.field("c6s", &self.c6s())
.field("c5s", &self.c5s())
.field("c4s", &self.c4s())
.field("c3s", &self.c3s())
.field("c2s", &self.c2s())
.finish()
}
}
impl W {
#[inline(always)]
pub fn c1s(&mut self) -> C1S_W<CSELRrs> {
C1S_W::new(self, 0)
}
#[inline(always)]
pub fn c2s(&mut self) -> C2S_W<CSELRrs> {
C2S_W::new(self, 4)
}
#[inline(always)]
pub fn c3s(&mut self) -> C3S_W<CSELRrs> {
C3S_W::new(self, 8)
}
#[inline(always)]
pub fn c4s(&mut self) -> C4S_W<CSELRrs> {
C4S_W::new(self, 12)
}
#[inline(always)]
pub fn c5s(&mut self) -> C5S_W<CSELRrs> {
C5S_W::new(self, 16)
}
#[inline(always)]
pub fn c6s(&mut self) -> C6S_W<CSELRrs> {
C6S_W::new(self, 20)
}
#[inline(always)]
pub fn c7s(&mut self) -> C7S_W<CSELRrs> {
C7S_W::new(self, 24)
}
}
pub struct CSELRrs;
impl crate::RegisterSpec for CSELRrs {
type Ux = u32;
}
impl crate::Readable for CSELRrs {}
impl crate::Writable for CSELRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CSELRrs {}