d1_pac/dsp_msgbox/msgbox/
msgbox_fifo_status.rs

1#[doc = "Register `msgbox_fifo_status%s` reader"]
2pub type R = crate::R<MSGBOX_FIFO_STATUS_SPEC>;
3#[doc = "Field `fifo_not_ava_flag` reader - FIFO Not Available Flag"]
4pub type FIFO_NOT_AVA_FLAG_R = crate::BitReader<FIFO_NOT_AVA_FLAG_A>;
5#[doc = "FIFO Not Available Flag\n\nValue on reset: 0"]
6#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7pub enum FIFO_NOT_AVA_FLAG_A {
8    #[doc = "0: The Message FIFO queue empty level reaches the configured threshold"]
9    AVAILABLE = 0,
10    #[doc = "1: The Message FIFO queue empty level does not reach the configured threshold"]
11    NOT_AVAILABLE = 1,
12}
13impl From<FIFO_NOT_AVA_FLAG_A> for bool {
14    #[inline(always)]
15    fn from(variant: FIFO_NOT_AVA_FLAG_A) -> Self {
16        variant as u8 != 0
17    }
18}
19impl FIFO_NOT_AVA_FLAG_R {
20    #[doc = "Get enumerated values variant"]
21    #[inline(always)]
22    pub const fn variant(&self) -> FIFO_NOT_AVA_FLAG_A {
23        match self.bits {
24            false => FIFO_NOT_AVA_FLAG_A::AVAILABLE,
25            true => FIFO_NOT_AVA_FLAG_A::NOT_AVAILABLE,
26        }
27    }
28    #[doc = "The Message FIFO queue empty level reaches the configured threshold"]
29    #[inline(always)]
30    pub fn is_available(&self) -> bool {
31        *self == FIFO_NOT_AVA_FLAG_A::AVAILABLE
32    }
33    #[doc = "The Message FIFO queue empty level does not reach the configured threshold"]
34    #[inline(always)]
35    pub fn is_not_available(&self) -> bool {
36        *self == FIFO_NOT_AVA_FLAG_A::NOT_AVAILABLE
37    }
38}
39impl R {
40    #[doc = "Bit 0 - FIFO Not Available Flag"]
41    #[inline(always)]
42    pub fn fifo_not_ava_flag(&self) -> FIFO_NOT_AVA_FLAG_R {
43        FIFO_NOT_AVA_FLAG_R::new((self.bits & 1) != 0)
44    }
45}
46#[doc = "Message Box FIFO Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`msgbox_fifo_status::R`](R).  See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
47pub struct MSGBOX_FIFO_STATUS_SPEC;
48impl crate::RegisterSpec for MSGBOX_FIFO_STATUS_SPEC {
49    type Ux = u32;
50}
51#[doc = "`read()` method returns [`msgbox_fifo_status::R`](R) reader structure"]
52impl crate::Readable for MSGBOX_FIFO_STATUS_SPEC {}
53#[doc = "`reset()` method sets msgbox_fifo_status%s to value 0"]
54impl crate::Resettable for MSGBOX_FIFO_STATUS_SPEC {
55    const RESET_VALUE: Self::Ux = 0;
56}