Software APIs
rram_macro.h
Go to the documentation of this file.
1
// Copyright lowRISC contributors (OpenTitan project).
2
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
3
// SPDX-License-Identifier: Apache-2.0
4
//
5
// Device table API auto-generated by `dtgen`
6
7
#ifndef OPENTITAN_DT_RRAM_MACRO_H_
8
#define OPENTITAN_DT_RRAM_MACRO_H_
9
10
#ifdef __cplusplus
11
extern
"C"
{
12
#endif
// __cplusplus
13
14
/**
15
* @file
16
* @brief Device Tables (DT) for IP rram_macro and top earlgrey.
17
*
18
* This file contains the type definitions and global functions of the rram_macro.
19
*/
20
21
#include "hw/top/dt/api.h"
22
#include <stdint.h>
23
24
25
26
/**
27
* List of instances.
28
*/
29
typedef
enum
dt_rram_macro
{
30
kDtRramMacroFirst
= 0,
/**< First instance */
31
kDtRramMacro
= 0,
/**< rram_macro */
32
}
dt_rram_macro_t
;
33
34
enum
{
35
kDtRramMacroCount
= 1,
/**< Number of instances */
36
};
37
38
39
/**
40
* List of register blocks.
41
*
42
* Register blocks are guaranteed to start at 0 and to be consecutively numbered.
43
*/
44
typedef
enum
dt_rram_macro_reg_block
{
45
kDtRramMacroRegBlockPrim = 0,
/**< */
46
}
dt_rram_macro_reg_block_t
;
47
48
enum
{
49
kDtRramMacroRegBlockCount
= 1,
/**< Number of register blocks */
50
};
51
52
53
/** Primary register block (associated with the "primary" set of registers that control the IP). */
54
static
const
dt_rram_macro_reg_block_t
kDtRramMacroRegBlockPrimary = kDtRramMacroRegBlockPrim;
55
56
/**
57
* List of clock ports.
58
*
59
* Clock ports are guaranteed to be numbered consecutively from 0.
60
*/
61
typedef
enum
dt_rram_macro_clock
{
62
kDtRramMacroClockClk
= 0,
/**< Clock port clk_i */
63
}
dt_rram_macro_clock_t
;
64
65
enum
{
66
kDtRramMacroClockCount
= 1,
/**< Number of clock ports */
67
};
68
69
70
/**
71
* List of reset ports.
72
*
73
* Reset ports are guaranteed to be numbered consecutively from 0.
74
*/
75
typedef
enum
dt_rram_macro_reset
{
76
kDtRramMacroResetRst
= 0,
/**< Reset port rst_ni */
77
}
dt_rram_macro_reset_t
;
78
79
enum
{
80
kDtRramMacroResetCount
= 1,
/**< Number of reset ports */
81
};
82
83
84
/**
85
* List of peripheral I/O.
86
*
87
* Peripheral I/O are guaranteed to be numbered consecutively from 0.
88
*/
89
typedef
enum
dt_rram_macro_periph_io
{
90
kDtRramMacroPeriphIoTck = 0,
/**< */
91
kDtRramMacroPeriphIoTms = 1,
/**< */
92
kDtRramMacroPeriphIoTdi = 2,
/**< */
93
kDtRramMacroPeriphIoTdo = 3,
/**< */
94
}
dt_rram_macro_periph_io_t
;
95
96
enum
{
97
kDtRramMacroPeriphIoCount
= 4,
/**< Number of peripheral I/O */
98
};
99
100
101
102
/**
103
* Get the rram_macro instance from an instance ID
104
*
105
* For example, `dt_uart_from_instance_id(kDtInstanceIdUart3) == kDtUart3`.
106
*
107
* @param inst_id Instance ID.
108
* @return A rram_macro instance.
109
*
110
* **Note:** This function only makes sense if the instance ID has device type rram_macro,
111
* otherwise the returned value is unspecified.
112
*/
113
dt_rram_macro_t
dt_rram_macro_from_instance_id
(
dt_instance_id_t
inst_id);
114
115
/**
116
* Get the instance ID of an instance.
117
*
118
* @param dt Instance of rram_macro.
119
* @return The instance ID of that instance.
120
*/
121
dt_instance_id_t
dt_rram_macro_instance_id
(
dt_rram_macro_t
dt);
122
123
/**
124
* Get the register base address of an instance.
125
*
126
* @param dt Instance of rram_macro.
127
* @param reg_block The register block requested.
128
* @return The register base address of the requested block.
129
*/
130
uint32_t
dt_rram_macro_reg_block
(
131
dt_rram_macro_t
dt,
132
dt_rram_macro_reg_block_t
reg_block);
133
134
/**
135
* Get the primary register base address of an instance.
136
*
137
* This is just a convenience function, equivalent to
138
* `dt_rram_macro_reg_block(dt, kDtRramMacroRegBlockPrim)`
139
*
140
* @param dt Instance of rram_macro.
141
* @return The register base address of the primary register block.
142
*/
143
static
inline
uint32_t dt_rram_macro_primary_reg_block(
144
dt_rram_macro_t
dt) {
145
return
dt_rram_macro_reg_block
(dt, kDtRramMacroRegBlockPrim);
146
}
147
148
149
150
/**
151
* Get the peripheral I/O description of an instance.
152
*
153
* @param dt Instance of rram_macro.
154
* @param sig Requested peripheral I/O.
155
* @return Description of the requested peripheral I/O for this instance.
156
*/
157
dt_periph_io_t
dt_rram_macro_periph_io
(
158
dt_rram_macro_t
dt,
159
dt_rram_macro_periph_io_t
sig);
160
161
/**
162
* Get the clock signal connected to a clock port of an instance.
163
*
164
* @param dt Instance of rram_macro.
165
* @param clk Clock port.
166
* @return Clock signal.
167
*/
168
dt_clock_t
dt_rram_macro_clock
(
169
dt_rram_macro_t
dt,
170
dt_rram_macro_clock_t
clk);
171
172
/**
173
* Get the reset signal connected to a reset port of an instance.
174
*
175
* @param dt Instance of rram_macro.
176
* @param rst Reset port.
177
* @return Reset signal.
178
*/
179
dt_reset_t
dt_rram_macro_reset
(
180
dt_rram_macro_t
dt,
181
dt_rram_macro_reset_t
rst);
182
183
184
185
#ifdef __cplusplus
186
}
// extern "C"
187
#endif
// __cplusplus
188
189
#endif
// OPENTITAN_DT_RRAM_MACRO_H_
(earlgrey)
hw
top
dt
rram_macro.h
Return to
OpenTitan Documentation