lpc54606_pac/sdif/
tmout.rs

1#[doc = "Reader of register TMOUT"]
2pub type R = crate::R<u32, super::TMOUT>;
3#[doc = "Writer for register TMOUT"]
4pub type W = crate::W<u32, super::TMOUT>;
5#[doc = "Register TMOUT `reset()`'s with value 0xffff_ff40"]
6impl crate::ResetValue for super::TMOUT {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0xffff_ff40
11    }
12}
13#[doc = "Reader of field `RESPONSE_TIMEOUT`"]
14pub type RESPONSE_TIMEOUT_R = crate::R<u8, u8>;
15#[doc = "Write proxy for field `RESPONSE_TIMEOUT`"]
16pub struct RESPONSE_TIMEOUT_W<'a> {
17    w: &'a mut W,
18}
19impl<'a> RESPONSE_TIMEOUT_W<'a> {
20    #[doc = r"Writes raw bits to the field"]
21    #[inline(always)]
22    pub unsafe fn bits(self, value: u8) -> &'a mut W {
23        self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff);
24        self.w
25    }
26}
27#[doc = "Reader of field `DATA_TIMEOUT`"]
28pub type DATA_TIMEOUT_R = crate::R<u32, u32>;
29#[doc = "Write proxy for field `DATA_TIMEOUT`"]
30pub struct DATA_TIMEOUT_W<'a> {
31    w: &'a mut W,
32}
33impl<'a> DATA_TIMEOUT_W<'a> {
34    #[doc = r"Writes raw bits to the field"]
35    #[inline(always)]
36    pub unsafe fn bits(self, value: u32) -> &'a mut W {
37        self.w.bits = (self.w.bits & !(0x00ff_ffff << 8)) | (((value as u32) & 0x00ff_ffff) << 8);
38        self.w
39    }
40}
41impl R {
42    #[doc = "Bits 0:7 - Response time-out value."]
43    #[inline(always)]
44    pub fn response_timeout(&self) -> RESPONSE_TIMEOUT_R {
45        RESPONSE_TIMEOUT_R::new((self.bits & 0xff) as u8)
46    }
47    #[doc = "Bits 8:31 - Value for card Data Read time-out; same value also used for Data Starvation by Host time-out."]
48    #[inline(always)]
49    pub fn data_timeout(&self) -> DATA_TIMEOUT_R {
50        DATA_TIMEOUT_R::new(((self.bits >> 8) & 0x00ff_ffff) as u32)
51    }
52}
53impl W {
54    #[doc = "Bits 0:7 - Response time-out value."]
55    #[inline(always)]
56    pub fn response_timeout(&mut self) -> RESPONSE_TIMEOUT_W {
57        RESPONSE_TIMEOUT_W { w: self }
58    }
59    #[doc = "Bits 8:31 - Value for card Data Read time-out; same value also used for Data Starvation by Host time-out."]
60    #[inline(always)]
61    pub fn data_timeout(&mut self) -> DATA_TIMEOUT_W {
62        DATA_TIMEOUT_W { w: self }
63    }
64}