summaryrefslogtreecommitdiff
path: root/bsps/include/dev/grlib/spwpnp.h
blob: 9e098e9f87cc2376151c19fd43f0b51d81072002 (plain)
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
/* SPDX-License-Identifier: BSD-2-Clause */

/**
 * @file
 *
 * @ingroup RTEMSDeviceGRLIB
 *
 * @brief This header file defines the SPWPNP register block interface.
 */

/*
 * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

/*
 * This file is part of the RTEMS quality process and was automatically
 * generated.  If you find something that needs to be fixed or
 * worded better please post a report or patch to an RTEMS mailing list
 * or raise a bug report:
 *
 * https://www.rtems.org/bugs.html
 *
 * For information on updating and regenerating please refer to the How-To
 * section in the Software Requirements Engineering chapter of the
 * RTEMS Software Engineering manual.  The manual is provided as a part of
 * a release.  For development sources please refer to the online
 * documentation at:
 *
 * https://docs.rtems.org
 */

/* Generated from spec:/dev/grlib/if/spwpnp-header */

#ifndef _DEV_GRLIB_SPWPNP_H
#define _DEV_GRLIB_SPWPNP_H

#ifdef __cplusplus
extern "C" {
#endif

/* Generated from spec:/dev/grlib/if/spwpnp */

/**
 * @defgroup DevGrlibIfSpwpnp SpaceWire Plug-and-Play
 *
 * @ingroup RTEMSDeviceGRLIB
 *
 * @brief This group contains the SpaceWire Plug-and-Play interfaces.
 *
 * @{
 */

/**
 * @defgroup DevGrlibIfSpwpnpPNPVEND PNPVEND
 *
 * @brief SpaceWire Plug-and-Play - Device Vendor and Product ID
 *
 * @{
 */

#define SPWPNP_PNPVEND_VEND_SHIFT 16
#define SPWPNP_PNPVEND_VEND_MASK 0xffff0000U
#define SPWPNP_PNPVEND_VEND_GET( _reg ) \
  ( ( ( _reg ) >> 16 ) & 0xffffU )
#define SPWPNP_PNPVEND_VEND( _val ) ( ( _val ) << 16 )

#define SPWPNP_PNPVEND_PROD_SHIFT 0
#define SPWPNP_PNPVEND_PROD_MASK 0xffffU
#define SPWPNP_PNPVEND_PROD_GET( _reg ) \
  ( ( ( _reg ) >> 0 ) & 0xffffU )
#define SPWPNP_PNPVEND_PROD( _val ) ( ( _val ) << 0 )

/** @} */

/**
 * @defgroup DevGrlibIfSpwpnpPNPVER PNPVER
 *
 * @brief SpaceWire Plug-and-Play - Version
 *
 * @{
 */

#define SPWPNP_PNPVER_MAJOR_SHIFT 24
#define SPWPNP_PNPVER_MAJOR_MASK 0xff000000U
#define SPWPNP_PNPVER_MAJOR_GET( _reg ) \
  ( ( ( _reg ) >> 24 ) & 0xffU )
#define SPWPNP_PNPVER_MAJOR( _val ) ( ( _val ) << 24 )

#define SPWPNP_PNPVER_MINOR_SHIFT 16
#define SPWPNP_PNPVER_MINOR_MASK 0xff0000U
#define SPWPNP_PNPVER_MINOR_GET( _reg ) \
  ( ( ( _reg ) >> 16 ) & 0xffU )
#define SPWPNP_PNPVER_MINOR( _val ) ( ( _val ) << 16 )

#define SPWPNP_PNPVER_PATCH_SHIFT 8
#define SPWPNP_PNPVER_PATCH_MASK 0xff00U
#define SPWPNP_PNPVER_PATCH_GET( _reg ) \
  ( ( ( _reg ) >> 8 ) & 0xffU )
#define SPWPNP_PNPVER_PATCH( _val ) ( ( _val ) << 8 )

/** @} */

/**
 * @defgroup DevGrlibIfSpwpnpPNPDEVSTS PNPDEVSTS
 *
 * @brief SpaceWire Plug-and-Play - Device Status
 *
 * @{
 */

#define SPWPNP_PNPDEVSTS_STATUS_SHIFT 0
#define SPWPNP_PNPDEVSTS_STATUS_MASK 0xffU
#define SPWPNP_PNPDEVSTS_STATUS_GET( _reg ) \
  ( ( ( _reg ) >> 0 ) & 0xffU )
#define SPWPNP_PNPDEVSTS_STATUS( _val ) ( ( _val ) << 0 )

/** @} */

/**
 * @defgroup DevGrlibIfSpwpnpPNPACTLNK PNPACTLNK
 *
 * @brief SpaceWire Plug-and-Play - Active Links
 *
 * @{
 */

#define SPWPNP_PNPACTLNK_ACTIVE_SHIFT 1
#define SPWPNP_PNPACTLNK_ACTIVE_MASK 0x1ffeU
#define SPWPNP_PNPACTLNK_ACTIVE_GET( _reg ) \
  ( ( ( _reg ) >> 1 ) & 0xfffU )
#define SPWPNP_PNPACTLNK_ACTIVE( _val ) ( ( _val ) << 1 )

/** @} */

/**
 * @defgroup DevGrlibIfSpwpnpPNPOA0 PNPOA0
 *
 * @brief SpaceWire Plug-and-Play - Owner Address 0
 *
 * @{
 */

#define SPWPNP_PNPOA0_RA_SHIFT 0
#define SPWPNP_PNPOA0_RA_MASK 0xffffffffU
#define SPWPNP_PNPOA0_RA_GET( _reg ) \
  ( ( ( _reg ) >> 0 ) & 0xffffffffU )
#define SPWPNP_PNPOA0_RA( _val ) ( ( _val ) << 0 )

/** @} */

/**
 * @defgroup DevGrlibIfSpwpnpPNPOA1 PNPOA1
 *
 * @brief SpaceWire Plug-and-Play - Owner Address 1
 *
 * @{
 */

#define SPWPNP_PNPOA1_RA_SHIFT 0
#define SPWPNP_PNPOA1_RA_MASK 0xffffffffU
#define SPWPNP_PNPOA1_RA_GET( _reg ) \
  ( ( ( _reg ) >> 0 ) & 0xffffffffU )
#define SPWPNP_PNPOA1_RA( _val ) ( ( _val ) << 0 )

/** @} */

/**
 * @defgroup DevGrlibIfSpwpnpPNPOA2 PNPOA2
 *
 * @brief SpaceWire Plug-and-Play - Owner Address 2
 *
 * @{
 */

#define SPWPNP_PNPOA2_RA_SHIFT 0
#define SPWPNP_PNPOA2_RA_MASK 0xffffffffU
#define SPWPNP_PNPOA2_RA_GET( _reg ) \
  ( ( ( _reg ) >> 0 ) & 0xffffffffU )
#define SPWPNP_PNPOA2_RA( _val ) ( ( _val ) << 0 )

/** @} */

/**
 * @defgroup DevGrlibIfSpwpnpPNPDEVID PNPDEVID
 *
 * @brief SpaceWire Plug-and-Play - Device ID
 *
 * @{
 */

#define SPWPNP_PNPDEVID_DID_SHIFT 0
#define SPWPNP_PNPDEVID_DID_MASK 0xffffffffU
#define SPWPNP_PNPDEVID_DID_GET( _reg ) \
  ( ( ( _reg ) >> 0 ) & 0xffffffffU )
#define SPWPNP_PNPDEVID_DID( _val ) ( ( _val ) << 0 )

/** @} */

/**
 * @defgroup DevGrlibIfSpwpnpPNPUVEND PNPUVEND
 *
 * @brief SpaceWire Plug-and-Play - Unit Vendor and Product ID
 *
 * @{
 */

#define SPWPNP_PNPUVEND_VEND_SHIFT 16
#define SPWPNP_PNPUVEND_VEND_MASK 0xffff0000U
#define SPWPNP_PNPUVEND_VEND_GET( _reg ) \
  ( ( ( _reg ) >> 16 ) & 0xffffU )
#define SPWPNP_PNPUVEND_VEND( _val ) ( ( _val ) << 16 )

#define SPWPNP_PNPUVEND_PROD_SHIFT 0
#define SPWPNP_PNPUVEND_PROD_MASK 0xffffU
#define SPWPNP_PNPUVEND_PROD_GET( _reg ) \
  ( ( ( _reg ) >> 0 ) & 0xffffU )
#define SPWPNP_PNPUVEND_PROD( _val ) ( ( _val ) << 0 )

/** @} */

/**
 * @defgroup DevGrlibIfSpwpnpPNPUSN PNPUSN
 *
 * @brief SpaceWire Plug-and-Play - Unit Serial Number
 *
 * @{
 */

#define SPWPNP_PNPUSN_USN_SHIFT 0
#define SPWPNP_PNPUSN_USN_MASK 0xffffffffU
#define SPWPNP_PNPUSN_USN_GET( _reg ) \
  ( ( ( _reg ) >> 0 ) & 0xffffffffU )
#define SPWPNP_PNPUSN_USN( _val ) ( ( _val ) << 0 )

/** @} */

/**
 * @defgroup DevGrlibIfSpwpnpPNPVSTRL PNPVSTRL
 *
 * @brief SpaceWire Plug-and-Play - Vendor String Length
 *
 * @{
 */

#define SPWPNP_PNPVSTRL_LEN_SHIFT 0
#define SPWPNP_PNPVSTRL_LEN_MASK 0x7fffU
#define SPWPNP_PNPVSTRL_LEN_GET( _reg ) \
  ( ( ( _reg ) >> 0 ) & 0x7fffU )
#define SPWPNP_PNPVSTRL_LEN( _val ) ( ( _val ) << 0 )

/** @} */

/**
 * @defgroup DevGrlibIfSpwpnpPNPPSTRL PNPPSTRL
 *
 * @brief SpaceWire Plug-and-Play - Product String Length
 *
 * @{
 */

#define SPWPNP_PNPPSTRL_LEN_SHIFT 0
#define SPWPNP_PNPPSTRL_LEN_MASK 0x7fffU
#define SPWPNP_PNPPSTRL_LEN_GET( _reg ) \
  ( ( ( _reg ) >> 0 ) & 0x7fffU )
#define SPWPNP_PNPPSTRL_LEN( _val ) ( ( _val ) << 0 )

/** @} */

/**
 * @defgroup DevGrlibIfSpwpnpPNPPCNT PNPPCNT
 *
 * @brief SpaceWire Plug-and-Play - Protocol Count
 *
 * @{
 */

#define SPWPNP_PNPPCNT_PC_SHIFT 0
#define SPWPNP_PNPPCNT_PC_MASK 0x1fU
#define SPWPNP_PNPPCNT_PC_GET( _reg ) \
  ( ( ( _reg ) >> 0 ) & 0x1fU )
#define SPWPNP_PNPPCNT_PC( _val ) ( ( _val ) << 0 )

/** @} */

/**
 * @defgroup DevGrlibIfSpwpnpPNPACNT PNPACNT
 *
 * @brief SpaceWire Plug-and-Play - Application Count
 *
 * @{
 */

#define SPWPNP_PNPACNT_AC_SHIFT 0
#define SPWPNP_PNPACNT_AC_MASK 0xffU
#define SPWPNP_PNPACNT_AC_GET( _reg ) \
  ( ( ( _reg ) >> 0 ) & 0xffU )
#define SPWPNP_PNPACNT_AC( _val ) ( ( _val ) << 0 )

/** @} */

/**
 * @brief This set of defines the SpaceWire Plug-and-Play address map.
 */
typedef struct {
  /**
   * @brief See @ref DevGrlibIfSpwpnpPNPVEND.
   */
  uint32_t pnpvend;

  /**
   * @brief See @ref DevGrlibIfSpwpnpPNPVER.
   */
  uint32_t pnpver;

  /**
   * @brief See @ref DevGrlibIfSpwpnpPNPDEVSTS.
   */
  uint32_t pnpdevsts;

  /**
   * @brief See @ref DevGrlibIfSpwpnpPNPACTLNK.
   */
  uint32_t pnpactlnk;

  /**
   * @brief See @ref DevGrlibIfSpwpnpPNPOA0.
   */
  uint32_t pnpoa0;

  /**
   * @brief See @ref DevGrlibIfSpwpnpPNPOA1.
   */
  uint32_t pnpoa1;

  /**
   * @brief See @ref DevGrlibIfSpwpnpPNPOA2.
   */
  uint32_t pnpoa2;

  /**
   * @brief See @ref DevGrlibIfSpwpnpPNPDEVID.
   */
  uint32_t pnpdevid;

  /**
   * @brief See @ref DevGrlibIfSpwpnpPNPUVEND.
   */
  uint32_t pnpuvend;

  /**
   * @brief See @ref DevGrlibIfSpwpnpPNPUSN.
   */
  uint32_t pnpusn;

  uint16_t reserved_e_4000[ 8185 ];

  /**
   * @brief See @ref DevGrlibIfSpwpnpPNPVSTRL.
   */
  uint32_t pnpvstrl;

  uint32_t reserved_4004_6000[ 2047 ];

  /**
   * @brief See @ref DevGrlibIfSpwpnpPNPPSTRL.
   */
  uint32_t pnppstrl;

  uint32_t reserved_6004_8000[ 2047 ];

  /**
   * @brief See @ref DevGrlibIfSpwpnpPNPPCNT.
   */
  uint32_t pnppcnt;

  uint32_t reserved_8004_c000[ 4095 ];

  /**
   * @brief See @ref DevGrlibIfSpwpnpPNPACNT.
   */
  uint32_t pnpacnt;
} spwpnp;

/** @} */

#ifdef __cplusplus
}
#endif

#endif /* _DEV_GRLIB_SPWPNP_H */