pub type R = crate::R<CR2rs>;
pub type W = crate::W<CR2rs>;
pub type ADON_R = crate::BitReader;
pub type ADON_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type CONT_R = crate::BitReader;
pub type CONT_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type ADC_CFG_R = crate::BitReader;
pub type ADC_CFG_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type DELS_R = crate::FieldReader;
pub type DELS_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
pub type DMA_R = crate::BitReader;
pub type DMA_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type DDS_R = crate::BitReader;
pub type DDS_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type EOCS_R = crate::BitReader;
pub type EOCS_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type ALIGN_R = crate::BitReader;
pub type ALIGN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type JEXTSEL_R = crate::FieldReader;
pub type JEXTSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type JEXTEN_R = crate::FieldReader;
pub type JEXTEN_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type JSWSTART_R = crate::BitReader;
pub type JSWSTART_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type EXTSEL_R = crate::FieldReader;
pub type EXTSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type EXTEN_R = crate::FieldReader;
pub type EXTEN_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type SWSTART_R = crate::BitReader;
pub type SWSTART_W<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn adon(&self) -> ADON_R {
ADON_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn cont(&self) -> CONT_R {
CONT_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn adc_cfg(&self) -> ADC_CFG_R {
ADC_CFG_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn dels(&self) -> DELS_R {
DELS_R::new(((self.bits >> 4) & 7) as u8)
}
#[inline(always)]
pub fn dma(&self) -> DMA_R {
DMA_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn dds(&self) -> DDS_R {
DDS_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn eocs(&self) -> EOCS_R {
EOCS_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn align(&self) -> ALIGN_R {
ALIGN_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn jextsel(&self) -> JEXTSEL_R {
JEXTSEL_R::new(((self.bits >> 16) & 0x0f) as u8)
}
#[inline(always)]
pub fn jexten(&self) -> JEXTEN_R {
JEXTEN_R::new(((self.bits >> 20) & 3) as u8)
}
#[inline(always)]
pub fn jswstart(&self) -> JSWSTART_R {
JSWSTART_R::new(((self.bits >> 22) & 1) != 0)
}
#[inline(always)]
pub fn extsel(&self) -> EXTSEL_R {
EXTSEL_R::new(((self.bits >> 24) & 0x0f) as u8)
}
#[inline(always)]
pub fn exten(&self) -> EXTEN_R {
EXTEN_R::new(((self.bits >> 28) & 3) as u8)
}
#[inline(always)]
pub fn swstart(&self) -> SWSTART_R {
SWSTART_R::new(((self.bits >> 30) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CR2")
.field("swstart", &self.swstart())
.field("exten", &self.exten())
.field("extsel", &self.extsel())
.field("jswstart", &self.jswstart())
.field("jexten", &self.jexten())
.field("jextsel", &self.jextsel())
.field("align", &self.align())
.field("eocs", &self.eocs())
.field("dds", &self.dds())
.field("dma", &self.dma())
.field("dels", &self.dels())
.field("adc_cfg", &self.adc_cfg())
.field("cont", &self.cont())
.field("adon", &self.adon())
.finish()
}
}
impl W {
#[inline(always)]
pub fn adon(&mut self) -> ADON_W<CR2rs> {
ADON_W::new(self, 0)
}
#[inline(always)]
pub fn cont(&mut self) -> CONT_W<CR2rs> {
CONT_W::new(self, 1)
}
#[inline(always)]
pub fn adc_cfg(&mut self) -> ADC_CFG_W<CR2rs> {
ADC_CFG_W::new(self, 2)
}
#[inline(always)]
pub fn dels(&mut self) -> DELS_W<CR2rs> {
DELS_W::new(self, 4)
}
#[inline(always)]
pub fn dma(&mut self) -> DMA_W<CR2rs> {
DMA_W::new(self, 8)
}
#[inline(always)]
pub fn dds(&mut self) -> DDS_W<CR2rs> {
DDS_W::new(self, 9)
}
#[inline(always)]
pub fn eocs(&mut self) -> EOCS_W<CR2rs> {
EOCS_W::new(self, 10)
}
#[inline(always)]
pub fn align(&mut self) -> ALIGN_W<CR2rs> {
ALIGN_W::new(self, 11)
}
#[inline(always)]
pub fn jextsel(&mut self) -> JEXTSEL_W<CR2rs> {
JEXTSEL_W::new(self, 16)
}
#[inline(always)]
pub fn jexten(&mut self) -> JEXTEN_W<CR2rs> {
JEXTEN_W::new(self, 20)
}
#[inline(always)]
pub fn jswstart(&mut self) -> JSWSTART_W<CR2rs> {
JSWSTART_W::new(self, 22)
}
#[inline(always)]
pub fn extsel(&mut self) -> EXTSEL_W<CR2rs> {
EXTSEL_W::new(self, 24)
}
#[inline(always)]
pub fn exten(&mut self) -> EXTEN_W<CR2rs> {
EXTEN_W::new(self, 28)
}
#[inline(always)]
pub fn swstart(&mut self) -> SWSTART_W<CR2rs> {
SWSTART_W::new(self, 30)
}
}
pub struct CR2rs;
impl crate::RegisterSpec for CR2rs {
type Ux = u32;
}
impl crate::Readable for CR2rs {}
impl crate::Writable for CR2rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CR2rs {}