RTEMS 6.1-rc6
Loading...
Searching...
No Matches
reg_n2het.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
11/* The header file is generated by make_header.py from N2HET.json */
12/* Current script's version can be found at: */
13/* https://github.com/AoLaD/rtems-tms570-utils/tree/headers/headers/python */
14
15/*
16 * Copyright (c) 2014-2015, Premysl Houdek <kom541000@gmail.com>
17 *
18 * Czech Technical University in Prague
19 * Zikova 1903/4
20 * 166 36 Praha 6
21 * Czech Republic
22 *
23 * All rights reserved.
24 *
25 * Redistribution and use in source and binary forms, with or without
26 * modification, are permitted provided that the following conditions are met:
27 *
28 * 1. Redistributions of source code must retain the above copyright notice, this
29 * list of conditions and the following disclaimer.
30 * 2. Redistributions in binary form must reproduce the above copyright notice,
31 * this list of conditions and the following disclaimer in the documentation
32 * and/or other materials provided with the distribution.
33 *
34 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
35 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
36 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
37 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
38 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
39 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
40 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
41 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
42 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
43 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44 *
45 * The views and conclusions contained in the software and documentation are those
46 * of the authors and should not be interpreted as representing official policies,
47 * either expressed or implied, of the FreeBSD Project.
48*/
49#ifndef LIBBSP_ARM_TMS570_NHET
50#define LIBBSP_ARM_TMS570_NHET
51
52#include <bsp/utility.h>
53
54typedef struct{
55 uint32_t GCR; /*Global Configuration Register*/
56 uint32_t PFR; /*Prescale Factor Register*/
57 uint32_t ADDR; /*NHET Current Address Register*/
58 uint32_t OFF1; /*Offset Index Priority Level 1 Register*/
59 uint32_t OFF2; /*Offset Index Priority Level 2 Register*/
60 uint32_t INTENAS; /*Interrupt Enable Set Register*/
61 uint32_t INTENAC; /*Interrupt Enable Clear Register*/
62 uint32_t EXC1; /*Exception Control Register 1*/
63 uint32_t EXC2; /*Exception Control Register 2*/
64 uint32_t PRY; /*Interrupt Priority Register*/
65 uint32_t FLG; /*Interrupt Flag Register*/
66 uint32_t AND; /*AND Share Control Register*/
67 uint8_t reserved1 [4];
68 uint32_t HRSH; /*HR Share Control Register*/
69 uint32_t XOR; /*HR XOR-Share Control Register*/
70 uint32_t REQENS; /*Request Enable Set Register*/
71 uint32_t REQENC; /*Request Enable Clear Register*/
72 uint32_t REQDS; /*Request Destination Select Register*/
73 uint8_t reserved2 [4];
74 uint32_t DIR; /*NHET Direction Register*/
75 uint32_t DIN; /*NHET Data Input Register*/
76 uint32_t DOUT; /*NHET Data Output Register*/
77 uint32_t DSET; /*NHET Data Set Register*/
78 uint32_t DCLR; /*NHET Data Clear Register*/
79 uint32_t PDR; /*NHET Open Drain Register*/
80 uint32_t PULDIS; /*NHET Pull Disable Register*/
81 uint32_t PSL; /*NHET Pull Select Register*/
82 uint8_t reserved3 [8];
83 uint32_t PCR; /*Parity Control Register*/
84 uint32_t PAR; /*Parity Address Register*/
85 uint32_t PPR; /*Parity Pin Register*/
86 uint32_t SFPRLD; /*Suppression Filter Preload Register*/
87 uint32_t SFENA; /*Suppression Filter Enable Register*/
88 uint8_t reserved4 [4];
89 uint32_t LBPSEL; /*Loop Back Pair Select Register*/
90 uint32_t LBPDIR; /*Loop Back Pair Direction Register*/
91 uint32_t PINDIS; /*NHET Pin Disable Register*/
93
94
95/*----------------------TMS570_NHET_GCR----------------------*/
96/* field: HET_PIN_ENA - Enables the output buffers of the pin structures depending on the value of nDIS and DIR. */
97#define TMS570_NHET_GCR_HET_PIN_ENA BSP_BIT32(24)
98
99/* field: MP - Master Priority */
100#define TMS570_NHET_GCR_MP(val) BSP_FLD32(val,21, 22)
101#define TMS570_NHET_GCR_MP_GET(reg) BSP_FLD32GET(reg,21, 22)
102#define TMS570_NHET_GCR_MP_SET(reg,val) BSP_FLD32SET(reg, val,21, 22)
103
104/* field: PPF - Protect Program Fields */
105#define TMS570_NHET_GCR_PPF BSP_BIT32(18)
106
107/* field: IS - Ignore Suspend */
108#define TMS570_NHET_GCR_IS BSP_BIT32(17)
109
110/* field: CMS - Clk_master/slave */
111#define TMS570_NHET_GCR_CMS BSP_BIT32(16)
112
113
114/*----------------------TMS570_NHET_PFR----------------------*/
115/* field: LRPFC - oop Resolution Pre-scale Factor Code */
116#define TMS570_NHET_PFR_LRPFC(val) BSP_FLD32(val,8, 10)
117#define TMS570_NHET_PFR_LRPFC_GET(reg) BSP_FLD32GET(reg,8, 10)
118#define TMS570_NHET_PFR_LRPFC_SET(reg,val) BSP_FLD32SET(reg, val,8, 10)
119
120/* field: HRPFC - High Resolution Pre-scale Factor Code */
121#define TMS570_NHET_PFR_HRPFC(val) BSP_FLD32(val,0, 5)
122#define TMS570_NHET_PFR_HRPFC_GET(reg) BSP_FLD32GET(reg,0, 5)
123#define TMS570_NHET_PFR_HRPFC_SET(reg,val) BSP_FLD32SET(reg, val,0, 5)
124
125
126/*----------------------TMS570_NHET_ADDR----------------------*/
127/* field: HETADDR - N2HET Current Address */
128#define TMS570_NHET_ADDR_HETADDR(val) BSP_FLD32(val,0, 8)
129#define TMS570_NHET_ADDR_HETADDR_GET(reg) BSP_FLD32GET(reg,0, 8)
130#define TMS570_NHET_ADDR_HETADDR_SET(reg,val) BSP_FLD32SET(reg, val,0, 8)
131
132
133/*----------------------TMS570_NHET_OFF1----------------------*/
134/* field: OFFSET1 - HETOFF1[5:0] indexes the currently pending high-priority interrupt. */
135#define TMS570_NHET_OFF1_OFFSET1(val) BSP_FLD32(val,0, 5)
136#define TMS570_NHET_OFF1_OFFSET1_GET(reg) BSP_FLD32GET(reg,0, 5)
137#define TMS570_NHET_OFF1_OFFSET1_SET(reg,val) BSP_FLD32SET(reg, val,0, 5)
138
139
140/*----------------------TMS570_NHET_OFF2----------------------*/
141/* field: OFFSET2 - HETOFF2[5:0] indexes the currently pending low-priority interrupt. */
142#define TMS570_NHET_OFF2_OFFSET2(val) BSP_FLD32(val,0, 5)
143#define TMS570_NHET_OFF2_OFFSET2_GET(reg) BSP_FLD32GET(reg,0, 5)
144#define TMS570_NHET_OFF2_OFFSET2_SET(reg,val) BSP_FLD32SET(reg, val,0, 5)
145
146
147/*--------------------TMS570_NHET_INTENAS--------------------*/
148/* field: HETINTENAS - Interrupt Enable Set bits. HETINTENAS is readable and writable in any operation mode. */
149/* Whole 32 bits */
150
151/*--------------------TMS570_NHET_INTENAC--------------------*/
152/* field: HETINTENAC - Interrupt Enable Clear bits. HETINTENAC is readable and writable in any operation mode. */
153/* Whole 32 bits */
154
155/*----------------------TMS570_NHET_EXC1----------------------*/
156/* field: APCNT_OVRFL_ENA - APCNT Overflow Enable */
157#define TMS570_NHET_EXC1_APCNT_OVRFL_ENA BSP_BIT32(24)
158
159/* field: APCNT_UNRFL_ENA - APCNT Underflow Enable */
160#define TMS570_NHET_EXC1_APCNT_UNRFL_ENA BSP_BIT32(16)
161
162/* field: PRGM_OVRFL_ENA - Program Overflow Enable */
163#define TMS570_NHET_EXC1_PRGM_OVRFL_ENA BSP_BIT32(8)
164
165/* field: APCNT_OVRFL_PRY - APCNT Overflow Exception Interrupt Priority */
166#define TMS570_NHET_EXC1_APCNT_OVRFL_PRY BSP_BIT32(2)
167
168/* field: APCNT_UNRFL_PRY - APCNT Underflow Exception Interrupt Priority */
169#define TMS570_NHET_EXC1_APCNT_UNRFL_PRY BSP_BIT32(1)
170
171/* field: PRGM_OVRFL_PRY - ProgramOverflow Exception Interrupt Priority */
172#define TMS570_NHET_EXC1_PRGM_OVRFL_PRY BSP_BIT32(0)
173
174
175/*----------------------TMS570_NHET_EXC2----------------------*/
176/* field: DEBUG_STATUS_FLAG - Debug Status Flag. */
177#define TMS570_NHET_EXC2_DEBUG_STATUS_FLAG BSP_BIT32(8)
178
179/* field: APCNT_OVRFL_FLAG - APCNT Overflow Flag */
180#define TMS570_NHET_EXC2_APCNT_OVRFL_FLAG BSP_BIT32(2)
181
182/* field: APCNT_UNDFL_FLAG - APCNT Underflow Flag */
183#define TMS570_NHET_EXC2_APCNT_UNDFL_FLAG BSP_BIT32(1)
184
185/* field: PRGM_OVERFL_FLAG - Program Overflow Flag */
186#define TMS570_NHET_EXC2_PRGM_OVERFL_FLAG BSP_BIT32(0)
187
188
189/*----------------------TMS570_NHET_PRY----------------------*/
190/* field: HETPRY - HET Interrupt Priority Level bits */
191/* Whole 32 bits */
192
193/*----------------------TMS570_NHET_FLG----------------------*/
194/* field: HETFLAG - Interrupt Flag Register Bits */
195/* Whole 32 bits */
196
197/*----------------------TMS570_NHET_AND----------------------*/
198/* field: AND_SHARE - AND Share Enable */
199#define TMS570_NHET_AND_AND_SHARE(val) BSP_FLD32(val,0, 15)
200#define TMS570_NHET_AND_AND_SHARE_GET(reg) BSP_FLD32GET(reg,0, 15)
201#define TMS570_NHET_AND_AND_SHARE_SET(reg,val) BSP_FLD32SET(reg, val,0, 15)
202
203
204/*----------------------TMS570_NHET_HRSH----------------------*/
205/* field: HR_SHARE - HR Share Bits */
206#define TMS570_NHET_HRSH_HR_SHARE(val) BSP_FLD32(val,0, 15)
207#define TMS570_NHET_HRSH_HR_SHARE_GET(reg) BSP_FLD32GET(reg,0, 15)
208#define TMS570_NHET_HRSH_HR_SHARE_SET(reg,val) BSP_FLD32SET(reg, val,0, 15)
209
210
211/*----------------------TMS570_NHET_XOR----------------------*/
212/* field: XOR_SHARE - XOR Share Enable */
213#define TMS570_NHET_XOR_XOR_SHARE(val) BSP_FLD32(val,0, 15)
214#define TMS570_NHET_XOR_XOR_SHARE_GET(reg) BSP_FLD32GET(reg,0, 15)
215#define TMS570_NHET_XOR_XOR_SHARE_SET(reg,val) BSP_FLD32SET(reg, val,0, 15)
216
217
218/*---------------------TMS570_NHET_REQENS---------------------*/
219/* field: REQ_ENA_n - Request Enable Bits */
220#define TMS570_NHET_REQENS_REQ_ENA_n(val) BSP_FLD32(val,0, 7)
221#define TMS570_NHET_REQENS_REQ_ENA_n_GET(reg) BSP_FLD32GET(reg,0, 7)
222#define TMS570_NHET_REQENS_REQ_ENA_n_SET(reg,val) BSP_FLD32SET(reg, val,0, 7)
223
224
225/*---------------------TMS570_NHET_REQENC---------------------*/
226/* field: REQ_DIS_n - Request Disable Bits */
227#define TMS570_NHET_REQENC_REQ_DIS_n(val) BSP_FLD32(val,0, 7)
228#define TMS570_NHET_REQENC_REQ_DIS_n_GET(reg) BSP_FLD32GET(reg,0, 7)
229#define TMS570_NHET_REQENC_REQ_DIS_n_SET(reg,val) BSP_FLD32SET(reg, val,0, 7)
230
231
232/*---------------------TMS570_NHET_REQDS---------------------*/
233/* field: TDBS_n - HTU, DMA or Both Select Bits */
234#define TMS570_NHET_REQDS_TDBS_n(val) BSP_FLD32(val,16, 23)
235#define TMS570_NHET_REQDS_TDBS_n_GET(reg) BSP_FLD32GET(reg,16, 23)
236#define TMS570_NHET_REQDS_TDBS_n_SET(reg,val) BSP_FLD32SET(reg, val,16, 23)
237
238/* field: TDS_n - HTU or DMA Select Bits */
239#define TMS570_NHET_REQDS_TDS_n(val) BSP_FLD32(val,0, 7)
240#define TMS570_NHET_REQDS_TDS_n_GET(reg) BSP_FLD32GET(reg,0, 7)
241#define TMS570_NHET_REQDS_TDS_n_SET(reg,val) BSP_FLD32SET(reg, val,0, 7)
242
243
244/*----------------------TMS570_NHET_DIR----------------------*/
245/* field: HETDIR_n - Data direction of NHET pins */
246/* Whole 32 bits */
247
248/*----------------------TMS570_NHET_DIN----------------------*/
249/* field: HETDIN_n - Data input. This bit displays the logic state of the pin. */
250/* Whole 32 bits */
251
252/*----------------------TMS570_NHET_DOUT----------------------*/
253/* field: HETDOUT_n - Data out write. Writes to this bit will only take effect when the pin is configured as an output. */
254/* Whole 32 bits */
255
256/*----------------------TMS570_NHET_DSET----------------------*/
257/* field: HETDSET_n - This register allows bits of HETDOUT to be set while avoiding the pitfalls of a readmodify- write */
258/* Whole 32 bits */
259
260/*----------------------TMS570_NHET_DCLR----------------------*/
261/* field: HETDCLR_n - This register allows bits of HETDOUT to be cleared while avoiding the pitfalls of a read-modifywrite */
262/* Whole 32 bits */
263
264/*----------------------TMS570_NHET_PDR----------------------*/
265/* field: HETPDR_n - Open drain control for HET[n] pins */
266/* Whole 32 bits */
267
268/*---------------------TMS570_NHET_PULDIS---------------------*/
269/* field: HETPULDIS_n - Pull disable for N2HET pins */
270/* Whole 32 bits */
271
272/*----------------------TMS570_NHET_PSL----------------------*/
273/* field: HETPSL_n - Pull select for NHET pins */
274/* Whole 32 bits */
275
276/*----------------------TMS570_NHET_PCR----------------------*/
277/* field: TEST - Test Bit. */
278#define TMS570_NHET_PCR_TEST BSP_BIT32(8)
279
280/* field: PARITY_ENA - Enable/disable parity checking. */
281#define TMS570_NHET_PCR_PARITY_ENA(val) BSP_FLD32(val,0, 3)
282#define TMS570_NHET_PCR_PARITY_ENA_GET(reg) BSP_FLD32GET(reg,0, 3)
283#define TMS570_NHET_PCR_PARITY_ENA_SET(reg,val) BSP_FLD32SET(reg, val,0, 3)
284
285
286/*----------------------TMS570_NHET_PAR----------------------*/
287/* field: PAOFF - Parity Error Address Offset. */
288#define TMS570_NHET_PAR_PAOFF(val) BSP_FLD32(val,2, 12)
289#define TMS570_NHET_PAR_PAOFF_GET(reg) BSP_FLD32GET(reg,2, 12)
290#define TMS570_NHET_PAR_PAOFF_SET(reg,val) BSP_FLD32SET(reg, val,2, 12)
291
292
293/*----------------------TMS570_NHET_PPR----------------------*/
294/* field: HETPPR_n - NHET Parity Pin Select Bits - Allows HET[n] pins to be configured to drive to a known state when */
295/* Whole 32 bits */
296
297/*---------------------TMS570_NHET_SFPRLD---------------------*/
298/* field: CCDIV - Counter Clock Divider */
299#define TMS570_NHET_SFPRLD_CCDIV(val) BSP_FLD32(val,16, 17)
300#define TMS570_NHET_SFPRLD_CCDIV_GET(reg) BSP_FLD32GET(reg,16, 17)
301#define TMS570_NHET_SFPRLD_CCDIV_SET(reg,val) BSP_FLD32SET(reg, val,16, 17)
302
303/* field: CPRLD - Counter Preload Value */
304#define TMS570_NHET_SFPRLD_CPRLD(val) BSP_FLD32(val,0, 9)
305#define TMS570_NHET_SFPRLD_CPRLD_GET(reg) BSP_FLD32GET(reg,0, 9)
306#define TMS570_NHET_SFPRLD_CPRLD_SET(reg,val) BSP_FLD32SET(reg, val,0, 9)
307
308
309/*---------------------TMS570_NHET_SFENA---------------------*/
310/* field: HETSFENA_n - Suppression Filter Enable Bits */
311/* Whole 32 bits */
312
313/*---------------------TMS570_NHET_LBPSEL---------------------*/
314/* field: LBPTYPE - Loop Back Pair Type Select Bits */
315#define TMS570_NHET_LBPSEL_LBPTYPE(val) BSP_FLD32(val,16, 31)
316#define TMS570_NHET_LBPSEL_LBPTYPE_GET(reg) BSP_FLD32GET(reg,16, 31)
317#define TMS570_NHET_LBPSEL_LBPTYPE_SET(reg,val) BSP_FLD32SET(reg, val,16, 31)
318
319/* field: LBPSEL - Loop Back Pair Select Bits */
320#define TMS570_NHET_LBPSEL_LBPSEL(val) BSP_FLD32(val,0, 15)
321#define TMS570_NHET_LBPSEL_LBPSEL_GET(reg) BSP_FLD32GET(reg,0, 15)
322#define TMS570_NHET_LBPSEL_LBPSEL_SET(reg,val) BSP_FLD32SET(reg, val,0, 15)
323
324
325/*---------------------TMS570_NHET_LBPDIR---------------------*/
326/* field: LBPTSTENA - Loopback Test Enable Key */
327#define TMS570_NHET_LBPDIR_LBPTSTENA(val) BSP_FLD32(val,16, 19)
328#define TMS570_NHET_LBPDIR_LBPTSTENA_GET(reg) BSP_FLD32GET(reg,16, 19)
329#define TMS570_NHET_LBPDIR_LBPTSTENA_SET(reg,val) BSP_FLD32SET(reg, val,16, 19)
330
331/* field: LBPDIR - Loop Back Pair Direction Bits */
332#define TMS570_NHET_LBPDIR_LBPDIR(val) BSP_FLD32(val,0, 15)
333#define TMS570_NHET_LBPDIR_LBPDIR_GET(reg) BSP_FLD32GET(reg,0, 15)
334#define TMS570_NHET_LBPDIR_LBPDIR_SET(reg,val) BSP_FLD32SET(reg, val,0, 15)
335
336
337/*---------------------TMS570_NHET_PINDIS---------------------*/
338/* field: HETPINDIS_n - N2HET Pin Disable Bits */
339/* Whole 32 bits */
340
341
342#endif /* LIBBSP_ARM_TMS570_NHET */
This header file provides utility macros for BSPs.
Definition: reg_n2het.h:54