rp2040_pac/spi0/
sspdmacr.rs

1#[doc = "Register `SSPDMACR` reader"]
2pub type R = crate::R<SSPDMACR_SPEC>;
3#[doc = "Register `SSPDMACR` writer"]
4pub type W = crate::W<SSPDMACR_SPEC>;
5#[doc = "Field `RXDMAE` reader - Receive DMA Enable. If this bit is set to 1, DMA for the receive FIFO is enabled."]
6pub type RXDMAE_R = crate::BitReader;
7#[doc = "Field `RXDMAE` writer - Receive DMA Enable. If this bit is set to 1, DMA for the receive FIFO is enabled."]
8pub type RXDMAE_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `TXDMAE` reader - Transmit DMA Enable. If this bit is set to 1, DMA for the transmit FIFO is enabled."]
10pub type TXDMAE_R = crate::BitReader;
11#[doc = "Field `TXDMAE` writer - Transmit DMA Enable. If this bit is set to 1, DMA for the transmit FIFO is enabled."]
12pub type TXDMAE_W<'a, REG> = crate::BitWriter<'a, REG>;
13impl R {
14    #[doc = "Bit 0 - Receive DMA Enable. If this bit is set to 1, DMA for the receive FIFO is enabled."]
15    #[inline(always)]
16    pub fn rxdmae(&self) -> RXDMAE_R {
17        RXDMAE_R::new((self.bits & 1) != 0)
18    }
19    #[doc = "Bit 1 - Transmit DMA Enable. If this bit is set to 1, DMA for the transmit FIFO is enabled."]
20    #[inline(always)]
21    pub fn txdmae(&self) -> TXDMAE_R {
22        TXDMAE_R::new(((self.bits >> 1) & 1) != 0)
23    }
24}
25impl W {
26    #[doc = "Bit 0 - Receive DMA Enable. If this bit is set to 1, DMA for the receive FIFO is enabled."]
27    #[inline(always)]
28    #[must_use]
29    pub fn rxdmae(&mut self) -> RXDMAE_W<SSPDMACR_SPEC> {
30        RXDMAE_W::new(self, 0)
31    }
32    #[doc = "Bit 1 - Transmit DMA Enable. If this bit is set to 1, DMA for the transmit FIFO is enabled."]
33    #[inline(always)]
34    #[must_use]
35    pub fn txdmae(&mut self) -> TXDMAE_W<SSPDMACR_SPEC> {
36        TXDMAE_W::new(self, 1)
37    }
38    #[doc = r" Writes raw bits to the register."]
39    #[doc = r""]
40    #[doc = r" # Safety"]
41    #[doc = r""]
42    #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
43    #[inline(always)]
44    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
45        self.bits = bits;
46        self
47    }
48}
49#[doc = "DMA control register, SSPDMACR on page 3-12  
50
51You can [`read`](crate::generic::Reg::read) this register and get [`sspdmacr::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 [`sspdmacr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
52pub struct SSPDMACR_SPEC;
53impl crate::RegisterSpec for SSPDMACR_SPEC {
54    type Ux = u32;
55}
56#[doc = "`read()` method returns [`sspdmacr::R`](R) reader structure"]
57impl crate::Readable for SSPDMACR_SPEC {}
58#[doc = "`write(|w| ..)` method takes [`sspdmacr::W`](W) writer structure"]
59impl crate::Writable for SSPDMACR_SPEC {
60    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
61    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
62}
63#[doc = "`reset()` method sets SSPDMACR to value 0"]
64impl crate::Resettable for SSPDMACR_SPEC {
65    const RESET_VALUE: u32 = 0;
66}