1#[doc = "Register `IC_SDA_HOLD` reader"]
2pub type R = crate::R<IC_SDA_HOLD_SPEC>;
3#[doc = "Register `IC_SDA_HOLD` writer"]
4pub type W = crate::W<IC_SDA_HOLD_SPEC>;
5#[doc = "Field `IC_SDA_TX_HOLD` reader - Sets the required SDA hold time in units of ic_clk period, when DW_apb_i2c acts as a transmitter.
67 Reset value: IC_DEFAULT_SDA_HOLD\\[15:0\\]."]
8pub type IC_SDA_TX_HOLD_R = crate::FieldReader<u16>;
9#[doc = "Field `IC_SDA_TX_HOLD` writer - Sets the required SDA hold time in units of ic_clk period, when DW_apb_i2c acts as a transmitter.
1011 Reset value: IC_DEFAULT_SDA_HOLD\\[15:0\\]."]
12pub type IC_SDA_TX_HOLD_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
13#[doc = "Field `IC_SDA_RX_HOLD` reader - Sets the required SDA hold time in units of ic_clk period, when DW_apb_i2c acts as a receiver.
1415 Reset value: IC_DEFAULT_SDA_HOLD\\[23:16\\]."]
16pub type IC_SDA_RX_HOLD_R = crate::FieldReader;
17#[doc = "Field `IC_SDA_RX_HOLD` writer - Sets the required SDA hold time in units of ic_clk period, when DW_apb_i2c acts as a receiver.
1819 Reset value: IC_DEFAULT_SDA_HOLD\\[23:16\\]."]
20pub type IC_SDA_RX_HOLD_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
21impl R {
22#[doc = "Bits 0:15 - Sets the required SDA hold time in units of ic_clk period, when DW_apb_i2c acts as a transmitter.
2324 Reset value: IC_DEFAULT_SDA_HOLD\\[15:0\\]."]
25 #[inline(always)]
26pub fn ic_sda_tx_hold(&self) -> IC_SDA_TX_HOLD_R {
27 IC_SDA_TX_HOLD_R::new((self.bits & 0xffff) as u16)
28 }
29#[doc = "Bits 16:23 - Sets the required SDA hold time in units of ic_clk period, when DW_apb_i2c acts as a receiver.
3031 Reset value: IC_DEFAULT_SDA_HOLD\\[23:16\\]."]
32 #[inline(always)]
33pub fn ic_sda_rx_hold(&self) -> IC_SDA_RX_HOLD_R {
34 IC_SDA_RX_HOLD_R::new(((self.bits >> 16) & 0xff) as u8)
35 }
36}
37impl W {
38#[doc = "Bits 0:15 - Sets the required SDA hold time in units of ic_clk period, when DW_apb_i2c acts as a transmitter.
3940 Reset value: IC_DEFAULT_SDA_HOLD\\[15:0\\]."]
41 #[inline(always)]
42 #[must_use]
43pub fn ic_sda_tx_hold(&mut self) -> IC_SDA_TX_HOLD_W<IC_SDA_HOLD_SPEC> {
44 IC_SDA_TX_HOLD_W::new(self, 0)
45 }
46#[doc = "Bits 16:23 - Sets the required SDA hold time in units of ic_clk period, when DW_apb_i2c acts as a receiver.
4748 Reset value: IC_DEFAULT_SDA_HOLD\\[23:16\\]."]
49 #[inline(always)]
50 #[must_use]
51pub fn ic_sda_rx_hold(&mut self) -> IC_SDA_RX_HOLD_W<IC_SDA_HOLD_SPEC> {
52 IC_SDA_RX_HOLD_W::new(self, 16)
53 }
54#[doc = r" Writes raw bits to the register."]
55 #[doc = r""]
56 #[doc = r" # Safety"]
57 #[doc = r""]
58 #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
59 #[inline(always)]
60pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
61self.bits = bits;
62self
63}
64}
65#[doc = "I2C SDA Hold Time Length Register
6667 The bits \\[15:0\\]
68of this register are used to control the hold time of SDA during transmit in both slave and master mode (after SCL goes from HIGH to LOW).
6970 The bits \\[23:16\\]
71of this register are used to extend the SDA transition (if any) whenever SCL is HIGH in the receiver in either master or slave mode.
7273 Writes to this register succeed only when IC_ENABLE\\[0\\]=0.
7475 The values in this register are in units of ic_clk period. The value programmed in IC_SDA_TX_HOLD must be greater than the minimum hold time in each mode (one cycle in master mode, seven cycles in slave mode) for the value to be implemented.
7677 The programmed SDA hold time during transmit (IC_SDA_TX_HOLD) cannot exceed at any time the duration of the low part of scl. Therefore the programmed value cannot be larger than N_SCL_LOW-2, where N_SCL_LOW is the duration of the low part of the scl period measured in ic_clk cycles.
7879You can [`read`](crate::generic::Reg::read) this register and get [`ic_sda_hold::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ic_sda_hold::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
80pub struct IC_SDA_HOLD_SPEC;
81impl crate::RegisterSpec for IC_SDA_HOLD_SPEC {
82type Ux = u32;
83}
84#[doc = "`read()` method returns [`ic_sda_hold::R`](R) reader structure"]
85impl crate::Readable for IC_SDA_HOLD_SPEC {}
86#[doc = "`write(|w| ..)` method takes [`ic_sda_hold::W`](W) writer structure"]
87impl crate::Writable for IC_SDA_HOLD_SPEC {
88const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
89const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
90}
91#[doc = "`reset()` method sets IC_SDA_HOLD to value 0x01"]
92impl crate::Resettable for IC_SDA_HOLD_SPEC {
93const RESET_VALUE: u32 = 0x01;
94}