Skip to main content

efm32pg1b_pac/i2c0/
txdouble.rs

1///Register `TXDOUBLE` reader
2pub type R = crate::R<TXDOUBLErs>;
3///Register `TXDOUBLE` writer
4pub type W = crate::W<TXDOUBLErs>;
5///Field `TXDATA0` reader - TX Data
6pub type Txdata0R = crate::FieldReader;
7///Field `TXDATA0` writer - TX Data
8pub type Txdata0W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9///Field `TXDATA1` reader - TX Data
10pub type Txdata1R = crate::FieldReader;
11///Field `TXDATA1` writer - TX Data
12pub type Txdata1W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
13impl R {
14    ///Bits 0:7 - TX Data
15    #[inline(always)]
16    pub fn txdata0(&self) -> Txdata0R {
17        Txdata0R::new((self.bits & 0xff) as u8)
18    }
19    ///Bits 8:15 - TX Data
20    #[inline(always)]
21    pub fn txdata1(&self) -> Txdata1R {
22        Txdata1R::new(((self.bits >> 8) & 0xff) as u8)
23    }
24}
25impl core::fmt::Debug for R {
26    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
27        f.debug_struct("TXDOUBLE")
28            .field("txdata0", &self.txdata0())
29            .field("txdata1", &self.txdata1())
30            .finish()
31    }
32}
33impl W {
34    ///Bits 0:7 - TX Data
35    #[inline(always)]
36    pub fn txdata0(&mut self) -> Txdata0W<'_, TXDOUBLErs> {
37        Txdata0W::new(self, 0)
38    }
39    ///Bits 8:15 - TX Data
40    #[inline(always)]
41    pub fn txdata1(&mut self) -> Txdata1W<'_, TXDOUBLErs> {
42        Txdata1W::new(self, 8)
43    }
44}
45///Transmit Buffer Double Data Register
46///
47///You can [`read`](crate::Reg::read) this register and get [`txdouble::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`txdouble::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
48pub struct TXDOUBLErs;
49impl crate::RegisterSpec for TXDOUBLErs {
50    type Ux = u32;
51}
52///`read()` method returns [`txdouble::R`](R) reader structure
53impl crate::Readable for TXDOUBLErs {}
54///`write(|w| ..)` method takes [`txdouble::W`](W) writer structure
55impl crate::Writable for TXDOUBLErs {
56    type Safety = crate::Unsafe;
57}
58///`reset()` method sets TXDOUBLE to value 0
59impl crate::Resettable for TXDOUBLErs {}