efm32gg11b510_pac/can0/
transreq.rs

1#[doc = "Register `TRANSREQ` reader"]
2pub struct R(crate::R<TRANSREQ_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<TRANSREQ_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<TRANSREQ_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<TRANSREQ_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Transmission Request Bits (Of All Message Objects)\n\nValue on reset: 0"]
17#[derive(Clone, Copy, Debug, PartialEq)]
18#[repr(u32)]
19pub enum TXRQSTOUT_A {
20    #[doc = "0: This Message Object is not waiting for transmission."]
21    FALSE = 0,
22    #[doc = "1: The transmission of this Message Object is requested and is not yet done."]
23    TRUE = 1,
24}
25impl From<TXRQSTOUT_A> for u32 {
26    #[inline(always)]
27    fn from(variant: TXRQSTOUT_A) -> Self {
28        variant as _
29    }
30}
31#[doc = "Field `TXRQSTOUT` reader - Transmission Request Bits (Of All Message Objects)"]
32pub type TXRQSTOUT_R = crate::FieldReader<u32, TXRQSTOUT_A>;
33impl TXRQSTOUT_R {
34    #[doc = "Get enumerated values variant"]
35    #[inline(always)]
36    pub fn variant(&self) -> Option<TXRQSTOUT_A> {
37        match self.bits {
38            0 => Some(TXRQSTOUT_A::FALSE),
39            1 => Some(TXRQSTOUT_A::TRUE),
40            _ => None,
41        }
42    }
43    #[doc = "Checks if the value of the field is `FALSE`"]
44    #[inline(always)]
45    pub fn is_false(&self) -> bool {
46        *self == TXRQSTOUT_A::FALSE
47    }
48    #[doc = "Checks if the value of the field is `TRUE`"]
49    #[inline(always)]
50    pub fn is_true(&self) -> bool {
51        *self == TXRQSTOUT_A::TRUE
52    }
53}
54impl R {
55    #[doc = "Bits 0:31 - Transmission Request Bits (Of All Message Objects)"]
56    #[inline(always)]
57    pub fn txrqstout(&self) -> TXRQSTOUT_R {
58        TXRQSTOUT_R::new(self.bits)
59    }
60}
61#[doc = "Transmission Request 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 [transreq](index.html) module"]
62pub struct TRANSREQ_SPEC;
63impl crate::RegisterSpec for TRANSREQ_SPEC {
64    type Ux = u32;
65}
66#[doc = "`read()` method returns [transreq::R](R) reader structure"]
67impl crate::Readable for TRANSREQ_SPEC {
68    type Reader = R;
69}
70#[doc = "`reset()` method sets TRANSREQ to value 0"]
71impl crate::Resettable for TRANSREQ_SPEC {
72    #[inline(always)]
73    fn reset_value() -> Self::Ux {
74        0
75    }
76}