Pavona Software APIs
flash_macro_wrapper.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_FLASH_MACRO_WRAPPER_H_
8
#define OPENTITAN_DT_FLASH_MACRO_WRAPPER_H_
9
10
#ifdef __cplusplus
11
extern
"C"
{
12
#endif
// __cplusplus
13
14
/**
15
* @file
16
* @brief Device Tables (DT) for IP flash_macro_wrapper and top egret.
17
*
18
* This file contains the type definitions and global functions of the flash_macro_wrapper.
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_flash_macro_wrapper
{
30
kDtFlashMacroWrapperFirst
= 0,
/**< First instance */
31
kDtFlashMacroWrapper
= 0,
/**< flash_macro_wrapper */
32
}
dt_flash_macro_wrapper_t
;
33
34
enum
{
35
kDtFlashMacroWrapperCount
= 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_flash_macro_wrapper_reg_block
{
45
kDtFlashMacroWrapperRegBlockCore = 0,
/**< */
46
}
dt_flash_macro_wrapper_reg_block_t
;
47
48
enum
{
49
kDtFlashMacroWrapperRegBlockCount
= 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_flash_macro_wrapper_reg_block_t
kDtFlashMacroWrapperRegBlockPrimary = kDtFlashMacroWrapperRegBlockCore;
55
56
/**
57
* List of clock ports.
58
*
59
* Clock ports are guaranteed to be numbered consecutively from 0.
60
*/
61
typedef
enum
dt_flash_macro_wrapper_clock
{
62
kDtFlashMacroWrapperClockClk
= 0,
/**< Clock port clk_i */
63
}
dt_flash_macro_wrapper_clock_t
;
64
65
enum
{
66
kDtFlashMacroWrapperClockCount
= 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_flash_macro_wrapper_reset
{
76
kDtFlashMacroWrapperResetRst
= 0,
/**< Reset port rst_ni */
77
}
dt_flash_macro_wrapper_reset_t
;
78
79
enum
{
80
kDtFlashMacroWrapperResetCount
= 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_flash_macro_wrapper_periph_io
{
90
kDtFlashMacroWrapperPeriphIoTck = 0,
/**< */
91
kDtFlashMacroWrapperPeriphIoTms = 1,
/**< */
92
kDtFlashMacroWrapperPeriphIoTdi = 2,
/**< */
93
kDtFlashMacroWrapperPeriphIoTdo = 3,
/**< */
94
}
dt_flash_macro_wrapper_periph_io_t
;
95
96
enum
{
97
kDtFlashMacroWrapperPeriphIoCount
= 4,
/**< Number of peripheral I/O */
98
};
99
100
101
102
/**
103
* Get the flash_macro_wrapper 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 flash_macro_wrapper instance.
109
*
110
* **Note:** This function only makes sense if the instance ID has device type flash_macro_wrapper,
111
* otherwise the returned value is unspecified.
112
*/
113
dt_flash_macro_wrapper_t
dt_flash_macro_wrapper_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 flash_macro_wrapper.
119
* @return The instance ID of that instance.
120
*/
121
dt_instance_id_t
dt_flash_macro_wrapper_instance_id
(
dt_flash_macro_wrapper_t
dt);
122
123
/**
124
* Get the register base address of an instance.
125
*
126
* @param dt Instance of flash_macro_wrapper.
127
* @param reg_block The register block requested.
128
* @return The register base address of the requested block.
129
*/
130
uint32_t
dt_flash_macro_wrapper_reg_block
(
131
dt_flash_macro_wrapper_t
dt,
132
dt_flash_macro_wrapper_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_flash_macro_wrapper_reg_block(dt, kDtFlashMacroWrapperRegBlockCore)`
139
*
140
* @param dt Instance of flash_macro_wrapper.
141
* @return The register base address of the primary register block.
142
*/
143
static
inline
uint32_t dt_flash_macro_wrapper_primary_reg_block(
144
dt_flash_macro_wrapper_t
dt) {
145
return
dt_flash_macro_wrapper_reg_block
(dt, kDtFlashMacroWrapperRegBlockCore);
146
}
147
148
149
150
/**
151
* Get the peripheral I/O description of an instance.
152
*
153
* @param dt Instance of flash_macro_wrapper.
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_flash_macro_wrapper_periph_io
(
158
dt_flash_macro_wrapper_t
dt,
159
dt_flash_macro_wrapper_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 flash_macro_wrapper.
165
* @param clk Clock port.
166
* @return Clock signal.
167
*/
168
dt_clock_t
dt_flash_macro_wrapper_clock
(
169
dt_flash_macro_wrapper_t
dt,
170
dt_flash_macro_wrapper_clock_t
clk);
171
172
/**
173
* Get the reset signal connected to a reset port of an instance.
174
*
175
* @param dt Instance of flash_macro_wrapper.
176
* @param rst Reset port.
177
* @return Reset signal.
178
*/
179
dt_reset_t
dt_flash_macro_wrapper_reset
(
180
dt_flash_macro_wrapper_t
dt,
181
dt_flash_macro_wrapper_reset_t
rst);
182
183
184
185
#ifdef __cplusplus
186
}
// extern "C"
187
#endif
// __cplusplus
188
189
#endif
// OPENTITAN_DT_FLASH_MACRO_WRAPPER_H_
(egret)
hw
top
dt
flash_macro_wrapper.h
Generated by
1.13.2