#[doc = "Register `CBCTL0` reader"]
pub type R = crate::R<Cbctl0Spec>;
#[doc = "Register `CBCTL0` writer"]
pub type W = crate::W<Cbctl0Spec>;
#[doc = "Comp. B Pos. Channel Input Select 0\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Cbipsel {
#[doc = "0: Comp. B V+ terminal Input Select: Channel 0"]
Cbipsel0 = 0,
#[doc = "1: Comp. B V+ terminal Input Select: Channel 1"]
Cbipsel1 = 1,
#[doc = "2: Comp. B V+ terminal Input Select: Channel 2"]
Cbipsel2 = 2,
#[doc = "3: Comp. B V+ terminal Input Select: Channel 3"]
Cbipsel3 = 3,
#[doc = "4: Comp. B V+ terminal Input Select: Channel 4"]
Cbipsel4 = 4,
#[doc = "5: Comp. B V+ terminal Input Select: Channel 5"]
Cbipsel5 = 5,
#[doc = "6: Comp. B V+ terminal Input Select: Channel 6"]
Cbipsel6 = 6,
#[doc = "7: Comp. B V+ terminal Input Select: Channel 7"]
Cbipsel7 = 7,
#[doc = "8: Comp. B V+ terminal Input Select: Channel 8"]
Cbipsel8 = 8,
#[doc = "9: Comp. B V+ terminal Input Select: Channel 9"]
Cbipsel9 = 9,
#[doc = "10: Comp. B V+ terminal Input Select: Channel 10"]
Cbipsel10 = 10,
#[doc = "11: Comp. B V+ terminal Input Select: Channel 11"]
Cbipsel11 = 11,
#[doc = "12: Comp. B V+ terminal Input Select: Channel 12"]
Cbipsel12 = 12,
#[doc = "13: Comp. B V+ terminal Input Select: Channel 13"]
Cbipsel13 = 13,
#[doc = "14: Comp. B V+ terminal Input Select: Channel 14"]
Cbipsel14 = 14,
#[doc = "15: Comp. B V+ terminal Input Select: Channel 15"]
Cbipsel15 = 15,
}
impl From<Cbipsel> for u8 {
#[inline(always)]
fn from(variant: Cbipsel) -> Self {
variant as _
}
}
impl crate::FieldSpec for Cbipsel {
type Ux = u8;
}
impl crate::IsEnum for Cbipsel {}
#[doc = "Field `CBIPSEL` reader - Comp. B Pos. Channel Input Select 0"]
pub type CbipselR = crate::FieldReader<Cbipsel>;
impl CbipselR {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub const fn variant(&self) -> Cbipsel {
match self.bits {
0 => Cbipsel::Cbipsel0,
1 => Cbipsel::Cbipsel1,
2 => Cbipsel::Cbipsel2,
3 => Cbipsel::Cbipsel3,
4 => Cbipsel::Cbipsel4,
5 => Cbipsel::Cbipsel5,
6 => Cbipsel::Cbipsel6,
7 => Cbipsel::Cbipsel7,
8 => Cbipsel::Cbipsel8,
9 => Cbipsel::Cbipsel9,
10 => Cbipsel::Cbipsel10,
11 => Cbipsel::Cbipsel11,
12 => Cbipsel::Cbipsel12,
13 => Cbipsel::Cbipsel13,
14 => Cbipsel::Cbipsel14,
15 => Cbipsel::Cbipsel15,
_ => unreachable!(),
}
}
#[doc = "Comp. B V+ terminal Input Select: Channel 0"]
#[inline(always)]
pub fn is_cbipsel_0(&self) -> bool {
*self == Cbipsel::Cbipsel0
}
#[doc = "Comp. B V+ terminal Input Select: Channel 1"]
#[inline(always)]
pub fn is_cbipsel_1(&self) -> bool {
*self == Cbipsel::Cbipsel1
}
#[doc = "Comp. B V+ terminal Input Select: Channel 2"]
#[inline(always)]
pub fn is_cbipsel_2(&self) -> bool {
*self == Cbipsel::Cbipsel2
}
#[doc = "Comp. B V+ terminal Input Select: Channel 3"]
#[inline(always)]
pub fn is_cbipsel_3(&self) -> bool {
*self == Cbipsel::Cbipsel3
}
#[doc = "Comp. B V+ terminal Input Select: Channel 4"]
#[inline(always)]
pub fn is_cbipsel_4(&self) -> bool {
*self == Cbipsel::Cbipsel4
}
#[doc = "Comp. B V+ terminal Input Select: Channel 5"]
#[inline(always)]
pub fn is_cbipsel_5(&self) -> bool {
*self == Cbipsel::Cbipsel5
}
#[doc = "Comp. B V+ terminal Input Select: Channel 6"]
#[inline(always)]
pub fn is_cbipsel_6(&self) -> bool {
*self == Cbipsel::Cbipsel6
}
#[doc = "Comp. B V+ terminal Input Select: Channel 7"]
#[inline(always)]
pub fn is_cbipsel_7(&self) -> bool {
*self == Cbipsel::Cbipsel7
}
#[doc = "Comp. B V+ terminal Input Select: Channel 8"]
#[inline(always)]
pub fn is_cbipsel_8(&self) -> bool {
*self == Cbipsel::Cbipsel8
}
#[doc = "Comp. B V+ terminal Input Select: Channel 9"]
#[inline(always)]
pub fn is_cbipsel_9(&self) -> bool {
*self == Cbipsel::Cbipsel9
}
#[doc = "Comp. B V+ terminal Input Select: Channel 10"]
#[inline(always)]
pub fn is_cbipsel_10(&self) -> bool {
*self == Cbipsel::Cbipsel10
}
#[doc = "Comp. B V+ terminal Input Select: Channel 11"]
#[inline(always)]
pub fn is_cbipsel_11(&self) -> bool {
*self == Cbipsel::Cbipsel11
}
#[doc = "Comp. B V+ terminal Input Select: Channel 12"]
#[inline(always)]
pub fn is_cbipsel_12(&self) -> bool {
*self == Cbipsel::Cbipsel12
}
#[doc = "Comp. B V+ terminal Input Select: Channel 13"]
#[inline(always)]
pub fn is_cbipsel_13(&self) -> bool {
*self == Cbipsel::Cbipsel13
}
#[doc = "Comp. B V+ terminal Input Select: Channel 14"]
#[inline(always)]
pub fn is_cbipsel_14(&self) -> bool {
*self == Cbipsel::Cbipsel14
}
#[doc = "Comp. B V+ terminal Input Select: Channel 15"]
#[inline(always)]
pub fn is_cbipsel_15(&self) -> bool {
*self == Cbipsel::Cbipsel15
}
}
#[doc = "Field `CBIPSEL` writer - Comp. B Pos. Channel Input Select 0"]
pub type CbipselW<'a, REG> = crate::FieldWriter<'a, REG, 4, Cbipsel, crate::Safe>;
impl<'a, REG> CbipselW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[doc = "Comp. B V+ terminal Input Select: Channel 0"]
#[inline(always)]
pub fn cbipsel_0(self) -> &'a mut crate::W<REG> {
self.variant(Cbipsel::Cbipsel0)
}
#[doc = "Comp. B V+ terminal Input Select: Channel 1"]
#[inline(always)]
pub fn cbipsel_1(self) -> &'a mut crate::W<REG> {
self.variant(Cbipsel::Cbipsel1)
}
#[doc = "Comp. B V+ terminal Input Select: Channel 2"]
#[inline(always)]
pub fn cbipsel_2(self) -> &'a mut crate::W<REG> {
self.variant(Cbipsel::Cbipsel2)
}
#[doc = "Comp. B V+ terminal Input Select: Channel 3"]
#[inline(always)]
pub fn cbipsel_3(self) -> &'a mut crate::W<REG> {
self.variant(Cbipsel::Cbipsel3)
}
#[doc = "Comp. B V+ terminal Input Select: Channel 4"]
#[inline(always)]
pub fn cbipsel_4(self) -> &'a mut crate::W<REG> {
self.variant(Cbipsel::Cbipsel4)
}
#[doc = "Comp. B V+ terminal Input Select: Channel 5"]
#[inline(always)]
pub fn cbipsel_5(self) -> &'a mut crate::W<REG> {
self.variant(Cbipsel::Cbipsel5)
}
#[doc = "Comp. B V+ terminal Input Select: Channel 6"]
#[inline(always)]
pub fn cbipsel_6(self) -> &'a mut crate::W<REG> {
self.variant(Cbipsel::Cbipsel6)
}
#[doc = "Comp. B V+ terminal Input Select: Channel 7"]
#[inline(always)]
pub fn cbipsel_7(self) -> &'a mut crate::W<REG> {
self.variant(Cbipsel::Cbipsel7)
}
#[doc = "Comp. B V+ terminal Input Select: Channel 8"]
#[inline(always)]
pub fn cbipsel_8(self) -> &'a mut crate::W<REG> {
self.variant(Cbipsel::Cbipsel8)
}
#[doc = "Comp. B V+ terminal Input Select: Channel 9"]
#[inline(always)]
pub fn cbipsel_9(self) -> &'a mut crate::W<REG> {
self.variant(Cbipsel::Cbipsel9)
}
#[doc = "Comp. B V+ terminal Input Select: Channel 10"]
#[inline(always)]
pub fn cbipsel_10(self) -> &'a mut crate::W<REG> {
self.variant(Cbipsel::Cbipsel10)
}
#[doc = "Comp. B V+ terminal Input Select: Channel 11"]
#[inline(always)]
pub fn cbipsel_11(self) -> &'a mut crate::W<REG> {
self.variant(Cbipsel::Cbipsel11)
}
#[doc = "Comp. B V+ terminal Input Select: Channel 12"]
#[inline(always)]
pub fn cbipsel_12(self) -> &'a mut crate::W<REG> {
self.variant(Cbipsel::Cbipsel12)
}
#[doc = "Comp. B V+ terminal Input Select: Channel 13"]
#[inline(always)]
pub fn cbipsel_13(self) -> &'a mut crate::W<REG> {
self.variant(Cbipsel::Cbipsel13)
}
#[doc = "Comp. B V+ terminal Input Select: Channel 14"]
#[inline(always)]
pub fn cbipsel_14(self) -> &'a mut crate::W<REG> {
self.variant(Cbipsel::Cbipsel14)
}
#[doc = "Comp. B V+ terminal Input Select: Channel 15"]
#[inline(always)]
pub fn cbipsel_15(self) -> &'a mut crate::W<REG> {
self.variant(Cbipsel::Cbipsel15)
}
}
#[doc = "Field `CBIPEN` reader - Comp. B Pos. Channel Input Enable"]
pub type CbipenR = crate::BitReader;
#[doc = "Field `CBIPEN` writer - Comp. B Pos. Channel Input Enable"]
pub type CbipenW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Comp. B Neg. Channel Input Select 0\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Cbimsel {
#[doc = "0: Comp. B V- Terminal Input Select: Channel 0"]
Cbimsel0 = 0,
#[doc = "1: Comp. B V- Terminal Input Select: Channel 1"]
Cbimsel1 = 1,
#[doc = "2: Comp. B V- Terminal Input Select: Channel 2"]
Cbimsel2 = 2,
#[doc = "3: Comp. B V- Terminal Input Select: Channel 3"]
Cbimsel3 = 3,
#[doc = "4: Comp. B V- Terminal Input Select: Channel 4"]
Cbimsel4 = 4,
#[doc = "5: Comp. B V- Terminal Input Select: Channel 5"]
Cbimsel5 = 5,
#[doc = "6: Comp. B V- Terminal Input Select: Channel 6"]
Cbimsel6 = 6,
#[doc = "7: Comp. B V- Terminal Input Select: Channel 7"]
Cbimsel7 = 7,
#[doc = "8: Comp. B V- terminal Input Select: Channel 8"]
Cbimsel8 = 8,
#[doc = "9: Comp. B V- terminal Input Select: Channel 9"]
Cbimsel9 = 9,
#[doc = "10: Comp. B V- terminal Input Select: Channel 10"]
Cbimsel10 = 10,
#[doc = "11: Comp. B V- terminal Input Select: Channel 11"]
Cbimsel11 = 11,
#[doc = "12: Comp. B V- terminal Input Select: Channel 12"]
Cbimsel12 = 12,
#[doc = "13: Comp. B V- terminal Input Select: Channel 13"]
Cbimsel13 = 13,
#[doc = "14: Comp. B V- terminal Input Select: Channel 14"]
Cbimsel14 = 14,
#[doc = "15: Comp. B V- terminal Input Select: Channel 15"]
Cbimsel15 = 15,
}
impl From<Cbimsel> for u8 {
#[inline(always)]
fn from(variant: Cbimsel) -> Self {
variant as _
}
}
impl crate::FieldSpec for Cbimsel {
type Ux = u8;
}
impl crate::IsEnum for Cbimsel {}
#[doc = "Field `CBIMSEL` reader - Comp. B Neg. Channel Input Select 0"]
pub type CbimselR = crate::FieldReader<Cbimsel>;
impl CbimselR {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub const fn variant(&self) -> Cbimsel {
match self.bits {
0 => Cbimsel::Cbimsel0,
1 => Cbimsel::Cbimsel1,
2 => Cbimsel::Cbimsel2,
3 => Cbimsel::Cbimsel3,
4 => Cbimsel::Cbimsel4,
5 => Cbimsel::Cbimsel5,
6 => Cbimsel::Cbimsel6,
7 => Cbimsel::Cbimsel7,
8 => Cbimsel::Cbimsel8,
9 => Cbimsel::Cbimsel9,
10 => Cbimsel::Cbimsel10,
11 => Cbimsel::Cbimsel11,
12 => Cbimsel::Cbimsel12,
13 => Cbimsel::Cbimsel13,
14 => Cbimsel::Cbimsel14,
15 => Cbimsel::Cbimsel15,
_ => unreachable!(),
}
}
#[doc = "Comp. B V- Terminal Input Select: Channel 0"]
#[inline(always)]
pub fn is_cbimsel_0(&self) -> bool {
*self == Cbimsel::Cbimsel0
}
#[doc = "Comp. B V- Terminal Input Select: Channel 1"]
#[inline(always)]
pub fn is_cbimsel_1(&self) -> bool {
*self == Cbimsel::Cbimsel1
}
#[doc = "Comp. B V- Terminal Input Select: Channel 2"]
#[inline(always)]
pub fn is_cbimsel_2(&self) -> bool {
*self == Cbimsel::Cbimsel2
}
#[doc = "Comp. B V- Terminal Input Select: Channel 3"]
#[inline(always)]
pub fn is_cbimsel_3(&self) -> bool {
*self == Cbimsel::Cbimsel3
}
#[doc = "Comp. B V- Terminal Input Select: Channel 4"]
#[inline(always)]
pub fn is_cbimsel_4(&self) -> bool {
*self == Cbimsel::Cbimsel4
}
#[doc = "Comp. B V- Terminal Input Select: Channel 5"]
#[inline(always)]
pub fn is_cbimsel_5(&self) -> bool {
*self == Cbimsel::Cbimsel5
}
#[doc = "Comp. B V- Terminal Input Select: Channel 6"]
#[inline(always)]
pub fn is_cbimsel_6(&self) -> bool {
*self == Cbimsel::Cbimsel6
}
#[doc = "Comp. B V- Terminal Input Select: Channel 7"]
#[inline(always)]
pub fn is_cbimsel_7(&self) -> bool {
*self == Cbimsel::Cbimsel7
}
#[doc = "Comp. B V- terminal Input Select: Channel 8"]
#[inline(always)]
pub fn is_cbimsel_8(&self) -> bool {
*self == Cbimsel::Cbimsel8
}
#[doc = "Comp. B V- terminal Input Select: Channel 9"]
#[inline(always)]
pub fn is_cbimsel_9(&self) -> bool {
*self == Cbimsel::Cbimsel9
}
#[doc = "Comp. B V- terminal Input Select: Channel 10"]
#[inline(always)]
pub fn is_cbimsel_10(&self) -> bool {
*self == Cbimsel::Cbimsel10
}
#[doc = "Comp. B V- terminal Input Select: Channel 11"]
#[inline(always)]
pub fn is_cbimsel_11(&self) -> bool {
*self == Cbimsel::Cbimsel11
}
#[doc = "Comp. B V- terminal Input Select: Channel 12"]
#[inline(always)]
pub fn is_cbimsel_12(&self) -> bool {
*self == Cbimsel::Cbimsel12
}
#[doc = "Comp. B V- terminal Input Select: Channel 13"]
#[inline(always)]
pub fn is_cbimsel_13(&self) -> bool {
*self == Cbimsel::Cbimsel13
}
#[doc = "Comp. B V- terminal Input Select: Channel 14"]
#[inline(always)]
pub fn is_cbimsel_14(&self) -> bool {
*self == Cbimsel::Cbimsel14
}
#[doc = "Comp. B V- terminal Input Select: Channel 15"]
#[inline(always)]
pub fn is_cbimsel_15(&self) -> bool {
*self == Cbimsel::Cbimsel15
}
}
#[doc = "Field `CBIMSEL` writer - Comp. B Neg. Channel Input Select 0"]
pub type CbimselW<'a, REG> = crate::FieldWriter<'a, REG, 4, Cbimsel, crate::Safe>;
impl<'a, REG> CbimselW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[doc = "Comp. B V- Terminal Input Select: Channel 0"]
#[inline(always)]
pub fn cbimsel_0(self) -> &'a mut crate::W<REG> {
self.variant(Cbimsel::Cbimsel0)
}
#[doc = "Comp. B V- Terminal Input Select: Channel 1"]
#[inline(always)]
pub fn cbimsel_1(self) -> &'a mut crate::W<REG> {
self.variant(Cbimsel::Cbimsel1)
}
#[doc = "Comp. B V- Terminal Input Select: Channel 2"]
#[inline(always)]
pub fn cbimsel_2(self) -> &'a mut crate::W<REG> {
self.variant(Cbimsel::Cbimsel2)
}
#[doc = "Comp. B V- Terminal Input Select: Channel 3"]
#[inline(always)]
pub fn cbimsel_3(self) -> &'a mut crate::W<REG> {
self.variant(Cbimsel::Cbimsel3)
}
#[doc = "Comp. B V- Terminal Input Select: Channel 4"]
#[inline(always)]
pub fn cbimsel_4(self) -> &'a mut crate::W<REG> {
self.variant(Cbimsel::Cbimsel4)
}
#[doc = "Comp. B V- Terminal Input Select: Channel 5"]
#[inline(always)]
pub fn cbimsel_5(self) -> &'a mut crate::W<REG> {
self.variant(Cbimsel::Cbimsel5)
}
#[doc = "Comp. B V- Terminal Input Select: Channel 6"]
#[inline(always)]
pub fn cbimsel_6(self) -> &'a mut crate::W<REG> {
self.variant(Cbimsel::Cbimsel6)
}
#[doc = "Comp. B V- Terminal Input Select: Channel 7"]
#[inline(always)]
pub fn cbimsel_7(self) -> &'a mut crate::W<REG> {
self.variant(Cbimsel::Cbimsel7)
}
#[doc = "Comp. B V- terminal Input Select: Channel 8"]
#[inline(always)]
pub fn cbimsel_8(self) -> &'a mut crate::W<REG> {
self.variant(Cbimsel::Cbimsel8)
}
#[doc = "Comp. B V- terminal Input Select: Channel 9"]
#[inline(always)]
pub fn cbimsel_9(self) -> &'a mut crate::W<REG> {
self.variant(Cbimsel::Cbimsel9)
}
#[doc = "Comp. B V- terminal Input Select: Channel 10"]
#[inline(always)]
pub fn cbimsel_10(self) -> &'a mut crate::W<REG> {
self.variant(Cbimsel::Cbimsel10)
}
#[doc = "Comp. B V- terminal Input Select: Channel 11"]
#[inline(always)]
pub fn cbimsel_11(self) -> &'a mut crate::W<REG> {
self.variant(Cbimsel::Cbimsel11)
}
#[doc = "Comp. B V- terminal Input Select: Channel 12"]
#[inline(always)]
pub fn cbimsel_12(self) -> &'a mut crate::W<REG> {
self.variant(Cbimsel::Cbimsel12)
}
#[doc = "Comp. B V- terminal Input Select: Channel 13"]
#[inline(always)]
pub fn cbimsel_13(self) -> &'a mut crate::W<REG> {
self.variant(Cbimsel::Cbimsel13)
}
#[doc = "Comp. B V- terminal Input Select: Channel 14"]
#[inline(always)]
pub fn cbimsel_14(self) -> &'a mut crate::W<REG> {
self.variant(Cbimsel::Cbimsel14)
}
#[doc = "Comp. B V- terminal Input Select: Channel 15"]
#[inline(always)]
pub fn cbimsel_15(self) -> &'a mut crate::W<REG> {
self.variant(Cbimsel::Cbimsel15)
}
}
#[doc = "Field `CBIMEN` reader - Comp. B Neg. Channel Input Enable"]
pub type CbimenR = crate::BitReader;
#[doc = "Field `CBIMEN` writer - Comp. B Neg. Channel Input Enable"]
pub type CbimenW<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[doc = "Bits 0:3 - Comp. B Pos. Channel Input Select 0"]
#[inline(always)]
pub fn cbipsel(&self) -> CbipselR {
CbipselR::new((self.bits & 0x0f) as u8)
}
#[doc = "Bit 7 - Comp. B Pos. Channel Input Enable"]
#[inline(always)]
pub fn cbipen(&self) -> CbipenR {
CbipenR::new(((self.bits >> 7) & 1) != 0)
}
#[doc = "Bits 8:11 - Comp. B Neg. Channel Input Select 0"]
#[inline(always)]
pub fn cbimsel(&self) -> CbimselR {
CbimselR::new(((self.bits >> 8) & 0x0f) as u8)
}
#[doc = "Bit 15 - Comp. B Neg. Channel Input Enable"]
#[inline(always)]
pub fn cbimen(&self) -> CbimenR {
CbimenR::new(((self.bits >> 15) & 1) != 0)
}
}
impl W {
#[doc = "Bits 0:3 - Comp. B Pos. Channel Input Select 0"]
#[inline(always)]
pub fn cbipsel(&mut self) -> CbipselW<'_, Cbctl0Spec> {
CbipselW::new(self, 0)
}
#[doc = "Bit 7 - Comp. B Pos. Channel Input Enable"]
#[inline(always)]
pub fn cbipen(&mut self) -> CbipenW<'_, Cbctl0Spec> {
CbipenW::new(self, 7)
}
#[doc = "Bits 8:11 - Comp. B Neg. Channel Input Select 0"]
#[inline(always)]
pub fn cbimsel(&mut self) -> CbimselW<'_, Cbctl0Spec> {
CbimselW::new(self, 8)
}
#[doc = "Bit 15 - Comp. B Neg. Channel Input Enable"]
#[inline(always)]
pub fn cbimen(&mut self) -> CbimenW<'_, Cbctl0Spec> {
CbimenW::new(self, 15)
}
}
#[doc = "Comparator B Control Register 0\n\nYou can [`read`](crate::Reg::read) this register and get [`cbctl0::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cbctl0::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct Cbctl0Spec;
impl crate::RegisterSpec for Cbctl0Spec {
type Ux = u16;
}
#[doc = "`read()` method returns [`cbctl0::R`](R) reader structure"]
impl crate::Readable for Cbctl0Spec {}
#[doc = "`write(|w| ..)` method takes [`cbctl0::W`](W) writer structure"]
impl crate::Writable for Cbctl0Spec {
type Safety = crate::Unsafe;
}
#[doc = "`reset()` method sets CBCTL0 to value 0"]
impl crate::Resettable for Cbctl0Spec {}