corstone300_pac/audio_i2s/
status.rs

1// Copyright 2022 Arm Limited and/or its affiliates <open-source-office@arm.com>
2//
3// SPDX-License-Identifier: MIT
4
5#[doc = "Register `STATUS` reader"]
6pub struct R(crate::R<STATUS_SPEC>);
7impl core::ops::Deref for R {
8    type Target = crate::R<STATUS_SPEC>;
9    #[inline(always)]
10    fn deref(&self) -> &Self::Target {
11        &self.0
12    }
13}
14impl From<crate::R<STATUS_SPEC>> for R {
15    #[inline(always)]
16    fn from(reader: crate::R<STATUS_SPEC>) -> Self {
17        R(reader)
18    }
19}
20#[doc = "Field `TxBuffAlert` reader - Transmit Buffer Alert (Depends on Water level)"]
21pub type TX_BUFF_ALERT_R = crate::BitReader<bool>;
22#[doc = "Field `RxBuffAlert` reader - Receive Buffer Alert (Depends on Water level)"]
23pub type RX_BUFF_ALERT_R = crate::BitReader<bool>;
24#[doc = "Field `TxBuffEmpty` reader - Transmit Buffer Empty"]
25pub type TX_BUFF_EMPTY_R = crate::BitReader<bool>;
26#[doc = "Field `TxBuffFull` reader - Transmit Buffer Full"]
27pub type TX_BUFF_FULL_R = crate::BitReader<bool>;
28#[doc = "Field `RxBuffEmpty` reader - Receive Buffer Empty"]
29pub type RX_BUFF_EMPTY_R = crate::BitReader<bool>;
30#[doc = "Field `RxBuffFull` reader - Receive Buffer Full"]
31pub type RX_BUFF_FULL_R = crate::BitReader<bool>;
32impl R {
33    #[doc = "Bit 0 - Transmit Buffer Alert (Depends on Water level)"]
34    #[inline(always)]
35    pub fn tx_buff_alert(&self) -> TX_BUFF_ALERT_R {
36        TX_BUFF_ALERT_R::new((self.bits & 1) != 0)
37    }
38    #[doc = "Bit 1 - Receive Buffer Alert (Depends on Water level)"]
39    #[inline(always)]
40    pub fn rx_buff_alert(&self) -> RX_BUFF_ALERT_R {
41        RX_BUFF_ALERT_R::new(((self.bits >> 1) & 1) != 0)
42    }
43    #[doc = "Bit 2 - Transmit Buffer Empty"]
44    #[inline(always)]
45    pub fn tx_buff_empty(&self) -> TX_BUFF_EMPTY_R {
46        TX_BUFF_EMPTY_R::new(((self.bits >> 2) & 1) != 0)
47    }
48    #[doc = "Bit 3 - Transmit Buffer Full"]
49    #[inline(always)]
50    pub fn tx_buff_full(&self) -> TX_BUFF_FULL_R {
51        TX_BUFF_FULL_R::new(((self.bits >> 3) & 1) != 0)
52    }
53    #[doc = "Bit 4 - Receive Buffer Empty"]
54    #[inline(always)]
55    pub fn rx_buff_empty(&self) -> RX_BUFF_EMPTY_R {
56        RX_BUFF_EMPTY_R::new(((self.bits >> 4) & 1) != 0)
57    }
58    #[doc = "Bit 5 - Receive Buffer Full"]
59    #[inline(always)]
60    pub fn rx_buff_full(&self) -> RX_BUFF_FULL_R {
61        RX_BUFF_FULL_R::new(((self.bits >> 5) & 1) != 0)
62    }
63}
64#[doc = "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 [status](index.html) module"]
65pub struct STATUS_SPEC;
66impl crate::RegisterSpec for STATUS_SPEC {
67    type Ux = u32;
68}
69#[doc = "`read()` method returns [status::R](R) reader structure"]
70impl crate::Readable for STATUS_SPEC {
71    type Reader = R;
72}
73#[doc = "`reset()` method sets STATUS to value 0"]
74impl crate::Resettable for STATUS_SPEC {
75    #[inline(always)]
76    fn reset_value() -> Self::Ux {
77        0
78    }
79}