bcm2835_lpa/spi1/
io.rs

1#[doc = "Register `IO%s` reader"]
2pub type R = crate::R<IO_SPEC>;
3#[doc = "Register `IO%s` writer"]
4pub type W = crate::W<IO_SPEC>;
5#[doc = "Field `DATA` reader - FIFO data access"]
6pub type DATA_R = crate::FieldReader<u16>;
7#[doc = "Field `DATA` writer - FIFO data access"]
8pub type DATA_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
9impl R {
10    #[doc = "Bits 0:15 - FIFO data access"]
11    #[inline(always)]
12    pub fn data(&self) -> DATA_R {
13        DATA_R::new((self.bits & 0xffff) as u16)
14    }
15}
16impl core::fmt::Debug for R {
17    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
18        f.debug_struct("IO")
19            .field("data", &format_args!("{}", self.data().bits()))
20            .finish()
21    }
22}
23impl core::fmt::Debug for crate::generic::Reg<IO_SPEC> {
24    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
25        core::fmt::Debug::fmt(&self.read(), f)
26    }
27}
28impl W {
29    #[doc = "Bits 0:15 - FIFO data access"]
30    #[inline(always)]
31    #[must_use]
32    pub fn data(&mut self) -> DATA_W<IO_SPEC> {
33        DATA_W::new(self, 0)
34    }
35    #[doc = r" Writes raw bits to the register."]
36    #[doc = r""]
37    #[doc = r" # Safety"]
38    #[doc = r""]
39    #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
40    #[inline(always)]
41    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
42        self.bits = bits;
43        self
44    }
45}
46#[doc = "Writing to the FIFO will deassert CS at the end of the access\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`io::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 [`io::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
47pub struct IO_SPEC;
48impl crate::RegisterSpec for IO_SPEC {
49    type Ux = u32;
50}
51#[doc = "`read()` method returns [`io::R`](R) reader structure"]
52impl crate::Readable for IO_SPEC {}
53#[doc = "`write(|w| ..)` method takes [`io::W`](W) writer structure"]
54impl crate::Writable for IO_SPEC {
55    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
56    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
57}
58#[doc = "`reset()` method sets IO%s to value 0"]
59impl crate::Resettable for IO_SPEC {
60    const RESET_VALUE: u32 = 0;
61}