Skip to main content

mcxa_pac/lpspi0/
fsr.rs

1#[doc = "Register `FSR` reader"]
2pub type R = crate::R<FsrSpec>;
3#[doc = "Field `TXCOUNT` reader - Transmit FIFO Count"]
4pub type TxcountR = crate::FieldReader;
5#[doc = "Field `RXCOUNT` reader - Receive FIFO Count"]
6pub type RxcountR = crate::FieldReader;
7impl R {
8    #[doc = "Bits 0:2 - Transmit FIFO Count"]
9    #[inline(always)]
10    pub fn txcount(&self) -> TxcountR {
11        TxcountR::new((self.bits & 7) as u8)
12    }
13    #[doc = "Bits 16:18 - Receive FIFO Count"]
14    #[inline(always)]
15    pub fn rxcount(&self) -> RxcountR {
16        RxcountR::new(((self.bits >> 16) & 7) as u8)
17    }
18}
19#[cfg(feature = "debug")]
20impl core::fmt::Debug for R {
21    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
22        f.debug_struct("FSR")
23            .field("txcount", &self.txcount())
24            .field("rxcount", &self.rxcount())
25            .finish()
26    }
27}
28#[doc = "FIFO Status\n\nYou can [`read`](crate::Reg::read) this register and get [`fsr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
29pub struct FsrSpec;
30impl crate::RegisterSpec for FsrSpec {
31    type Ux = u32;
32}
33#[doc = "`read()` method returns [`fsr::R`](R) reader structure"]
34impl crate::Readable for FsrSpec {}
35#[doc = "`reset()` method sets FSR to value 0"]
36impl crate::Resettable for FsrSpec {}