RTEMS 6.1-rc6
Loading...
Searching...
No Matches
spictrl-regs.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
11/*
12 * Copyright (C) 2021 embedded brains GmbH & Co. KG
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
16 * are met:
17 * 1. Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 */
35
36/*
37 * This file is part of the RTEMS quality process and was automatically
38 * generated. If you find something that needs to be fixed or
39 * worded better please post a report or patch to an RTEMS mailing list
40 * or raise a bug report:
41 *
42 * https://www.rtems.org/bugs.html
43 *
44 * For information on updating and regenerating please refer to the How-To
45 * section in the Software Requirements Engineering chapter of the
46 * RTEMS Software Engineering manual. The manual is provided as a part of
47 * a release. For development sources please refer to the online
48 * documentation at:
49 *
50 * https://docs.rtems.org
51 */
52
53/* Generated from spec:/dev/grlib/if/spictrl-header */
54
55#ifndef _GRLIB_SPICTRL_REGS_H
56#define _GRLIB_SPICTRL_REGS_H
57
58#include <stdint.h>
59
60#ifdef __cplusplus
61extern "C" {
62#endif
63
64/* Generated from spec:/dev/grlib/if/spictrl */
65
84#define SPICTRL_CAP_SSSZ_SHIFT 24
85#define SPICTRL_CAP_SSSZ_MASK 0xff000000U
86#define SPICTRL_CAP_SSSZ_GET( _reg ) \
87 ( ( ( _reg ) & SPICTRL_CAP_SSSZ_MASK ) >> \
88 SPICTRL_CAP_SSSZ_SHIFT )
89#define SPICTRL_CAP_SSSZ_SET( _reg, _val ) \
90 ( ( ( _reg ) & ~SPICTRL_CAP_SSSZ_MASK ) | \
91 ( ( ( _val ) << SPICTRL_CAP_SSSZ_SHIFT ) & \
92 SPICTRL_CAP_SSSZ_MASK ) )
93#define SPICTRL_CAP_SSSZ( _val ) \
94 ( ( ( _val ) << SPICTRL_CAP_SSSZ_SHIFT ) & \
95 SPICTRL_CAP_SSSZ_MASK )
96
97#define SPICTRL_CAP_MAXWLEN_SHIFT 20
98#define SPICTRL_CAP_MAXWLEN_MASK 0xf00000U
99#define SPICTRL_CAP_MAXWLEN_GET( _reg ) \
100 ( ( ( _reg ) & SPICTRL_CAP_MAXWLEN_MASK ) >> \
101 SPICTRL_CAP_MAXWLEN_SHIFT )
102#define SPICTRL_CAP_MAXWLEN_SET( _reg, _val ) \
103 ( ( ( _reg ) & ~SPICTRL_CAP_MAXWLEN_MASK ) | \
104 ( ( ( _val ) << SPICTRL_CAP_MAXWLEN_SHIFT ) & \
105 SPICTRL_CAP_MAXWLEN_MASK ) )
106#define SPICTRL_CAP_MAXWLEN( _val ) \
107 ( ( ( _val ) << SPICTRL_CAP_MAXWLEN_SHIFT ) & \
108 SPICTRL_CAP_MAXWLEN_MASK )
109
110#define SPICTRL_CAP_TWEN 0x80000U
111
112#define SPICTRL_CAP_AMODE 0x40000U
113
114#define SPICTRL_CAP_ASELA 0x20000U
115
116#define SPICTRL_CAP_SSEN 0x10000U
117
118#define SPICTRL_CAP_FDEPTH_SHIFT 8
119#define SPICTRL_CAP_FDEPTH_MASK 0xff00U
120#define SPICTRL_CAP_FDEPTH_GET( _reg ) \
121 ( ( ( _reg ) & SPICTRL_CAP_FDEPTH_MASK ) >> \
122 SPICTRL_CAP_FDEPTH_SHIFT )
123#define SPICTRL_CAP_FDEPTH_SET( _reg, _val ) \
124 ( ( ( _reg ) & ~SPICTRL_CAP_FDEPTH_MASK ) | \
125 ( ( ( _val ) << SPICTRL_CAP_FDEPTH_SHIFT ) & \
126 SPICTRL_CAP_FDEPTH_MASK ) )
127#define SPICTRL_CAP_FDEPTH( _val ) \
128 ( ( ( _val ) << SPICTRL_CAP_FDEPTH_SHIFT ) & \
129 SPICTRL_CAP_FDEPTH_MASK )
130
131#define SPICTRL_CAP_SR 0x80U
132
133#define SPICTRL_CAP_FT_SHIFT 5
134#define SPICTRL_CAP_FT_MASK 0x60U
135#define SPICTRL_CAP_FT_GET( _reg ) \
136 ( ( ( _reg ) & SPICTRL_CAP_FT_MASK ) >> \
137 SPICTRL_CAP_FT_SHIFT )
138#define SPICTRL_CAP_FT_SET( _reg, _val ) \
139 ( ( ( _reg ) & ~SPICTRL_CAP_FT_MASK ) | \
140 ( ( ( _val ) << SPICTRL_CAP_FT_SHIFT ) & \
141 SPICTRL_CAP_FT_MASK ) )
142#define SPICTRL_CAP_FT( _val ) \
143 ( ( ( _val ) << SPICTRL_CAP_FT_SHIFT ) & \
144 SPICTRL_CAP_FT_MASK )
145
146#define SPICTRL_CAP_REV_SHIFT 0
147#define SPICTRL_CAP_REV_MASK 0x1fU
148#define SPICTRL_CAP_REV_GET( _reg ) \
149 ( ( ( _reg ) & SPICTRL_CAP_REV_MASK ) >> \
150 SPICTRL_CAP_REV_SHIFT )
151#define SPICTRL_CAP_REV_SET( _reg, _val ) \
152 ( ( ( _reg ) & ~SPICTRL_CAP_REV_MASK ) | \
153 ( ( ( _val ) << SPICTRL_CAP_REV_SHIFT ) & \
154 SPICTRL_CAP_REV_MASK ) )
155#define SPICTRL_CAP_REV( _val ) \
156 ( ( ( _val ) << SPICTRL_CAP_REV_SHIFT ) & \
157 SPICTRL_CAP_REV_MASK )
158
169#define SPICTRL_MODE_LOOP 0x40000000U
170
171#define SPICTRL_MODE_CPOL 0x20000000U
172
173#define SPICTRL_MODE_CPHA 0x10000000U
174
175#define SPICTRL_MODE_DIV_16 0x8000000U
176
177#define SPICTRL_MODE_REV 0x4000000U
178
179#define SPICTRL_MODE_MX 0x2000000U
180
181#define SPICTRL_MODE_EN 0x1000000U
182
183#define SPICTRL_MODE_LEN_SHIFT 20
184#define SPICTRL_MODE_LEN_MASK 0xf00000U
185#define SPICTRL_MODE_LEN_GET( _reg ) \
186 ( ( ( _reg ) & SPICTRL_MODE_LEN_MASK ) >> \
187 SPICTRL_MODE_LEN_SHIFT )
188#define SPICTRL_MODE_LEN_SET( _reg, _val ) \
189 ( ( ( _reg ) & ~SPICTRL_MODE_LEN_MASK ) | \
190 ( ( ( _val ) << SPICTRL_MODE_LEN_SHIFT ) & \
191 SPICTRL_MODE_LEN_MASK ) )
192#define SPICTRL_MODE_LEN( _val ) \
193 ( ( ( _val ) << SPICTRL_MODE_LEN_SHIFT ) & \
194 SPICTRL_MODE_LEN_MASK )
195
196#define SPICTRL_MODE_PM_SHIFT 16
197#define SPICTRL_MODE_PM_MASK 0xf0000U
198#define SPICTRL_MODE_PM_GET( _reg ) \
199 ( ( ( _reg ) & SPICTRL_MODE_PM_MASK ) >> \
200 SPICTRL_MODE_PM_SHIFT )
201#define SPICTRL_MODE_PM_SET( _reg, _val ) \
202 ( ( ( _reg ) & ~SPICTRL_MODE_PM_MASK ) | \
203 ( ( ( _val ) << SPICTRL_MODE_PM_SHIFT ) & \
204 SPICTRL_MODE_PM_MASK ) )
205#define SPICTRL_MODE_PM( _val ) \
206 ( ( ( _val ) << SPICTRL_MODE_PM_SHIFT ) & \
207 SPICTRL_MODE_PM_MASK )
208
209#define SPICTRL_MODE_TWEN 0x8000U
210
211#define SPICTRL_MODE_ASEL 0x4000U
212
213#define SPICTRL_MODE_FACT 0x2000U
214
215#define SPICTRL_MODE_OD 0x1000U
216
217#define SPICTRL_MODE_CG_SHIFT 7
218#define SPICTRL_MODE_CG_MASK 0xf80U
219#define SPICTRL_MODE_CG_GET( _reg ) \
220 ( ( ( _reg ) & SPICTRL_MODE_CG_MASK ) >> \
221 SPICTRL_MODE_CG_SHIFT )
222#define SPICTRL_MODE_CG_SET( _reg, _val ) \
223 ( ( ( _reg ) & ~SPICTRL_MODE_CG_MASK ) | \
224 ( ( ( _val ) << SPICTRL_MODE_CG_SHIFT ) & \
225 SPICTRL_MODE_CG_MASK ) )
226#define SPICTRL_MODE_CG( _val ) \
227 ( ( ( _val ) << SPICTRL_MODE_CG_SHIFT ) & \
228 SPICTRL_MODE_CG_MASK )
229
230#define SPICTRL_MODE_ASELDEL_SHIFT 5
231#define SPICTRL_MODE_ASELDEL_MASK 0x60U
232#define SPICTRL_MODE_ASELDEL_GET( _reg ) \
233 ( ( ( _reg ) & SPICTRL_MODE_ASELDEL_MASK ) >> \
234 SPICTRL_MODE_ASELDEL_SHIFT )
235#define SPICTRL_MODE_ASELDEL_SET( _reg, _val ) \
236 ( ( ( _reg ) & ~SPICTRL_MODE_ASELDEL_MASK ) | \
237 ( ( ( _val ) << SPICTRL_MODE_ASELDEL_SHIFT ) & \
238 SPICTRL_MODE_ASELDEL_MASK ) )
239#define SPICTRL_MODE_ASELDEL( _val ) \
240 ( ( ( _val ) << SPICTRL_MODE_ASELDEL_SHIFT ) & \
241 SPICTRL_MODE_ASELDEL_MASK )
242
243#define SPICTRL_MODE_TAC 0x10U
244
245#define SPICTRL_MODE_TTO 0x8U
246
247#define SPICTRL_MODE_IGSEL 0x4U
248
249#define SPICTRL_MODE_CITE 0x2U
250
261#define SPICTRL_EVENT_TIP 0x80000000U
262
263#define SPICTRL_EVENT_LT 0x4000U
264
265#define SPICTRL_EVENT_OV 0x1000U
266
267#define SPICTRL_EVENT_UN 0x800U
268
269#define SPICTRL_EVENT_MME 0x400U
270
271#define SPICTRL_EVENT_NE 0x200U
272
273#define SPICTRL_EVENT_NF 0x100U
274
285#define SPICTRL_MASK_TIPE 0x80000000U
286
287#define SPICTRL_MASK_LTE 0x4000U
288
289#define SPICTRL_MASK_OVE 0x1000U
290
291#define SPICTRL_MASK_UNE 0x800U
292
293#define SPICTRL_MASK_MMEE 0x400U
294
295#define SPICTRL_MASK_NEEE 0x200U
296
297#define SPICTRL_MASK_NFE 0x100U
298
309#define SPICTRL_CMD_LST 0x400000U
310
321#define SPICTRL_TX_TDATA_SHIFT 0
322#define SPICTRL_TX_TDATA_MASK 0xffffffffU
323#define SPICTRL_TX_TDATA_GET( _reg ) \
324 ( ( ( _reg ) & SPICTRL_TX_TDATA_MASK ) >> \
325 SPICTRL_TX_TDATA_SHIFT )
326#define SPICTRL_TX_TDATA_SET( _reg, _val ) \
327 ( ( ( _reg ) & ~SPICTRL_TX_TDATA_MASK ) | \
328 ( ( ( _val ) << SPICTRL_TX_TDATA_SHIFT ) & \
329 SPICTRL_TX_TDATA_MASK ) )
330#define SPICTRL_TX_TDATA( _val ) \
331 ( ( ( _val ) << SPICTRL_TX_TDATA_SHIFT ) & \
332 SPICTRL_TX_TDATA_MASK )
333
344#define SPICTRL_RX_RDATA_SHIFT 0
345#define SPICTRL_RX_RDATA_MASK 0xffffffffU
346#define SPICTRL_RX_RDATA_GET( _reg ) \
347 ( ( ( _reg ) & SPICTRL_RX_RDATA_MASK ) >> \
348 SPICTRL_RX_RDATA_SHIFT )
349#define SPICTRL_RX_RDATA_SET( _reg, _val ) \
350 ( ( ( _reg ) & ~SPICTRL_RX_RDATA_MASK ) | \
351 ( ( ( _val ) << SPICTRL_RX_RDATA_SHIFT ) & \
352 SPICTRL_RX_RDATA_MASK ) )
353#define SPICTRL_RX_RDATA( _val ) \
354 ( ( ( _val ) << SPICTRL_RX_RDATA_SHIFT ) & \
355 SPICTRL_RX_RDATA_MASK )
356
367#define SPICTRL_SLVSEL_SLVSEL_SHIFT 0
368#define SPICTRL_SLVSEL_SLVSEL_MASK 0x3U
369#define SPICTRL_SLVSEL_SLVSEL_GET( _reg ) \
370 ( ( ( _reg ) & SPICTRL_SLVSEL_SLVSEL_MASK ) >> \
371 SPICTRL_SLVSEL_SLVSEL_SHIFT )
372#define SPICTRL_SLVSEL_SLVSEL_SET( _reg, _val ) \
373 ( ( ( _reg ) & ~SPICTRL_SLVSEL_SLVSEL_MASK ) | \
374 ( ( ( _val ) << SPICTRL_SLVSEL_SLVSEL_SHIFT ) & \
375 SPICTRL_SLVSEL_SLVSEL_MASK ) )
376#define SPICTRL_SLVSEL_SLVSEL( _val ) \
377 ( ( ( _val ) << SPICTRL_SLVSEL_SLVSEL_SHIFT ) & \
378 SPICTRL_SLVSEL_SLVSEL_MASK )
379
391#define SPICTRL_ASLVSEL_ASLVSEL_SHIFT 0
392#define SPICTRL_ASLVSEL_ASLVSEL_MASK 0x3U
393#define SPICTRL_ASLVSEL_ASLVSEL_GET( _reg ) \
394 ( ( ( _reg ) & SPICTRL_ASLVSEL_ASLVSEL_MASK ) >> \
395 SPICTRL_ASLVSEL_ASLVSEL_SHIFT )
396#define SPICTRL_ASLVSEL_ASLVSEL_SET( _reg, _val ) \
397 ( ( ( _reg ) & ~SPICTRL_ASLVSEL_ASLVSEL_MASK ) | \
398 ( ( ( _val ) << SPICTRL_ASLVSEL_ASLVSEL_SHIFT ) & \
399 SPICTRL_ASLVSEL_ASLVSEL_MASK ) )
400#define SPICTRL_ASLVSEL_ASLVSEL( _val ) \
401 ( ( ( _val ) << SPICTRL_ASLVSEL_ASLVSEL_SHIFT ) & \
402 SPICTRL_ASLVSEL_ASLVSEL_MASK )
403
409typedef struct spictrl {
413 uint32_t cap;
414
415 uint32_t reserved_4_20[ 7 ];
416
420 uint32_t mode;
421
425 uint32_t event;
426
430 uint32_t mask;
431
435 uint32_t cmd;
436
440 uint32_t tx;
441
445 uint32_t rx;
446
450 uint32_t slvsel;
451
455 uint32_t aslvsel;
457
460#ifdef __cplusplus
461}
462#endif
463
464#endif /* _GRLIB_SPICTRL_REGS_H */
This structure defines the SPICTRL register block memory map.
Definition: spictrl-regs.h:409
uint32_t slvsel
See Slave select register (SLVSEL).
Definition: spictrl-regs.h:450
uint32_t rx
See Receive register (RX).
Definition: spictrl-regs.h:445
uint32_t aslvsel
See Automatic slave select register (ASLVSEL).
Definition: spictrl-regs.h:455
uint32_t event
See Event register (EVENT).
Definition: spictrl-regs.h:425
uint32_t cap
See Capability register (CAP).
Definition: spictrl-regs.h:413
uint32_t mode
See Mode register (MODE).
Definition: spictrl-regs.h:420
uint32_t cmd
See Command register (CMD).
Definition: spictrl-regs.h:435
uint32_t tx
See Transmit register (TX).
Definition: spictrl-regs.h:440
uint32_t mask
See Mask register (MASK).
Definition: spictrl-regs.h:430