pub type R = crate::R<CCRrs>;
pub type W = crate::W<CCRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum MULTI {
Independent = 0,
DualRj = 1,
DualRa = 2,
DualJ = 5,
DualR = 6,
DualI = 7,
DualA = 9,
TripleRj = 17,
TripleRa = 18,
TripleJ = 21,
TripleR = 22,
TripleI = 23,
TripleA = 24,
}
impl From<MULTI> for u8 {
#[inline(always)]
fn from(variant: MULTI) -> Self {
variant as _
}
}
impl crate::FieldSpec for MULTI {
type Ux = u8;
}
impl crate::IsEnum for MULTI {}
pub type MULTI_R = crate::FieldReader<MULTI>;
impl MULTI_R {
#[inline(always)]
pub const fn variant(&self) -> Option<MULTI> {
match self.bits {
0 => Some(MULTI::Independent),
1 => Some(MULTI::DualRj),
2 => Some(MULTI::DualRa),
5 => Some(MULTI::DualJ),
6 => Some(MULTI::DualR),
7 => Some(MULTI::DualI),
9 => Some(MULTI::DualA),
17 => Some(MULTI::TripleRj),
18 => Some(MULTI::TripleRa),
21 => Some(MULTI::TripleJ),
22 => Some(MULTI::TripleR),
23 => Some(MULTI::TripleI),
24 => Some(MULTI::TripleA),
_ => None,
}
}
#[inline(always)]
pub fn is_independent(&self) -> bool {
*self == MULTI::Independent
}
#[inline(always)]
pub fn is_dual_rj(&self) -> bool {
*self == MULTI::DualRj
}
#[inline(always)]
pub fn is_dual_ra(&self) -> bool {
*self == MULTI::DualRa
}
#[inline(always)]
pub fn is_dual_j(&self) -> bool {
*self == MULTI::DualJ
}
#[inline(always)]
pub fn is_dual_r(&self) -> bool {
*self == MULTI::DualR
}
#[inline(always)]
pub fn is_dual_i(&self) -> bool {
*self == MULTI::DualI
}
#[inline(always)]
pub fn is_dual_a(&self) -> bool {
*self == MULTI::DualA
}
#[inline(always)]
pub fn is_triple_rj(&self) -> bool {
*self == MULTI::TripleRj
}
#[inline(always)]
pub fn is_triple_ra(&self) -> bool {
*self == MULTI::TripleRa
}
#[inline(always)]
pub fn is_triple_j(&self) -> bool {
*self == MULTI::TripleJ
}
#[inline(always)]
pub fn is_triple_r(&self) -> bool {
*self == MULTI::TripleR
}
#[inline(always)]
pub fn is_triple_i(&self) -> bool {
*self == MULTI::TripleI
}
#[inline(always)]
pub fn is_triple_a(&self) -> bool {
*self == MULTI::TripleA
}
}
pub type MULTI_W<'a, REG> = crate::FieldWriter<'a, REG, 5, MULTI>;
impl<'a, REG> MULTI_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn independent(self) -> &'a mut crate::W<REG> {
self.variant(MULTI::Independent)
}
#[inline(always)]
pub fn dual_rj(self) -> &'a mut crate::W<REG> {
self.variant(MULTI::DualRj)
}
#[inline(always)]
pub fn dual_ra(self) -> &'a mut crate::W<REG> {
self.variant(MULTI::DualRa)
}
#[inline(always)]
pub fn dual_j(self) -> &'a mut crate::W<REG> {
self.variant(MULTI::DualJ)
}
#[inline(always)]
pub fn dual_r(self) -> &'a mut crate::W<REG> {
self.variant(MULTI::DualR)
}
#[inline(always)]
pub fn dual_i(self) -> &'a mut crate::W<REG> {
self.variant(MULTI::DualI)
}
#[inline(always)]
pub fn dual_a(self) -> &'a mut crate::W<REG> {
self.variant(MULTI::DualA)
}
#[inline(always)]
pub fn triple_rj(self) -> &'a mut crate::W<REG> {
self.variant(MULTI::TripleRj)
}
#[inline(always)]
pub fn triple_ra(self) -> &'a mut crate::W<REG> {
self.variant(MULTI::TripleRa)
}
#[inline(always)]
pub fn triple_j(self) -> &'a mut crate::W<REG> {
self.variant(MULTI::TripleJ)
}
#[inline(always)]
pub fn triple_r(self) -> &'a mut crate::W<REG> {
self.variant(MULTI::TripleR)
}
#[inline(always)]
pub fn triple_i(self) -> &'a mut crate::W<REG> {
self.variant(MULTI::TripleI)
}
#[inline(always)]
pub fn triple_a(self) -> &'a mut crate::W<REG> {
self.variant(MULTI::TripleA)
}
}
pub type DELAY_R = crate::FieldReader;
pub type DELAY_W<'a, REG> = crate::FieldWriter<'a, REG, 4, u8, crate::Safe>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DDS {
Single = 0,
Continuous = 1,
}
impl From<DDS> for bool {
#[inline(always)]
fn from(variant: DDS) -> Self {
variant as u8 != 0
}
}
pub type DDS_R = crate::BitReader<DDS>;
impl DDS_R {
#[inline(always)]
pub const fn variant(&self) -> DDS {
match self.bits {
false => DDS::Single,
true => DDS::Continuous,
}
}
#[inline(always)]
pub fn is_single(&self) -> bool {
*self == DDS::Single
}
#[inline(always)]
pub fn is_continuous(&self) -> bool {
*self == DDS::Continuous
}
}
pub type DDS_W<'a, REG> = crate::BitWriter<'a, REG, DDS>;
impl<'a, REG> DDS_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn single(self) -> &'a mut crate::W<REG> {
self.variant(DDS::Single)
}
#[inline(always)]
pub fn continuous(self) -> &'a mut crate::W<REG> {
self.variant(DDS::Continuous)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum DMA {
Disabled = 0,
Mode1 = 1,
Mode2 = 2,
Mode3 = 3,
}
impl From<DMA> for u8 {
#[inline(always)]
fn from(variant: DMA) -> Self {
variant as _
}
}
impl crate::FieldSpec for DMA {
type Ux = u8;
}
impl crate::IsEnum for DMA {}
pub type DMA_R = crate::FieldReader<DMA>;
impl DMA_R {
#[inline(always)]
pub const fn variant(&self) -> DMA {
match self.bits {
0 => DMA::Disabled,
1 => DMA::Mode1,
2 => DMA::Mode2,
3 => DMA::Mode3,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == DMA::Disabled
}
#[inline(always)]
pub fn is_mode1(&self) -> bool {
*self == DMA::Mode1
}
#[inline(always)]
pub fn is_mode2(&self) -> bool {
*self == DMA::Mode2
}
#[inline(always)]
pub fn is_mode3(&self) -> bool {
*self == DMA::Mode3
}
}
pub type DMA_W<'a, REG> = crate::FieldWriter<'a, REG, 2, DMA, crate::Safe>;
impl<'a, REG> DMA_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(DMA::Disabled)
}
#[inline(always)]
pub fn mode1(self) -> &'a mut crate::W<REG> {
self.variant(DMA::Mode1)
}
#[inline(always)]
pub fn mode2(self) -> &'a mut crate::W<REG> {
self.variant(DMA::Mode2)
}
#[inline(always)]
pub fn mode3(self) -> &'a mut crate::W<REG> {
self.variant(DMA::Mode3)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum ADCPRE {
Div2 = 0,
Div4 = 1,
Div6 = 2,
Div8 = 3,
}
impl From<ADCPRE> for u8 {
#[inline(always)]
fn from(variant: ADCPRE) -> Self {
variant as _
}
}
impl crate::FieldSpec for ADCPRE {
type Ux = u8;
}
impl crate::IsEnum for ADCPRE {}
pub type ADCPRE_R = crate::FieldReader<ADCPRE>;
impl ADCPRE_R {
#[inline(always)]
pub const fn variant(&self) -> ADCPRE {
match self.bits {
0 => ADCPRE::Div2,
1 => ADCPRE::Div4,
2 => ADCPRE::Div6,
3 => ADCPRE::Div8,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_div2(&self) -> bool {
*self == ADCPRE::Div2
}
#[inline(always)]
pub fn is_div4(&self) -> bool {
*self == ADCPRE::Div4
}
#[inline(always)]
pub fn is_div6(&self) -> bool {
*self == ADCPRE::Div6
}
#[inline(always)]
pub fn is_div8(&self) -> bool {
*self == ADCPRE::Div8
}
}
pub type ADCPRE_W<'a, REG> = crate::FieldWriter<'a, REG, 2, ADCPRE, crate::Safe>;
impl<'a, REG> ADCPRE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn div2(self) -> &'a mut crate::W<REG> {
self.variant(ADCPRE::Div2)
}
#[inline(always)]
pub fn div4(self) -> &'a mut crate::W<REG> {
self.variant(ADCPRE::Div4)
}
#[inline(always)]
pub fn div6(self) -> &'a mut crate::W<REG> {
self.variant(ADCPRE::Div6)
}
#[inline(always)]
pub fn div8(self) -> &'a mut crate::W<REG> {
self.variant(ADCPRE::Div8)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VBATE {
Disabled = 0,
Enabled = 1,
}
impl From<VBATE> for bool {
#[inline(always)]
fn from(variant: VBATE) -> Self {
variant as u8 != 0
}
}
pub type VBATE_R = crate::BitReader<VBATE>;
impl VBATE_R {
#[inline(always)]
pub const fn variant(&self) -> VBATE {
match self.bits {
false => VBATE::Disabled,
true => VBATE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == VBATE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == VBATE::Enabled
}
}
pub type VBATE_W<'a, REG> = crate::BitWriter<'a, REG, VBATE>;
impl<'a, REG> VBATE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(VBATE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(VBATE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TSVREFE {
Disabled = 0,
Enabled = 1,
}
impl From<TSVREFE> for bool {
#[inline(always)]
fn from(variant: TSVREFE) -> Self {
variant as u8 != 0
}
}
pub type TSVREFE_R = crate::BitReader<TSVREFE>;
impl TSVREFE_R {
#[inline(always)]
pub const fn variant(&self) -> TSVREFE {
match self.bits {
false => TSVREFE::Disabled,
true => TSVREFE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TSVREFE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TSVREFE::Enabled
}
}
pub type TSVREFE_W<'a, REG> = crate::BitWriter<'a, REG, TSVREFE>;
impl<'a, REG> TSVREFE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(TSVREFE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(TSVREFE::Enabled)
}
}
impl R {
#[inline(always)]
pub fn multi(&self) -> MULTI_R {
MULTI_R::new((self.bits & 0x1f) as u8)
}
#[inline(always)]
pub fn delay(&self) -> DELAY_R {
DELAY_R::new(((self.bits >> 8) & 0x0f) as u8)
}
#[inline(always)]
pub fn dds(&self) -> DDS_R {
DDS_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn dma(&self) -> DMA_R {
DMA_R::new(((self.bits >> 14) & 3) as u8)
}
#[inline(always)]
pub fn adcpre(&self) -> ADCPRE_R {
ADCPRE_R::new(((self.bits >> 16) & 3) as u8)
}
#[inline(always)]
pub fn vbate(&self) -> VBATE_R {
VBATE_R::new(((self.bits >> 22) & 1) != 0)
}
#[inline(always)]
pub fn tsvrefe(&self) -> TSVREFE_R {
TSVREFE_R::new(((self.bits >> 23) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CCR")
.field("tsvrefe", &self.tsvrefe())
.field("vbate", &self.vbate())
.field("adcpre", &self.adcpre())
.field("dma", &self.dma())
.field("dds", &self.dds())
.field("delay", &self.delay())
.field("multi", &self.multi())
.finish()
}
}
impl W {
#[inline(always)]
pub fn multi(&mut self) -> MULTI_W<CCRrs> {
MULTI_W::new(self, 0)
}
#[inline(always)]
pub fn delay(&mut self) -> DELAY_W<CCRrs> {
DELAY_W::new(self, 8)
}
#[inline(always)]
pub fn dds(&mut self) -> DDS_W<CCRrs> {
DDS_W::new(self, 13)
}
#[inline(always)]
pub fn dma(&mut self) -> DMA_W<CCRrs> {
DMA_W::new(self, 14)
}
#[inline(always)]
pub fn adcpre(&mut self) -> ADCPRE_W<CCRrs> {
ADCPRE_W::new(self, 16)
}
#[inline(always)]
pub fn vbate(&mut self) -> VBATE_W<CCRrs> {
VBATE_W::new(self, 22)
}
#[inline(always)]
pub fn tsvrefe(&mut self) -> TSVREFE_W<CCRrs> {
TSVREFE_W::new(self, 23)
}
}
pub struct CCRrs;
impl crate::RegisterSpec for CCRrs {
type Ux = u32;
}
impl crate::Readable for CCRrs {}
impl crate::Writable for CCRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CCRrs {}