1#![allow(clippy::identity_op)]
21#![allow(clippy::module_inception)]
22#![allow(clippy::derivable_impls)]
23#[allow(unused_imports)]
24use crate::common::sealed;
25#[allow(unused_imports)]
26use crate::common::*;
27#[doc = r"Infrared Data Association"]
28unsafe impl ::core::marker::Send for super::Irda {}
29unsafe impl ::core::marker::Sync for super::Irda {}
30impl super::Irda {
31 #[allow(unused)]
32 #[inline(always)]
33 pub(crate) const fn _svd2pac_as_ptr(&self) -> *mut u8 {
34 self.ptr
35 }
36
37 #[doc = "IrDA Control Register"]
38 #[inline(always)]
39 pub const fn ircr(&self) -> &'static crate::common::Reg<self::Ircr_SPEC, crate::common::RW> {
40 unsafe {
41 crate::common::Reg::<self::Ircr_SPEC, crate::common::RW>::from_ptr(
42 self._svd2pac_as_ptr().add(0usize),
43 )
44 }
45 }
46}
47#[doc(hidden)]
48#[derive(Copy, Clone, Eq, PartialEq)]
49pub struct Ircr_SPEC;
50impl crate::sealed::RegSpec for Ircr_SPEC {
51 type DataType = u8;
52}
53
54#[doc = "IrDA Control Register"]
55pub type Ircr = crate::RegValueT<Ircr_SPEC>;
56
57impl Ircr {
58 #[doc = "IrDA Enable"]
59 #[inline(always)]
60 pub fn ire(
61 self,
62 ) -> crate::common::RegisterField<
63 7,
64 0x1,
65 1,
66 0,
67 ircr::Ire,
68 ircr::Ire,
69 Ircr_SPEC,
70 crate::common::RW,
71 > {
72 crate::common::RegisterField::<
73 7,
74 0x1,
75 1,
76 0,
77 ircr::Ire,
78 ircr::Ire,
79 Ircr_SPEC,
80 crate::common::RW,
81 >::from_register(self, 0)
82 }
83
84 #[doc = "IRTXD Polarity Switching"]
85 #[inline(always)]
86 pub fn irtxinv(
87 self,
88 ) -> crate::common::RegisterField<
89 3,
90 0x1,
91 1,
92 0,
93 ircr::Irtxinv,
94 ircr::Irtxinv,
95 Ircr_SPEC,
96 crate::common::RW,
97 > {
98 crate::common::RegisterField::<
99 3,
100 0x1,
101 1,
102 0,
103 ircr::Irtxinv,
104 ircr::Irtxinv,
105 Ircr_SPEC,
106 crate::common::RW,
107 >::from_register(self, 0)
108 }
109
110 #[doc = "IRRXD Polarity Switching"]
111 #[inline(always)]
112 pub fn irrxinv(
113 self,
114 ) -> crate::common::RegisterField<
115 2,
116 0x1,
117 1,
118 0,
119 ircr::Irrxinv,
120 ircr::Irrxinv,
121 Ircr_SPEC,
122 crate::common::RW,
123 > {
124 crate::common::RegisterField::<
125 2,
126 0x1,
127 1,
128 0,
129 ircr::Irrxinv,
130 ircr::Irrxinv,
131 Ircr_SPEC,
132 crate::common::RW,
133 >::from_register(self, 0)
134 }
135}
136impl ::core::default::Default for Ircr {
137 #[inline(always)]
138 fn default() -> Ircr {
139 <crate::RegValueT<Ircr_SPEC> as RegisterValue<_>>::new(0)
140 }
141}
142pub mod ircr {
143
144 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
145 pub struct Ire_SPEC;
146 pub type Ire = crate::EnumBitfieldStruct<u8, Ire_SPEC>;
147 impl Ire {
148 #[doc = "Serial I/O pins are used for normal serial communication."]
149 pub const _0: Self = Self::new(0);
150
151 #[doc = "Serial I/O pins are used for IrDA data communication."]
152 pub const _1: Self = Self::new(1);
153 }
154 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
155 pub struct Irtxinv_SPEC;
156 pub type Irtxinv = crate::EnumBitfieldStruct<u8, Irtxinv_SPEC>;
157 impl Irtxinv {
158 #[doc = "Data to be transmitted is output to IRTXD as is."]
159 pub const _0: Self = Self::new(0);
160
161 #[doc = "Data to be transmitted is output to IRTXD after the polarity is inverted."]
162 pub const _1: Self = Self::new(1);
163 }
164 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
165 pub struct Irrxinv_SPEC;
166 pub type Irrxinv = crate::EnumBitfieldStruct<u8, Irrxinv_SPEC>;
167 impl Irrxinv {
168 #[doc = "IRRXD input is used as received data as is."]
169 pub const _0: Self = Self::new(0);
170
171 #[doc = "IRRXD input is used as received data after the polarity is inverted."]
172 pub const _1: Self = Self::new(1);
173 }
174}