r528_pac/spi_dbi/
spi_fsr.rs

1#[doc = "Register `SPI_FSR` reader"]
2pub struct R(crate::R<SPI_FSR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<SPI_FSR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<SPI_FSR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<SPI_FSR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `tb_wr` reader - TXFIFO Write Buffer Write Enable"]
17pub type TB_WR_R = crate::BitReader<bool>;
18#[doc = "Field `tb_cnt` reader - TXFIFO Write Buffer Counter"]
19pub type TB_CNT_R = crate::FieldReader<u8, u8>;
20#[doc = "Field `tf_cnt` reader - TXFIFO Counter\n\nThese bits indicate the number of bytes in TXFIFO"]
21pub type TF_CNT_R = crate::FieldReader<u8, u8>;
22#[doc = "Field `rb_wr` reader - RXFIFO Write Buffer Write Enable"]
23pub type RB_WR_R = crate::BitReader<bool>;
24#[doc = "Field `rb_cnt` reader - RXFIFO Write Buffer Counter"]
25pub type RB_CNT_R = crate::FieldReader<u8, u8>;
26#[doc = "Field `rf_cnt` reader - RXFIFO Counter\n\nThese bits indicate the number of bytes in RXFIFO"]
27pub type RF_CNT_R = crate::FieldReader<u8, u8>;
28impl R {
29    #[doc = "Bit 31 - TXFIFO Write Buffer Write Enable"]
30    #[inline(always)]
31    pub fn tb_wr(&self) -> TB_WR_R {
32        TB_WR_R::new(((self.bits >> 31) & 1) != 0)
33    }
34    #[doc = "Bits 28:30 - TXFIFO Write Buffer Counter"]
35    #[inline(always)]
36    pub fn tb_cnt(&self) -> TB_CNT_R {
37        TB_CNT_R::new(((self.bits >> 28) & 7) as u8)
38    }
39    #[doc = "Bits 16:23 - TXFIFO Counter\n\nThese bits indicate the number of bytes in TXFIFO"]
40    #[inline(always)]
41    pub fn tf_cnt(&self) -> TF_CNT_R {
42        TF_CNT_R::new(((self.bits >> 16) & 0xff) as u8)
43    }
44    #[doc = "Bit 15 - RXFIFO Write Buffer Write Enable"]
45    #[inline(always)]
46    pub fn rb_wr(&self) -> RB_WR_R {
47        RB_WR_R::new(((self.bits >> 15) & 1) != 0)
48    }
49    #[doc = "Bits 12:14 - RXFIFO Write Buffer Counter"]
50    #[inline(always)]
51    pub fn rb_cnt(&self) -> RB_CNT_R {
52        RB_CNT_R::new(((self.bits >> 12) & 7) as u8)
53    }
54    #[doc = "Bits 0:7 - RXFIFO Counter\n\nThese bits indicate the number of bytes in RXFIFO"]
55    #[inline(always)]
56    pub fn rf_cnt(&self) -> RF_CNT_R {
57        RF_CNT_R::new((self.bits & 0xff) as u8)
58    }
59}
60#[doc = "SPI FIFO Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [spi_fsr](index.html) module"]
61pub struct SPI_FSR_SPEC;
62impl crate::RegisterSpec for SPI_FSR_SPEC {
63    type Ux = u32;
64}
65#[doc = "`read()` method returns [spi_fsr::R](R) reader structure"]
66impl crate::Readable for SPI_FSR_SPEC {
67    type Reader = R;
68}
69#[doc = "`reset()` method sets SPI_FSR to value 0"]
70impl crate::Resettable for SPI_FSR_SPEC {
71    #[inline(always)]
72    fn reset_value() -> Self::Ux {
73        0
74    }
75}