mtb_pac_psoc6_01 0.1.1

Peripheral Access Crate for Infineon CY8C6xx6 and CY8C6xx7 PSOCâ„¢ 6 microcontrollers
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
/*
(c) (2016-2024), Cypress Semiconductor Corporation (an Infineon company)

    or an affiliate of Cypress Semiconductor Corporation.



    SPDX-License-Identifier: Apache-2.0



    Licensed under the Apache License, Version 2.0 (the "License");

    you may not use this file except in compliance with the License.

    You may obtain a copy of the License at



      http://www.apache.org/licenses/LICENSE-2.0



    Unless required by applicable law or agreed to in writing, software

    distributed under the License is distributed on an "AS IS" BASIS,

    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

    See the License for the specific language governing permissions and

    limitations under the License.
*/
// Generated from SVD 1.0, with svd2pac 0.6.0 on Tue, 27 May 2025 19:21:54 +0000

#![allow(clippy::identity_op)]
#![allow(clippy::module_inception)]
#![allow(clippy::derivable_impls)]
#[allow(unused_imports)]
use crate::common::sealed;
#[allow(unused_imports)]
use crate::common::*;
#[doc = r"High Speed IO Matrix (HSIOM)"]
unsafe impl ::core::marker::Send for super::Hsiom {}
unsafe impl ::core::marker::Sync for super::Hsiom {}
impl super::Hsiom {
    #[allow(unused)]
    #[inline(always)]
    pub(crate) const fn _svd2pac_as_ptr(&self) -> *mut u8 {
        self.ptr
    }

    #[doc = "AMUX splitter cell control"]
    #[inline(always)]
    pub const fn amux_split_ctl(
        &self,
    ) -> &'static crate::common::ClusterRegisterArray<
        crate::common::Reg<self::AmuxSplitCtl_SPEC, crate::common::RW>,
        64,
        0x4,
    > {
        unsafe {
            crate::common::ClusterRegisterArray::from_ptr(self._svd2pac_as_ptr().add(0x2000usize))
        }
    }

    #[doc = "HSIOM port registers"]
    #[inline(always)]
    pub fn prt(self) -> &'static crate::common::ClusterRegisterArray<crate::hsiom::_Prt, 15, 0x10> {
        unsafe {
            crate::common::ClusterRegisterArray::from_ptr(self._svd2pac_as_ptr().add(0x0usize))
        }
    }
}
#[doc(hidden)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct AmuxSplitCtl_SPEC;
impl crate::sealed::RegSpec for AmuxSplitCtl_SPEC {
    type DataType = u32;
}

#[doc = "AMUX splitter cell control"]
pub type AmuxSplitCtl = crate::RegValueT<AmuxSplitCtl_SPEC>;

impl AmuxSplitCtl {
    #[doc = "T-switch control for Left AMUXBUSA switch:\n\'0\': switch open.\n\'1\': switch closed."]
    #[inline(always)]
    pub fn switch_aa_sl(
        self,
    ) -> crate::common::RegisterFieldBool<0, 1, 0, AmuxSplitCtl_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<0,1,0,AmuxSplitCtl_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "T-switch control for Right AMUXBUSA switch:\n\'0\': switch open.\n\'1\': switch closed."]
    #[inline(always)]
    pub fn switch_aa_sr(
        self,
    ) -> crate::common::RegisterFieldBool<1, 1, 0, AmuxSplitCtl_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<1,1,0,AmuxSplitCtl_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "T-switch control for AMUXBUSA vssa/ground switch:\n\'0\': switch open.\n\'1\': switch closed."]
    #[inline(always)]
    pub fn switch_aa_s0(
        self,
    ) -> crate::common::RegisterFieldBool<2, 1, 0, AmuxSplitCtl_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<2,1,0,AmuxSplitCtl_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "T-switch control for Left AMUXBUSB switch."]
    #[inline(always)]
    pub fn switch_bb_sl(
        self,
    ) -> crate::common::RegisterFieldBool<4, 1, 0, AmuxSplitCtl_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<4,1,0,AmuxSplitCtl_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "T-switch control for Right AMUXBUSB switch."]
    #[inline(always)]
    pub fn switch_bb_sr(
        self,
    ) -> crate::common::RegisterFieldBool<5, 1, 0, AmuxSplitCtl_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<5,1,0,AmuxSplitCtl_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "T-switch control for AMUXBUSB vssa/ground switch."]
    #[inline(always)]
    pub fn switch_bb_s0(
        self,
    ) -> crate::common::RegisterFieldBool<6, 1, 0, AmuxSplitCtl_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<6,1,0,AmuxSplitCtl_SPEC,crate::common::RW>::from_register(self,0)
    }
}
impl ::core::default::Default for AmuxSplitCtl {
    #[inline(always)]
    fn default() -> AmuxSplitCtl {
        <crate::RegValueT<AmuxSplitCtl_SPEC> as RegisterValue<_>>::new(0)
    }
}

#[doc = "HSIOM port registers"]
#[non_exhaustive]
pub struct _Prt;

#[doc = "HSIOM port registers"]
pub type Prt = &'static _Prt;

unsafe impl ::core::marker::Sync for _Prt {}
impl _Prt {
    #[allow(unused)]
    #[inline(always)]
    pub(crate) const unsafe fn _svd2pac_from_ptr(ptr: *mut u8) -> &'static Self {
        &*(ptr as *const _)
    }

    #[allow(unused)]
    #[inline(always)]
    pub(crate) const fn _svd2pac_as_ptr(&self) -> *mut u8 {
        self as *const Self as *mut u8
    }

    #[doc = "Port selection 0"]
    #[inline(always)]
    pub const fn port_sel0(
        &self,
    ) -> &'static crate::common::Reg<prt::PortSel0_SPEC, crate::common::RW> {
        unsafe {
            crate::common::Reg::<prt::PortSel0_SPEC, crate::common::RW>::from_ptr(
                self._svd2pac_as_ptr().add(0usize),
            )
        }
    }

    #[doc = "Port selection 1"]
    #[inline(always)]
    pub const fn port_sel1(
        &self,
    ) -> &'static crate::common::Reg<prt::PortSel1_SPEC, crate::common::RW> {
        unsafe {
            crate::common::Reg::<prt::PortSel1_SPEC, crate::common::RW>::from_ptr(
                self._svd2pac_as_ptr().add(4usize),
            )
        }
    }
}
pub mod prt {
    #[allow(unused_imports)]
    use crate::common::*;
    #[doc(hidden)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct PortSel0_SPEC;
    impl crate::sealed::RegSpec for PortSel0_SPEC {
        type DataType = u32;
    }

    #[doc = "Port selection 0"]
    pub type PortSel0 = crate::RegValueT<PortSel0_SPEC>;

    impl PortSel0 {
        #[doc = "Selects the peripheral connections of Pin 0. Note that available connectivity options vary depending on the device, port and the pin. See the device Datasheet for a list of peripheral connections available at each pin."]
        #[inline(always)]
        pub fn io0_sel(
            self,
        ) -> crate::common::RegisterField<
            0,
            0x1f,
            1,
            0,
            port_sel0::Io0Sel,
            port_sel0::Io0Sel,
            PortSel0_SPEC,
            crate::common::RW,
        > {
            crate::common::RegisterField::<
                0,
                0x1f,
                1,
                0,
                port_sel0::Io0Sel,
                port_sel0::Io0Sel,
                PortSel0_SPEC,
                crate::common::RW,
            >::from_register(self, 0)
        }

        #[doc = "Selects the peripheral connections of Pin 1."]
        #[inline(always)]
        pub fn io1_sel(
            self,
        ) -> crate::common::RegisterField<8, 0x1f, 1, 0, u8, u8, PortSel0_SPEC, crate::common::RW>
        {
            crate::common::RegisterField::<8,0x1f,1,0,u8,u8,PortSel0_SPEC,crate::common::RW>::from_register(self,0)
        }

        #[doc = "Selects the peripheral connections of Pin 2."]
        #[inline(always)]
        pub fn io2_sel(
            self,
        ) -> crate::common::RegisterField<16, 0x1f, 1, 0, u8, u8, PortSel0_SPEC, crate::common::RW>
        {
            crate::common::RegisterField::<16,0x1f,1,0,u8,u8,PortSel0_SPEC,crate::common::RW>::from_register(self,0)
        }

        #[doc = "Selects the peripheral connections of Pin 3."]
        #[inline(always)]
        pub fn io3_sel(
            self,
        ) -> crate::common::RegisterField<24, 0x1f, 1, 0, u8, u8, PortSel0_SPEC, crate::common::RW>
        {
            crate::common::RegisterField::<24,0x1f,1,0,u8,u8,PortSel0_SPEC,crate::common::RW>::from_register(self,0)
        }
    }
    impl ::core::default::Default for PortSel0 {
        #[inline(always)]
        fn default() -> PortSel0 {
            <crate::RegValueT<PortSel0_SPEC> as RegisterValue<_>>::new(0)
        }
    }
    pub mod port_sel0 {

        #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
        pub struct Io0Sel_SPEC;
        pub type Io0Sel = crate::EnumBitfieldStruct<u8, Io0Sel_SPEC>;
        impl Io0Sel {
            #[doc = "GPIO controls \'out\'"]
            pub const GPIO: Self = Self::new(0);

            #[doc = "GPIO controls \'out\', DSI controls \'output enable\'"]
            pub const GPIO_DSI: Self = Self::new(1);

            #[doc = "DSI controls \'out\' and \'output enable\'"]
            pub const DSI_DSI: Self = Self::new(2);

            #[doc = "DSI controls \'out\', GPIO controls \'output enable\'"]
            pub const DSI_GPIO: Self = Self::new(3);

            #[doc = "Analog mux bus A"]
            pub const AMUXA: Self = Self::new(4);

            #[doc = "Analog mux bus B"]
            pub const AMUXB: Self = Self::new(5);

            #[doc = "Analog mux bus A, DSI control"]
            pub const AMUXA_DSI: Self = Self::new(6);

            #[doc = "Analog mux bus B, DSI control"]
            pub const AMUXB_DSI: Self = Self::new(7);

            #[doc = "Active functionality 0"]
            pub const ACT_0: Self = Self::new(8);

            #[doc = "Active functionality 1"]
            pub const ACT_1: Self = Self::new(9);

            #[doc = "Active functionality 2"]
            pub const ACT_2: Self = Self::new(10);

            #[doc = "Active functionality 3"]
            pub const ACT_3: Self = Self::new(11);

            #[doc = "DeepSleep functionality 0"]
            pub const DS_0: Self = Self::new(12);

            #[doc = "DeepSleep functionality 1"]
            pub const DS_1: Self = Self::new(13);

            #[doc = "DeepSleep functionality 2"]
            pub const DS_2: Self = Self::new(14);

            #[doc = "DeepSleep functionality 3"]
            pub const DS_3: Self = Self::new(15);

            #[doc = "Active functionality 4"]
            pub const ACT_4: Self = Self::new(16);

            #[doc = "Active functionality 5"]
            pub const ACT_5: Self = Self::new(17);

            #[doc = "Active functionality 6"]
            pub const ACT_6: Self = Self::new(18);

            #[doc = "Active functionality 7"]
            pub const ACT_7: Self = Self::new(19);

            #[doc = "Active functionality 8"]
            pub const ACT_8: Self = Self::new(20);

            #[doc = "Active functionality 9"]
            pub const ACT_9: Self = Self::new(21);

            #[doc = "Active functionality 10"]
            pub const ACT_10: Self = Self::new(22);

            #[doc = "Active functionality 11"]
            pub const ACT_11: Self = Self::new(23);

            #[doc = "Active functionality 12"]
            pub const ACT_12: Self = Self::new(24);

            #[doc = "Active functionality 13"]
            pub const ACT_13: Self = Self::new(25);

            #[doc = "Active functionality 14"]
            pub const ACT_14: Self = Self::new(26);

            #[doc = "Active functionality 15"]
            pub const ACT_15: Self = Self::new(27);

            #[doc = "DeepSleep functionality 4"]
            pub const DS_4: Self = Self::new(28);

            #[doc = "DeepSleep functionality 5"]
            pub const DS_5: Self = Self::new(29);

            #[doc = "DeepSleep functionality 6"]
            pub const DS_6: Self = Self::new(30);

            #[doc = "DeepSleep functionality 7"]
            pub const DS_7: Self = Self::new(31);
        }
    }
    #[doc(hidden)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct PortSel1_SPEC;
    impl crate::sealed::RegSpec for PortSel1_SPEC {
        type DataType = u32;
    }

    #[doc = "Port selection 1"]
    pub type PortSel1 = crate::RegValueT<PortSel1_SPEC>;

    impl PortSel1 {
        #[doc = "Selects the peripheral connections of Pin 4. See PORT_SEL0 for connection details."]
        #[inline(always)]
        pub fn io4_sel(
            self,
        ) -> crate::common::RegisterField<0, 0x1f, 1, 0, u8, u8, PortSel1_SPEC, crate::common::RW>
        {
            crate::common::RegisterField::<0,0x1f,1,0,u8,u8,PortSel1_SPEC,crate::common::RW>::from_register(self,0)
        }

        #[doc = "Selects the peripheral connections of Pin 4."]
        #[inline(always)]
        pub fn io5_sel(
            self,
        ) -> crate::common::RegisterField<8, 0x1f, 1, 0, u8, u8, PortSel1_SPEC, crate::common::RW>
        {
            crate::common::RegisterField::<8,0x1f,1,0,u8,u8,PortSel1_SPEC,crate::common::RW>::from_register(self,0)
        }

        #[doc = "Selects the peripheral connections of Pin 5."]
        #[inline(always)]
        pub fn io6_sel(
            self,
        ) -> crate::common::RegisterField<16, 0x1f, 1, 0, u8, u8, PortSel1_SPEC, crate::common::RW>
        {
            crate::common::RegisterField::<16,0x1f,1,0,u8,u8,PortSel1_SPEC,crate::common::RW>::from_register(self,0)
        }

        #[doc = "Selects the peripheral connections of Pin 6."]
        #[inline(always)]
        pub fn io7_sel(
            self,
        ) -> crate::common::RegisterField<24, 0x1f, 1, 0, u8, u8, PortSel1_SPEC, crate::common::RW>
        {
            crate::common::RegisterField::<24,0x1f,1,0,u8,u8,PortSel1_SPEC,crate::common::RW>::from_register(self,0)
        }
    }
    impl ::core::default::Default for PortSel1 {
        #[inline(always)]
        fn default() -> PortSel1 {
            <crate::RegValueT<PortSel1_SPEC> as RegisterValue<_>>::new(0)
        }
    }
}