1#[doc = "Register `ISR0` reader"]
2pub struct R(crate::R<ISR0_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<ISR0_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<ISR0_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<ISR0_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Status of Transmit Empty Trigger interrupt. TX FIFO is empty.\n\nValue on reset: 0"]
17#[derive(Clone, Copy, Debug, PartialEq)]
18pub enum TXFE_A {
19 #[doc = "0: TX FIFO write valid."]
20 WRITE_VALID = 0,
21 #[doc = "1: TX FIFO write overrun."]
22 WRITE_OVERRUN = 1,
23}
24impl From<TXFE_A> for bool {
25 #[inline(always)]
26 fn from(variant: TXFE_A) -> Self {
27 variant as u8 != 0
28 }
29}
30#[doc = "Field `TXFE` reader - Status of Transmit Empty Trigger interrupt. TX FIFO is empty."]
31pub struct TXFE_R(crate::FieldReader<bool, TXFE_A>);
32impl TXFE_R {
33 #[inline(always)]
34 pub(crate) fn new(bits: bool) -> Self {
35 TXFE_R(crate::FieldReader::new(bits))
36 }
37 #[doc = r"Get enumerated values variant"]
38 #[inline(always)]
39 pub fn variant(&self) -> TXFE_A {
40 match self.bits {
41 false => TXFE_A::WRITE_VALID,
42 true => TXFE_A::WRITE_OVERRUN,
43 }
44 }
45 #[doc = "Checks if the value of the field is `WRITE_VALID`"]
46 #[inline(always)]
47 pub fn is_write_valid(&self) -> bool {
48 **self == TXFE_A::WRITE_VALID
49 }
50 #[doc = "Checks if the value of the field is `WRITE_OVERRUN`"]
51 #[inline(always)]
52 pub fn is_write_overrun(&self) -> bool {
53 **self == TXFE_A::WRITE_OVERRUN
54 }
55}
56impl core::ops::Deref for TXFE_R {
57 type Target = crate::FieldReader<bool, TXFE_A>;
58 #[inline(always)]
59 fn deref(&self) -> &Self::Target {
60 &self.0
61 }
62}
63#[doc = "Status of Data Overrun interrupt for the TX channel. Attempt to write to full TX FIFO. Dependencies: I2S_TX_CHANNELS > x, where x is the number of transmit channel.\n\nValue on reset: 0"]
64#[derive(Clone, Copy, Debug, PartialEq)]
65pub enum TXFO_A {
66 #[doc = "0: Trigger level not reached."]
67 TRIGGER_NOT_REACHED = 0,
68 #[doc = "1: Trigger level reached."]
69 TRIGGER_REACHED = 1,
70}
71impl From<TXFO_A> for bool {
72 #[inline(always)]
73 fn from(variant: TXFO_A) -> Self {
74 variant as u8 != 0
75 }
76}
77#[doc = "Field `TXFO` reader - Status of Data Overrun interrupt for the TX channel. Attempt to write to full TX FIFO. Dependencies: I2S_TX_CHANNELS > x, where x is the number of transmit channel."]
78pub struct TXFO_R(crate::FieldReader<bool, TXFO_A>);
79impl TXFO_R {
80 #[inline(always)]
81 pub(crate) fn new(bits: bool) -> Self {
82 TXFO_R(crate::FieldReader::new(bits))
83 }
84 #[doc = r"Get enumerated values variant"]
85 #[inline(always)]
86 pub fn variant(&self) -> TXFO_A {
87 match self.bits {
88 false => TXFO_A::TRIGGER_NOT_REACHED,
89 true => TXFO_A::TRIGGER_REACHED,
90 }
91 }
92 #[doc = "Checks if the value of the field is `TRIGGER_NOT_REACHED`"]
93 #[inline(always)]
94 pub fn is_trigger_not_reached(&self) -> bool {
95 **self == TXFO_A::TRIGGER_NOT_REACHED
96 }
97 #[doc = "Checks if the value of the field is `TRIGGER_REACHED`"]
98 #[inline(always)]
99 pub fn is_trigger_reached(&self) -> bool {
100 **self == TXFO_A::TRIGGER_REACHED
101 }
102}
103impl core::ops::Deref for TXFO_R {
104 type Target = crate::FieldReader<bool, TXFO_A>;
105 #[inline(always)]
106 fn deref(&self) -> &Self::Target {
107 &self.0
108 }
109}
110impl R {
111 #[doc = "Bit 4 - Status of Transmit Empty Trigger interrupt. TX FIFO is empty."]
112 #[inline(always)]
113 pub fn txfe(&self) -> TXFE_R {
114 TXFE_R::new(((self.bits >> 4) & 0x01) != 0)
115 }
116 #[doc = "Bit 5 - Status of Data Overrun interrupt for the TX channel. Attempt to write to full TX FIFO. Dependencies: I2S_TX_CHANNELS > x, where x is the number of transmit channel."]
117 #[inline(always)]
118 pub fn txfo(&self) -> TXFO_R {
119 TXFO_R::new(((self.bits >> 5) & 0x01) != 0)
120 }
121}
122#[doc = "Interrupt 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 [isr0](index.html) module"]
123pub struct ISR0_SPEC;
124impl crate::RegisterSpec for ISR0_SPEC {
125 type Ux = u32;
126}
127#[doc = "`read()` method returns [isr0::R](R) reader structure"]
128impl crate::Readable for ISR0_SPEC {
129 type Reader = R;
130}
131#[doc = "`reset()` method sets ISR0 to value 0"]
132impl crate::Resettable for ISR0_SPEC {
133 #[inline(always)]
134 fn reset_value() -> Self::Ux {
135 0
136 }
137}