RTEMS 6.1-rc5
Loading...
Searching...
No Matches
gptimer-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/gptimer-header */
54
55#ifndef _GRLIB_GPTIMER_REGS_H
56#define _GRLIB_GPTIMER_REGS_H
57
58#include <stdint.h>
59
60#ifdef __cplusplus
61extern "C" {
62#endif
63
64/* Generated from spec:/dev/grlib/if/group */
65
74/* Generated from spec:/dev/grlib/if/gptimer-timer */
75
95#define GPTIMER_TCNTVAL_TCVAL_SHIFT 0
96#define GPTIMER_TCNTVAL_TCVAL_MASK 0xffffffffU
97#define GPTIMER_TCNTVAL_TCVAL_GET( _reg ) \
98 ( ( ( _reg ) & GPTIMER_TCNTVAL_TCVAL_MASK ) >> \
99 GPTIMER_TCNTVAL_TCVAL_SHIFT )
100#define GPTIMER_TCNTVAL_TCVAL_SET( _reg, _val ) \
101 ( ( ( _reg ) & ~GPTIMER_TCNTVAL_TCVAL_MASK ) | \
102 ( ( ( _val ) << GPTIMER_TCNTVAL_TCVAL_SHIFT ) & \
103 GPTIMER_TCNTVAL_TCVAL_MASK ) )
104#define GPTIMER_TCNTVAL_TCVAL( _val ) \
105 ( ( ( _val ) << GPTIMER_TCNTVAL_TCVAL_SHIFT ) & \
106 GPTIMER_TCNTVAL_TCVAL_MASK )
107
119#define GPTIMER_TRLDVAL_TRLDVAL_SHIFT 0
120#define GPTIMER_TRLDVAL_TRLDVAL_MASK 0xffffffffU
121#define GPTIMER_TRLDVAL_TRLDVAL_GET( _reg ) \
122 ( ( ( _reg ) & GPTIMER_TRLDVAL_TRLDVAL_MASK ) >> \
123 GPTIMER_TRLDVAL_TRLDVAL_SHIFT )
124#define GPTIMER_TRLDVAL_TRLDVAL_SET( _reg, _val ) \
125 ( ( ( _reg ) & ~GPTIMER_TRLDVAL_TRLDVAL_MASK ) | \
126 ( ( ( _val ) << GPTIMER_TRLDVAL_TRLDVAL_SHIFT ) & \
127 GPTIMER_TRLDVAL_TRLDVAL_MASK ) )
128#define GPTIMER_TRLDVAL_TRLDVAL( _val ) \
129 ( ( ( _val ) << GPTIMER_TRLDVAL_TRLDVAL_SHIFT ) & \
130 GPTIMER_TRLDVAL_TRLDVAL_MASK )
131
142#define GPTIMER_TCTRL_WS 0x100U
143
144#define GPTIMER_TCTRL_WN 0x80U
145
146#define GPTIMER_TCTRL_DH 0x40U
147
148#define GPTIMER_TCTRL_CH 0x20U
149
150#define GPTIMER_TCTRL_IP 0x10U
151
152#define GPTIMER_TCTRL_IE 0x8U
153
154#define GPTIMER_TCTRL_LD 0x4U
155
156#define GPTIMER_TCTRL_RS 0x2U
157
158#define GPTIMER_TCTRL_EN 0x1U
159
170#define GPTIMER_TLATCH_LTCV_SHIFT 0
171#define GPTIMER_TLATCH_LTCV_MASK 0xffffffffU
172#define GPTIMER_TLATCH_LTCV_GET( _reg ) \
173 ( ( ( _reg ) & GPTIMER_TLATCH_LTCV_MASK ) >> \
174 GPTIMER_TLATCH_LTCV_SHIFT )
175#define GPTIMER_TLATCH_LTCV_SET( _reg, _val ) \
176 ( ( ( _reg ) & ~GPTIMER_TLATCH_LTCV_MASK ) | \
177 ( ( ( _val ) << GPTIMER_TLATCH_LTCV_SHIFT ) & \
178 GPTIMER_TLATCH_LTCV_MASK ) )
179#define GPTIMER_TLATCH_LTCV( _val ) \
180 ( ( ( _val ) << GPTIMER_TLATCH_LTCV_SHIFT ) & \
181 GPTIMER_TLATCH_LTCV_MASK )
182
188typedef struct gptimer_timer {
192 uint32_t tcntval;
193
197 uint32_t trldval;
198
202 uint32_t tctrl;
203
207 uint32_t tlatch;
209
212/* Generated from spec:/dev/grlib/if/gptimer */
213
232#define GPTIMER_SCALER_SCALER_SHIFT 0
233#define GPTIMER_SCALER_SCALER_MASK 0xffffU
234#define GPTIMER_SCALER_SCALER_GET( _reg ) \
235 ( ( ( _reg ) & GPTIMER_SCALER_SCALER_MASK ) >> \
236 GPTIMER_SCALER_SCALER_SHIFT )
237#define GPTIMER_SCALER_SCALER_SET( _reg, _val ) \
238 ( ( ( _reg ) & ~GPTIMER_SCALER_SCALER_MASK ) | \
239 ( ( ( _val ) << GPTIMER_SCALER_SCALER_SHIFT ) & \
240 GPTIMER_SCALER_SCALER_MASK ) )
241#define GPTIMER_SCALER_SCALER( _val ) \
242 ( ( ( _val ) << GPTIMER_SCALER_SCALER_SHIFT ) & \
243 GPTIMER_SCALER_SCALER_MASK )
244
256#define GPTIMER_SRELOAD_SRELOAD_SHIFT 0
257#define GPTIMER_SRELOAD_SRELOAD_MASK 0xffffU
258#define GPTIMER_SRELOAD_SRELOAD_GET( _reg ) \
259 ( ( ( _reg ) & GPTIMER_SRELOAD_SRELOAD_MASK ) >> \
260 GPTIMER_SRELOAD_SRELOAD_SHIFT )
261#define GPTIMER_SRELOAD_SRELOAD_SET( _reg, _val ) \
262 ( ( ( _reg ) & ~GPTIMER_SRELOAD_SRELOAD_MASK ) | \
263 ( ( ( _val ) << GPTIMER_SRELOAD_SRELOAD_SHIFT ) & \
264 GPTIMER_SRELOAD_SRELOAD_MASK ) )
265#define GPTIMER_SRELOAD_SRELOAD( _val ) \
266 ( ( ( _val ) << GPTIMER_SRELOAD_SRELOAD_SHIFT ) & \
267 GPTIMER_SRELOAD_SRELOAD_MASK )
268
279#define GPTIMER_CONFIG_EV 0x2000U
280
281#define GPTIMER_CONFIG_ES 0x1000U
282
283#define GPTIMER_CONFIG_EL 0x800U
284
285#define GPTIMER_CONFIG_EE 0x400U
286
287#define GPTIMER_CONFIG_DF 0x200U
288
289#define GPTIMER_CONFIG_SI 0x100U
290
291#define GPTIMER_CONFIG_IRQ_SHIFT 3
292#define GPTIMER_CONFIG_IRQ_MASK 0xf8U
293#define GPTIMER_CONFIG_IRQ_GET( _reg ) \
294 ( ( ( _reg ) & GPTIMER_CONFIG_IRQ_MASK ) >> \
295 GPTIMER_CONFIG_IRQ_SHIFT )
296#define GPTIMER_CONFIG_IRQ_SET( _reg, _val ) \
297 ( ( ( _reg ) & ~GPTIMER_CONFIG_IRQ_MASK ) | \
298 ( ( ( _val ) << GPTIMER_CONFIG_IRQ_SHIFT ) & \
299 GPTIMER_CONFIG_IRQ_MASK ) )
300#define GPTIMER_CONFIG_IRQ( _val ) \
301 ( ( ( _val ) << GPTIMER_CONFIG_IRQ_SHIFT ) & \
302 GPTIMER_CONFIG_IRQ_MASK )
303
304#define GPTIMER_CONFIG_TIMERS_SHIFT 0
305#define GPTIMER_CONFIG_TIMERS_MASK 0x7U
306#define GPTIMER_CONFIG_TIMERS_GET( _reg ) \
307 ( ( ( _reg ) & GPTIMER_CONFIG_TIMERS_MASK ) >> \
308 GPTIMER_CONFIG_TIMERS_SHIFT )
309#define GPTIMER_CONFIG_TIMERS_SET( _reg, _val ) \
310 ( ( ( _reg ) & ~GPTIMER_CONFIG_TIMERS_MASK ) | \
311 ( ( ( _val ) << GPTIMER_CONFIG_TIMERS_SHIFT ) & \
312 GPTIMER_CONFIG_TIMERS_MASK ) )
313#define GPTIMER_CONFIG_TIMERS( _val ) \
314 ( ( ( _val ) << GPTIMER_CONFIG_TIMERS_SHIFT ) & \
315 GPTIMER_CONFIG_TIMERS_MASK )
316
328#define GPTIMER_LATCHCFG_LATCHSEL_SHIFT 0
329#define GPTIMER_LATCHCFG_LATCHSEL_MASK 0xffffffffU
330#define GPTIMER_LATCHCFG_LATCHSEL_GET( _reg ) \
331 ( ( ( _reg ) & GPTIMER_LATCHCFG_LATCHSEL_MASK ) >> \
332 GPTIMER_LATCHCFG_LATCHSEL_SHIFT )
333#define GPTIMER_LATCHCFG_LATCHSEL_SET( _reg, _val ) \
334 ( ( ( _reg ) & ~GPTIMER_LATCHCFG_LATCHSEL_MASK ) | \
335 ( ( ( _val ) << GPTIMER_LATCHCFG_LATCHSEL_SHIFT ) & \
336 GPTIMER_LATCHCFG_LATCHSEL_MASK ) )
337#define GPTIMER_LATCHCFG_LATCHSEL( _val ) \
338 ( ( ( _val ) << GPTIMER_LATCHCFG_LATCHSEL_SHIFT ) & \
339 GPTIMER_LATCHCFG_LATCHSEL_MASK )
340
346typedef struct gptimer {
350 uint32_t scaler;
351
355 uint32_t sreload;
356
360 uint32_t config;
361
365 uint32_t latchcfg;
366
372
375#ifdef __cplusplus
376}
377#endif
378
379#endif /* _GRLIB_GPTIMER_REGS_H */
This structure defines the GPTIMER TIMER register block memory map.
Definition: gptimer-regs.h:188
uint32_t tctrl
See Timer n control register (TCTRL).
Definition: gptimer-regs.h:202
uint32_t trldval
See Timer n counter reload value register (TRLDVAL).
Definition: gptimer-regs.h:197
uint32_t tcntval
See Timer n counter value register (TCNTVAL).
Definition: gptimer-regs.h:192
uint32_t tlatch
See Timer n latch register (TLATCH).
Definition: gptimer-regs.h:207
This structure defines the GPTIMER register block memory map.
Definition: gptimer-regs.h:346
gptimer_timer timer[15]
See GPTIMER TIMER.
Definition: gptimer-regs.h:370
uint32_t sreload
See Scaler reload value register (SRELOAD).
Definition: gptimer-regs.h:355
uint32_t scaler
See Scaler value register (SCALER).
Definition: gptimer-regs.h:350
uint32_t config
See Configuration register (CONFIG).
Definition: gptimer-regs.h:360
uint32_t latchcfg
See Timer latch configuration register (LATCHCFG).
Definition: gptimer-regs.h:365