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
/**
86
* Get the rram_macro instance from an instance ID
87
*
88
* For example, `dt_uart_from_instance_id(kDtInstanceIdUart3) == kDtUart3`.
89
*
90
* @param inst_id Instance ID.
91
* @return A rram_macro instance.
92
*
93
* **Note:** This function only makes sense if the instance ID has device type rram_macro,
94
* otherwise the returned value is unspecified.
95
*/
96
dt_rram_macro_t
dt_rram_macro_from_instance_id
(
dt_instance_id_t
inst_id);
97
98
/**
99
* Get the instance ID of an instance.
100
*
101
* @param dt Instance of rram_macro.
102
* @return The instance ID of that instance.
103
*/
104
dt_instance_id_t
dt_rram_macro_instance_id
(
dt_rram_macro_t
dt);
105
106
/**
107
* Get the register base address of an instance.
108
*
109
* @param dt Instance of rram_macro.
110
* @param reg_block The register block requested.
111
* @return The register base address of the requested block.
112
*/
113
uint32_t
dt_rram_macro_reg_block
(
114
dt_rram_macro_t
dt,
115
dt_rram_macro_reg_block_t
reg_block);
116
117
/**
118
* Get the primary register base address of an instance.
119
*
120
* This is just a convenience function, equivalent to
121
* `dt_rram_macro_reg_block(dt, kDtRramMacroRegBlockPrim)`
122
*
123
* @param dt Instance of rram_macro.
124
* @return The register base address of the primary register block.
125
*/
126
static
inline
uint32_t dt_rram_macro_primary_reg_block(
127
dt_rram_macro_t
dt) {
128
return
dt_rram_macro_reg_block
(dt, kDtRramMacroRegBlockPrim);
129
}
130
131
132
133
134
/**
135
* Get the clock signal connected to a clock port of an instance.
136
*
137
* @param dt Instance of rram_macro.
138
* @param clk Clock port.
139
* @return Clock signal.
140
*/
141
dt_clock_t
dt_rram_macro_clock
(
142
dt_rram_macro_t
dt,
143
dt_rram_macro_clock_t
clk);
144
145
/**
146
* Get the reset signal connected to a reset port of an instance.
147
*
148
* @param dt Instance of rram_macro.
149
* @param rst Reset port.
150
* @return Reset signal.
151
*/
152
dt_reset_t
dt_rram_macro_reset
(
153
dt_rram_macro_t
dt,
154
dt_rram_macro_reset_t
rst);
155
156
157
158
#ifdef __cplusplus
159
}
// extern "C"
160
#endif
// __cplusplus
161
162
#endif
// OPENTITAN_DT_RRAM_MACRO_H_
(earlgrey)
hw
top
dt
rram_macro.h
Return to
OpenTitan Documentation