bl61x_pac/i2s/
fifo_config_1.rs1#[doc = "Register `fifo_config_1` reader"]
2pub type R = crate::R<FIFO_CONFIG_1_SPEC>;
3#[doc = "Register `fifo_config_1` writer"]
4pub type W = crate::W<FIFO_CONFIG_1_SPEC>;
5#[doc = "Field `transmit_count` reader - Count of available data in transmit FIFO"]
6pub type TRANSMIT_COUNT_R = crate::FieldReader;
7#[doc = "Field `receive_count` reader - Count of available data in receive FIFO"]
8pub type RECEIVE_COUNT_R = crate::FieldReader;
9#[doc = "Field `transmit_threshold` reader - Transmit FIFO threshold\n\n DMA request will not be asserted if `transmit_available` is less than this value"]
10pub type TRANSMIT_THRESHOLD_R = crate::FieldReader;
11#[doc = "Field `transmit_threshold` writer - Transmit FIFO threshold\n\n DMA request will not be asserted if `transmit_available` is less than this value"]
12pub type TRANSMIT_THRESHOLD_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
13#[doc = "Field `receive_threshold` reader - Receive FIFO threshold\n\n DMA request will not be asserted if `receive_available` is less than this value"]
14pub type RECEIVE_THRESHOLD_R = crate::FieldReader;
15#[doc = "Field `receive_threshold` writer - Receive FIFO threshold\n\n DMA request will not be asserted if `receive_available` is less than this value"]
16pub type RECEIVE_THRESHOLD_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
17impl R {
18 #[doc = "Bits 0:4 - Count of available data in transmit FIFO"]
19 #[inline(always)]
20 pub fn transmit_count(&self) -> TRANSMIT_COUNT_R {
21 TRANSMIT_COUNT_R::new((self.bits & 0x1f) as u8)
22 }
23 #[doc = "Bits 8:12 - Count of available data in receive FIFO"]
24 #[inline(always)]
25 pub fn receive_count(&self) -> RECEIVE_COUNT_R {
26 RECEIVE_COUNT_R::new(((self.bits >> 8) & 0x1f) as u8)
27 }
28 #[doc = "Bits 16:19 - Transmit FIFO threshold\n\n DMA request will not be asserted if `transmit_available` is less than this value"]
29 #[inline(always)]
30 pub fn transmit_threshold(&self) -> TRANSMIT_THRESHOLD_R {
31 TRANSMIT_THRESHOLD_R::new(((self.bits >> 16) & 0x0f) as u8)
32 }
33 #[doc = "Bits 24:27 - Receive FIFO threshold\n\n DMA request will not be asserted if `receive_available` is less than this value"]
34 #[inline(always)]
35 pub fn receive_threshold(&self) -> RECEIVE_THRESHOLD_R {
36 RECEIVE_THRESHOLD_R::new(((self.bits >> 24) & 0x0f) as u8)
37 }
38}
39impl W {
40 #[doc = "Bits 16:19 - Transmit FIFO threshold\n\n DMA request will not be asserted if `transmit_available` is less than this value"]
41 #[inline(always)]
42 #[must_use]
43 pub fn transmit_threshold(&mut self) -> TRANSMIT_THRESHOLD_W<FIFO_CONFIG_1_SPEC> {
44 TRANSMIT_THRESHOLD_W::new(self, 16)
45 }
46 #[doc = "Bits 24:27 - Receive FIFO threshold\n\n DMA request will not be asserted if `receive_available` is less than this value"]
47 #[inline(always)]
48 #[must_use]
49 pub fn receive_threshold(&mut self) -> RECEIVE_THRESHOLD_W<FIFO_CONFIG_1_SPEC> {
50 RECEIVE_THRESHOLD_W::new(self, 24)
51 }
52 #[doc = r" Writes raw bits to the register."]
53 #[doc = r""]
54 #[doc = r" # Safety"]
55 #[doc = r""]
56 #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
57 #[inline(always)]
58 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
59 self.bits = bits;
60 self
61 }
62}
63#[doc = "FIFO configuration register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fifo_config_1::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 [`fifo_config_1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
64pub struct FIFO_CONFIG_1_SPEC;
65impl crate::RegisterSpec for FIFO_CONFIG_1_SPEC {
66 type Ux = u32;
67}
68#[doc = "`read()` method returns [`fifo_config_1::R`](R) reader structure"]
69impl crate::Readable for FIFO_CONFIG_1_SPEC {}
70#[doc = "`write(|w| ..)` method takes [`fifo_config_1::W`](W) writer structure"]
71impl crate::Writable for FIFO_CONFIG_1_SPEC {
72 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
73 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
74}
75#[doc = "`reset()` method sets fifo_config_1 to value 0x10"]
76impl crate::Resettable for FIFO_CONFIG_1_SPEC {
77 const RESET_VALUE: Self::Ux = 0x10;
78}