1#[doc = "Register `DMA_CONF` reader"]
2pub type R = crate::R<DMA_CONF_SPEC>;
3#[doc = "Register `DMA_CONF` writer"]
4pub type W = crate::W<DMA_CONF_SPEC>;
5#[doc = "Field `APB_ADC_EOF_NUM` reader - the dma_in_suc_eof gen when sample cnt = spi_eof_num"]
6pub type APB_ADC_EOF_NUM_R = crate::FieldReader<u16>;
7#[doc = "Field `APB_ADC_EOF_NUM` writer - the dma_in_suc_eof gen when sample cnt = spi_eof_num"]
8pub type APB_ADC_EOF_NUM_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
9#[doc = "Field `APB_ADC_RESET_FSM` reader - reset_apb_adc_state"]
10pub type APB_ADC_RESET_FSM_R = crate::BitReader;
11#[doc = "Field `APB_ADC_RESET_FSM` writer - reset_apb_adc_state"]
12pub type APB_ADC_RESET_FSM_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `APB_ADC_TRANS` reader - enable apb_adc use spi_dma"]
14pub type APB_ADC_TRANS_R = crate::BitReader;
15#[doc = "Field `APB_ADC_TRANS` writer - enable apb_adc use spi_dma"]
16pub type APB_ADC_TRANS_W<'a, REG> = crate::BitWriter<'a, REG>;
17impl R {
18 #[doc = "Bits 0:15 - the dma_in_suc_eof gen when sample cnt = spi_eof_num"]
19 #[inline(always)]
20 pub fn apb_adc_eof_num(&self) -> APB_ADC_EOF_NUM_R {
21 APB_ADC_EOF_NUM_R::new((self.bits & 0xffff) as u16)
22 }
23 #[doc = "Bit 30 - reset_apb_adc_state"]
24 #[inline(always)]
25 pub fn apb_adc_reset_fsm(&self) -> APB_ADC_RESET_FSM_R {
26 APB_ADC_RESET_FSM_R::new(((self.bits >> 30) & 1) != 0)
27 }
28 #[doc = "Bit 31 - enable apb_adc use spi_dma"]
29 #[inline(always)]
30 pub fn apb_adc_trans(&self) -> APB_ADC_TRANS_R {
31 APB_ADC_TRANS_R::new(((self.bits >> 31) & 1) != 0)
32 }
33}
34#[cfg(feature = "impl-register-debug")]
35impl core::fmt::Debug for R {
36 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
37 f.debug_struct("DMA_CONF")
38 .field(
39 "apb_adc_eof_num",
40 &format_args!("{}", self.apb_adc_eof_num().bits()),
41 )
42 .field(
43 "apb_adc_reset_fsm",
44 &format_args!("{}", self.apb_adc_reset_fsm().bit()),
45 )
46 .field(
47 "apb_adc_trans",
48 &format_args!("{}", self.apb_adc_trans().bit()),
49 )
50 .finish()
51 }
52}
53#[cfg(feature = "impl-register-debug")]
54impl core::fmt::Debug for crate::generic::Reg<DMA_CONF_SPEC> {
55 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
56 core::fmt::Debug::fmt(&self.read(), f)
57 }
58}
59impl W {
60 #[doc = "Bits 0:15 - the dma_in_suc_eof gen when sample cnt = spi_eof_num"]
61 #[inline(always)]
62 #[must_use]
63 pub fn apb_adc_eof_num(&mut self) -> APB_ADC_EOF_NUM_W<DMA_CONF_SPEC> {
64 APB_ADC_EOF_NUM_W::new(self, 0)
65 }
66 #[doc = "Bit 30 - reset_apb_adc_state"]
67 #[inline(always)]
68 #[must_use]
69 pub fn apb_adc_reset_fsm(&mut self) -> APB_ADC_RESET_FSM_W<DMA_CONF_SPEC> {
70 APB_ADC_RESET_FSM_W::new(self, 30)
71 }
72 #[doc = "Bit 31 - enable apb_adc use spi_dma"]
73 #[inline(always)]
74 #[must_use]
75 pub fn apb_adc_trans(&mut self) -> APB_ADC_TRANS_W<DMA_CONF_SPEC> {
76 APB_ADC_TRANS_W::new(self, 31)
77 }
78}
79#[doc = "Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dma_conf::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dma_conf::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
80pub struct DMA_CONF_SPEC;
81impl crate::RegisterSpec for DMA_CONF_SPEC {
82 type Ux = u32;
83}
84#[doc = "`read()` method returns [`dma_conf::R`](R) reader structure"]
85impl crate::Readable for DMA_CONF_SPEC {}
86#[doc = "`write(|w| ..)` method takes [`dma_conf::W`](W) writer structure"]
87impl crate::Writable for DMA_CONF_SPEC {
88 type Safety = crate::Unsafe;
89 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
90 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
91}
92#[doc = "`reset()` method sets DMA_CONF to value 0xff"]
93impl crate::Resettable for DMA_CONF_SPEC {
94 const RESET_VALUE: u32 = 0xff;
95}