mcan/reg/
rxfc.rs

1#[doc = "Register `RXFC` reader"]
2pub type R = crate::R<RXFC_SPEC>;
3#[doc = "Register `RXFC` writer"]
4pub type W = crate::W<RXFC_SPEC>;
5#[doc = "Field `FSA` reader - Rx FIFO Start Address"]
6pub type FSA_R = crate::FieldReader<u16>;
7#[doc = "Field `FSA` writer - Rx FIFO Start Address"]
8pub type FSA_W<'a, REG, const O: u8> = crate::FieldWriter<'a, REG, 16, O, u16>;
9#[doc = "Field `FS` reader - Rx FIFO Size"]
10pub type FS_R = crate::FieldReader;
11#[doc = "Field `FS` writer - Rx FIFO Size"]
12pub type FS_W<'a, REG, const O: u8> = crate::FieldWriter<'a, REG, 7, O>;
13#[doc = "Field `FWM` reader - Rx FIFO Watermark"]
14pub type FWM_R = crate::FieldReader;
15#[doc = "Field `FWM` writer - Rx FIFO Watermark"]
16pub type FWM_W<'a, REG, const O: u8> = crate::FieldWriter<'a, REG, 7, O>;
17#[doc = "Field `FOM` reader - FIFO Operation Mode"]
18pub type FOM_R = crate::BitReader;
19#[doc = "Field `FOM` writer - FIFO Operation Mode"]
20pub type FOM_W<'a, REG, const O: u8> = crate::BitWriter<'a, REG, O>;
21impl R {
22    #[doc = "Bits 0:15 - Rx FIFO Start Address"]
23    #[inline(always)]
24    pub fn fsa(&self) -> FSA_R {
25        FSA_R::new((self.bits & 0xffff) as u16)
26    }
27    #[doc = "Bits 16:22 - Rx FIFO Size"]
28    #[inline(always)]
29    pub fn fs(&self) -> FS_R {
30        FS_R::new(((self.bits >> 16) & 0x7f) as u8)
31    }
32    #[doc = "Bits 24:30 - Rx FIFO Watermark"]
33    #[inline(always)]
34    pub fn fwm(&self) -> FWM_R {
35        FWM_R::new(((self.bits >> 24) & 0x7f) as u8)
36    }
37    #[doc = "Bit 31 - FIFO Operation Mode"]
38    #[inline(always)]
39    pub fn fom(&self) -> FOM_R {
40        FOM_R::new(((self.bits >> 31) & 1) != 0)
41    }
42}
43impl W {
44    #[doc = "Bits 0:15 - Rx FIFO Start Address"]
45    #[inline(always)]
46    #[must_use]
47    pub fn fsa(&mut self) -> FSA_W<RXFC_SPEC, 0> {
48        FSA_W::new(self)
49    }
50    #[doc = "Bits 16:22 - Rx FIFO Size"]
51    #[inline(always)]
52    #[must_use]
53    pub fn fs(&mut self) -> FS_W<RXFC_SPEC, 16> {
54        FS_W::new(self)
55    }
56    #[doc = "Bits 24:30 - Rx FIFO Watermark"]
57    #[inline(always)]
58    #[must_use]
59    pub fn fwm(&mut self) -> FWM_W<RXFC_SPEC, 24> {
60        FWM_W::new(self)
61    }
62    #[doc = "Bit 31 - FIFO Operation Mode"]
63    #[inline(always)]
64    #[must_use]
65    pub fn fom(&mut self) -> FOM_W<RXFC_SPEC, 31> {
66        FOM_W::new(self)
67    }
68    #[doc = r" Writes raw bits to the register."]
69    #[doc = r""]
70    #[doc = r" # Safety"]
71    #[doc = r""]
72    #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
73    #[inline(always)]
74    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
75        self.bits = bits;
76        self
77    }
78}
79#[doc = "Rx FIFO Configuration\n\nYou can [`read`](crate::reg::generic::Reg::read) this register and get [`rxfc::R`](R).  You can [`reset`](crate::reg::generic::Reg::reset), [`write`](crate::reg::generic::Reg::write), [`write_with_zero`](crate::reg::generic::Reg::write_with_zero) this register using [`rxfc::W`](W). You can also [`modify`](crate::reg::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
80pub struct RXFC_SPEC;
81impl crate::RegisterSpec for RXFC_SPEC {
82    type Ux = u32;
83}
84#[doc = "`read()` method returns [`rxfc::R`](R) reader structure"]
85impl crate::Readable for RXFC_SPEC {}
86#[doc = "`write(|w| ..)` method takes [`rxfc::W`](W) writer structure"]
87impl crate::Writable for RXFC_SPEC {
88    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
89    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
90}
91#[doc = "`reset()` method sets RXFC to value 0"]
92impl crate::Resettable for RXFC_SPEC {
93    const RESET_VALUE: Self::Ux = 0;
94}