corstone300_pac/audio_i2s/
itip1.rs

1// Copyright 2022 Arm Limited and/or its affiliates <open-source-office@arm.com>
2//
3// SPDX-License-Identifier: MIT
4
5#[doc = "Register `ITIP1` reader"]
6pub struct R(crate::R<ITIP1_SPEC>);
7impl core::ops::Deref for R {
8    type Target = crate::R<ITIP1_SPEC>;
9    #[inline(always)]
10    fn deref(&self) -> &Self::Target {
11        &self.0
12    }
13}
14impl From<crate::R<ITIP1_SPEC>> for R {
15    #[inline(always)]
16    fn from(reader: crate::R<ITIP1_SPEC>) -> Self {
17        R(reader)
18    }
19}
20#[doc = "Register `ITIP1` writer"]
21pub struct W(crate::W<ITIP1_SPEC>);
22impl core::ops::Deref for W {
23    type Target = crate::W<ITIP1_SPEC>;
24    #[inline(always)]
25    fn deref(&self) -> &Self::Target {
26        &self.0
27    }
28}
29impl core::ops::DerefMut for W {
30    #[inline(always)]
31    fn deref_mut(&mut self) -> &mut Self::Target {
32        &mut self.0
33    }
34}
35impl From<crate::W<ITIP1_SPEC>> for W {
36    #[inline(always)]
37    fn from(writer: crate::W<ITIP1_SPEC>) -> Self {
38        W(writer)
39    }
40}
41#[doc = "Field `SDIN` reader - SDIN pin value"]
42pub type SDIN_R = crate::BitReader<bool>;
43#[doc = "Field `SDIN` writer - SDIN pin value"]
44pub type SDIN_W<'a, const O: u8> = crate::BitWriter<'a, u32, ITIP1_SPEC, bool, O>;
45impl R {
46    #[doc = "Bit 0 - SDIN pin value"]
47    #[inline(always)]
48    pub fn sdin(&self) -> SDIN_R {
49        SDIN_R::new((self.bits & 1) != 0)
50    }
51}
52impl W {
53    #[doc = "Bit 0 - SDIN pin value"]
54    #[inline(always)]
55    pub fn sdin(&mut self) -> SDIN_W<0> {
56        SDIN_W::new(self)
57    }
58    #[doc = "Writes raw bits to the register."]
59    #[inline(always)]
60    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
61        self.0.bits(bits);
62        self
63    }
64}
65#[doc = "Integration Test Input register 1\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [itip1](index.html) module"]
66pub struct ITIP1_SPEC;
67impl crate::RegisterSpec for ITIP1_SPEC {
68    type Ux = u32;
69}
70#[doc = "`read()` method returns [itip1::R](R) reader structure"]
71impl crate::Readable for ITIP1_SPEC {
72    type Reader = R;
73}
74#[doc = "`write(|w| ..)` method takes [itip1::W](W) writer structure"]
75impl crate::Writable for ITIP1_SPEC {
76    type Writer = W;
77}
78#[doc = "`reset()` method sets ITIP1 to value 0"]
79impl crate::Resettable for ITIP1_SPEC {
80    #[inline(always)]
81    fn reset_value() -> Self::Ux {
82        0
83    }
84}