mcxa_pac/lpi2c0/
mfcr.rs

1#[doc = "Register `MFCR` reader"]
2pub type R = crate::R<MfcrSpec>;
3#[doc = "Register `MFCR` writer"]
4pub type W = crate::W<MfcrSpec>;
5#[doc = "Field `TXWATER` reader - Transmit FIFO Watermark"]
6pub type TxwaterR = crate::FieldReader;
7#[doc = "Field `TXWATER` writer - Transmit FIFO Watermark"]
8pub type TxwaterW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
9#[doc = "Field `RXWATER` reader - Receive FIFO Watermark"]
10pub type RxwaterR = crate::FieldReader;
11#[doc = "Field `RXWATER` writer - Receive FIFO Watermark"]
12pub type RxwaterW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
13impl R {
14    #[doc = "Bits 0:1 - Transmit FIFO Watermark"]
15    #[inline(always)]
16    pub fn txwater(&self) -> TxwaterR {
17        TxwaterR::new((self.bits & 3) as u8)
18    }
19    #[doc = "Bits 16:17 - Receive FIFO Watermark"]
20    #[inline(always)]
21    pub fn rxwater(&self) -> RxwaterR {
22        RxwaterR::new(((self.bits >> 16) & 3) as u8)
23    }
24}
25#[cfg(feature = "debug")]
26impl core::fmt::Debug for R {
27    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
28        f.debug_struct("MFCR")
29            .field("txwater", &self.txwater())
30            .field("rxwater", &self.rxwater())
31            .finish()
32    }
33}
34impl W {
35    #[doc = "Bits 0:1 - Transmit FIFO Watermark"]
36    #[inline(always)]
37    pub fn txwater(&mut self) -> TxwaterW<'_, MfcrSpec> {
38        TxwaterW::new(self, 0)
39    }
40    #[doc = "Bits 16:17 - Receive FIFO Watermark"]
41    #[inline(always)]
42    pub fn rxwater(&mut self) -> RxwaterW<'_, MfcrSpec> {
43        RxwaterW::new(self, 16)
44    }
45}
46#[doc = "Controller FIFO Control\n\nYou can [`read`](crate::Reg::read) this register and get [`mfcr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mfcr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
47pub struct MfcrSpec;
48impl crate::RegisterSpec for MfcrSpec {
49    type Ux = u32;
50}
51#[doc = "`read()` method returns [`mfcr::R`](R) reader structure"]
52impl crate::Readable for MfcrSpec {}
53#[doc = "`write(|w| ..)` method takes [`mfcr::W`](W) writer structure"]
54impl crate::Writable for MfcrSpec {
55    type Safety = crate::Unsafe;
56}
57#[doc = "`reset()` method sets MFCR to value 0"]
58impl crate::Resettable for MfcrSpec {}