#[doc = "Register `UCSCTL4` reader"]
pub type R = crate::R<Ucsctl4Spec>;
#[doc = "Register `UCSCTL4` writer"]
pub type W = crate::W<Ucsctl4Spec>;
#[doc = "MCLK Source Select Bit: 0\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Selm {
#[doc = "0: MCLK Source Select 0"]
Selm0 = 0,
#[doc = "1: MCLK Source Select 1"]
Selm1 = 1,
#[doc = "2: MCLK Source Select 2"]
Selm2 = 2,
#[doc = "3: MCLK Source Select 3"]
Selm3 = 3,
#[doc = "4: MCLK Source Select 4"]
Selm4 = 4,
#[doc = "5: MCLK Source Select 5"]
Selm5 = 5,
#[doc = "6: MCLK Source Select 6"]
Selm6 = 6,
#[doc = "7: MCLK Source Select 7"]
Selm7 = 7,
}
impl From<Selm> for u8 {
#[inline(always)]
fn from(variant: Selm) -> Self {
variant as _
}
}
impl crate::FieldSpec for Selm {
type Ux = u8;
}
impl crate::IsEnum for Selm {}
#[doc = "Field `SELM` reader - MCLK Source Select Bit: 0"]
pub type SelmR = crate::FieldReader<Selm>;
impl SelmR {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub const fn variant(&self) -> Selm {
match self.bits {
0 => Selm::Selm0,
1 => Selm::Selm1,
2 => Selm::Selm2,
3 => Selm::Selm3,
4 => Selm::Selm4,
5 => Selm::Selm5,
6 => Selm::Selm6,
7 => Selm::Selm7,
_ => unreachable!(),
}
}
#[doc = "MCLK Source Select 0"]
#[inline(always)]
pub fn is_selm_0(&self) -> bool {
*self == Selm::Selm0
}
#[doc = "MCLK Source Select 1"]
#[inline(always)]
pub fn is_selm_1(&self) -> bool {
*self == Selm::Selm1
}
#[doc = "MCLK Source Select 2"]
#[inline(always)]
pub fn is_selm_2(&self) -> bool {
*self == Selm::Selm2
}
#[doc = "MCLK Source Select 3"]
#[inline(always)]
pub fn is_selm_3(&self) -> bool {
*self == Selm::Selm3
}
#[doc = "MCLK Source Select 4"]
#[inline(always)]
pub fn is_selm_4(&self) -> bool {
*self == Selm::Selm4
}
#[doc = "MCLK Source Select 5"]
#[inline(always)]
pub fn is_selm_5(&self) -> bool {
*self == Selm::Selm5
}
#[doc = "MCLK Source Select 6"]
#[inline(always)]
pub fn is_selm_6(&self) -> bool {
*self == Selm::Selm6
}
#[doc = "MCLK Source Select 7"]
#[inline(always)]
pub fn is_selm_7(&self) -> bool {
*self == Selm::Selm7
}
}
#[doc = "Field `SELM` writer - MCLK Source Select Bit: 0"]
pub type SelmW<'a, REG> = crate::FieldWriter<'a, REG, 3, Selm, crate::Safe>;
impl<'a, REG> SelmW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[doc = "MCLK Source Select 0"]
#[inline(always)]
pub fn selm_0(self) -> &'a mut crate::W<REG> {
self.variant(Selm::Selm0)
}
#[doc = "MCLK Source Select 1"]
#[inline(always)]
pub fn selm_1(self) -> &'a mut crate::W<REG> {
self.variant(Selm::Selm1)
}
#[doc = "MCLK Source Select 2"]
#[inline(always)]
pub fn selm_2(self) -> &'a mut crate::W<REG> {
self.variant(Selm::Selm2)
}
#[doc = "MCLK Source Select 3"]
#[inline(always)]
pub fn selm_3(self) -> &'a mut crate::W<REG> {
self.variant(Selm::Selm3)
}
#[doc = "MCLK Source Select 4"]
#[inline(always)]
pub fn selm_4(self) -> &'a mut crate::W<REG> {
self.variant(Selm::Selm4)
}
#[doc = "MCLK Source Select 5"]
#[inline(always)]
pub fn selm_5(self) -> &'a mut crate::W<REG> {
self.variant(Selm::Selm5)
}
#[doc = "MCLK Source Select 6"]
#[inline(always)]
pub fn selm_6(self) -> &'a mut crate::W<REG> {
self.variant(Selm::Selm6)
}
#[doc = "MCLK Source Select 7"]
#[inline(always)]
pub fn selm_7(self) -> &'a mut crate::W<REG> {
self.variant(Selm::Selm7)
}
}
#[doc = "SMCLK Source Select Bit: 0\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Sels {
#[doc = "0: SMCLK Source Select 0"]
Sels0 = 0,
#[doc = "1: SMCLK Source Select 1"]
Sels1 = 1,
#[doc = "2: SMCLK Source Select 2"]
Sels2 = 2,
#[doc = "3: SMCLK Source Select 3"]
Sels3 = 3,
#[doc = "4: SMCLK Source Select 4"]
Sels4 = 4,
#[doc = "5: SMCLK Source Select 5"]
Sels5 = 5,
#[doc = "6: SMCLK Source Select 6"]
Sels6 = 6,
#[doc = "7: SMCLK Source Select 7"]
Sels7 = 7,
}
impl From<Sels> for u8 {
#[inline(always)]
fn from(variant: Sels) -> Self {
variant as _
}
}
impl crate::FieldSpec for Sels {
type Ux = u8;
}
impl crate::IsEnum for Sels {}
#[doc = "Field `SELS` reader - SMCLK Source Select Bit: 0"]
pub type SelsR = crate::FieldReader<Sels>;
impl SelsR {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub const fn variant(&self) -> Sels {
match self.bits {
0 => Sels::Sels0,
1 => Sels::Sels1,
2 => Sels::Sels2,
3 => Sels::Sels3,
4 => Sels::Sels4,
5 => Sels::Sels5,
6 => Sels::Sels6,
7 => Sels::Sels7,
_ => unreachable!(),
}
}
#[doc = "SMCLK Source Select 0"]
#[inline(always)]
pub fn is_sels_0(&self) -> bool {
*self == Sels::Sels0
}
#[doc = "SMCLK Source Select 1"]
#[inline(always)]
pub fn is_sels_1(&self) -> bool {
*self == Sels::Sels1
}
#[doc = "SMCLK Source Select 2"]
#[inline(always)]
pub fn is_sels_2(&self) -> bool {
*self == Sels::Sels2
}
#[doc = "SMCLK Source Select 3"]
#[inline(always)]
pub fn is_sels_3(&self) -> bool {
*self == Sels::Sels3
}
#[doc = "SMCLK Source Select 4"]
#[inline(always)]
pub fn is_sels_4(&self) -> bool {
*self == Sels::Sels4
}
#[doc = "SMCLK Source Select 5"]
#[inline(always)]
pub fn is_sels_5(&self) -> bool {
*self == Sels::Sels5
}
#[doc = "SMCLK Source Select 6"]
#[inline(always)]
pub fn is_sels_6(&self) -> bool {
*self == Sels::Sels6
}
#[doc = "SMCLK Source Select 7"]
#[inline(always)]
pub fn is_sels_7(&self) -> bool {
*self == Sels::Sels7
}
}
#[doc = "Field `SELS` writer - SMCLK Source Select Bit: 0"]
pub type SelsW<'a, REG> = crate::FieldWriter<'a, REG, 3, Sels, crate::Safe>;
impl<'a, REG> SelsW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[doc = "SMCLK Source Select 0"]
#[inline(always)]
pub fn sels_0(self) -> &'a mut crate::W<REG> {
self.variant(Sels::Sels0)
}
#[doc = "SMCLK Source Select 1"]
#[inline(always)]
pub fn sels_1(self) -> &'a mut crate::W<REG> {
self.variant(Sels::Sels1)
}
#[doc = "SMCLK Source Select 2"]
#[inline(always)]
pub fn sels_2(self) -> &'a mut crate::W<REG> {
self.variant(Sels::Sels2)
}
#[doc = "SMCLK Source Select 3"]
#[inline(always)]
pub fn sels_3(self) -> &'a mut crate::W<REG> {
self.variant(Sels::Sels3)
}
#[doc = "SMCLK Source Select 4"]
#[inline(always)]
pub fn sels_4(self) -> &'a mut crate::W<REG> {
self.variant(Sels::Sels4)
}
#[doc = "SMCLK Source Select 5"]
#[inline(always)]
pub fn sels_5(self) -> &'a mut crate::W<REG> {
self.variant(Sels::Sels5)
}
#[doc = "SMCLK Source Select 6"]
#[inline(always)]
pub fn sels_6(self) -> &'a mut crate::W<REG> {
self.variant(Sels::Sels6)
}
#[doc = "SMCLK Source Select 7"]
#[inline(always)]
pub fn sels_7(self) -> &'a mut crate::W<REG> {
self.variant(Sels::Sels7)
}
}
#[doc = "ACLK Source Select Bit: 0\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Sela {
#[doc = "0: ACLK Source Select 0"]
Sela0 = 0,
#[doc = "1: ACLK Source Select 1"]
Sela1 = 1,
#[doc = "2: ACLK Source Select 2"]
Sela2 = 2,
#[doc = "3: ACLK Source Select 3"]
Sela3 = 3,
#[doc = "4: ACLK Source Select 4"]
Sela4 = 4,
#[doc = "5: ACLK Source Select 5"]
Sela5 = 5,
#[doc = "6: ACLK Source Select 6"]
Sela6 = 6,
#[doc = "7: ACLK Source Select 7"]
Sela7 = 7,
}
impl From<Sela> for u8 {
#[inline(always)]
fn from(variant: Sela) -> Self {
variant as _
}
}
impl crate::FieldSpec for Sela {
type Ux = u8;
}
impl crate::IsEnum for Sela {}
#[doc = "Field `SELA` reader - ACLK Source Select Bit: 0"]
pub type SelaR = crate::FieldReader<Sela>;
impl SelaR {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub const fn variant(&self) -> Sela {
match self.bits {
0 => Sela::Sela0,
1 => Sela::Sela1,
2 => Sela::Sela2,
3 => Sela::Sela3,
4 => Sela::Sela4,
5 => Sela::Sela5,
6 => Sela::Sela6,
7 => Sela::Sela7,
_ => unreachable!(),
}
}
#[doc = "ACLK Source Select 0"]
#[inline(always)]
pub fn is_sela_0(&self) -> bool {
*self == Sela::Sela0
}
#[doc = "ACLK Source Select 1"]
#[inline(always)]
pub fn is_sela_1(&self) -> bool {
*self == Sela::Sela1
}
#[doc = "ACLK Source Select 2"]
#[inline(always)]
pub fn is_sela_2(&self) -> bool {
*self == Sela::Sela2
}
#[doc = "ACLK Source Select 3"]
#[inline(always)]
pub fn is_sela_3(&self) -> bool {
*self == Sela::Sela3
}
#[doc = "ACLK Source Select 4"]
#[inline(always)]
pub fn is_sela_4(&self) -> bool {
*self == Sela::Sela4
}
#[doc = "ACLK Source Select 5"]
#[inline(always)]
pub fn is_sela_5(&self) -> bool {
*self == Sela::Sela5
}
#[doc = "ACLK Source Select 6"]
#[inline(always)]
pub fn is_sela_6(&self) -> bool {
*self == Sela::Sela6
}
#[doc = "ACLK Source Select 7"]
#[inline(always)]
pub fn is_sela_7(&self) -> bool {
*self == Sela::Sela7
}
}
#[doc = "Field `SELA` writer - ACLK Source Select Bit: 0"]
pub type SelaW<'a, REG> = crate::FieldWriter<'a, REG, 3, Sela, crate::Safe>;
impl<'a, REG> SelaW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[doc = "ACLK Source Select 0"]
#[inline(always)]
pub fn sela_0(self) -> &'a mut crate::W<REG> {
self.variant(Sela::Sela0)
}
#[doc = "ACLK Source Select 1"]
#[inline(always)]
pub fn sela_1(self) -> &'a mut crate::W<REG> {
self.variant(Sela::Sela1)
}
#[doc = "ACLK Source Select 2"]
#[inline(always)]
pub fn sela_2(self) -> &'a mut crate::W<REG> {
self.variant(Sela::Sela2)
}
#[doc = "ACLK Source Select 3"]
#[inline(always)]
pub fn sela_3(self) -> &'a mut crate::W<REG> {
self.variant(Sela::Sela3)
}
#[doc = "ACLK Source Select 4"]
#[inline(always)]
pub fn sela_4(self) -> &'a mut crate::W<REG> {
self.variant(Sela::Sela4)
}
#[doc = "ACLK Source Select 5"]
#[inline(always)]
pub fn sela_5(self) -> &'a mut crate::W<REG> {
self.variant(Sela::Sela5)
}
#[doc = "ACLK Source Select 6"]
#[inline(always)]
pub fn sela_6(self) -> &'a mut crate::W<REG> {
self.variant(Sela::Sela6)
}
#[doc = "ACLK Source Select 7"]
#[inline(always)]
pub fn sela_7(self) -> &'a mut crate::W<REG> {
self.variant(Sela::Sela7)
}
}
impl R {
#[doc = "Bits 0:2 - MCLK Source Select Bit: 0"]
#[inline(always)]
pub fn selm(&self) -> SelmR {
SelmR::new((self.bits & 7) as u8)
}
#[doc = "Bits 4:6 - SMCLK Source Select Bit: 0"]
#[inline(always)]
pub fn sels(&self) -> SelsR {
SelsR::new(((self.bits >> 4) & 7) as u8)
}
#[doc = "Bits 8:10 - ACLK Source Select Bit: 0"]
#[inline(always)]
pub fn sela(&self) -> SelaR {
SelaR::new(((self.bits >> 8) & 7) as u8)
}
}
impl W {
#[doc = "Bits 0:2 - MCLK Source Select Bit: 0"]
#[inline(always)]
pub fn selm(&mut self) -> SelmW<'_, Ucsctl4Spec> {
SelmW::new(self, 0)
}
#[doc = "Bits 4:6 - SMCLK Source Select Bit: 0"]
#[inline(always)]
pub fn sels(&mut self) -> SelsW<'_, Ucsctl4Spec> {
SelsW::new(self, 4)
}
#[doc = "Bits 8:10 - ACLK Source Select Bit: 0"]
#[inline(always)]
pub fn sela(&mut self) -> SelaW<'_, Ucsctl4Spec> {
SelaW::new(self, 8)
}
}
#[doc = "UCS Control Register 4\n\nYou can [`read`](crate::Reg::read) this register and get [`ucsctl4::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ucsctl4::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct Ucsctl4Spec;
impl crate::RegisterSpec for Ucsctl4Spec {
type Ux = u16;
}
#[doc = "`read()` method returns [`ucsctl4::R`](R) reader structure"]
impl crate::Readable for Ucsctl4Spec {}
#[doc = "`write(|w| ..)` method takes [`ucsctl4::W`](W) writer structure"]
impl crate::Writable for Ucsctl4Spec {
type Safety = crate::Unsafe;
}
#[doc = "`reset()` method sets UCSCTL4 to value 0"]
impl crate::Resettable for Ucsctl4Spec {}