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
11extern "C" {
12#endif // __cplusplus
13
14/**
15 * @file
16 * @brief Device Tables (DT) for IP flash_macro_wrapper and top scafi_deprecated.
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 */
30 kDtFlashMacroWrapperFirst = 0, /**< First instance */
31 kDtFlashMacroWrapper = 0, /**< flash_macro_wrapper */
33
34enum {
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 */
45 kDtFlashMacroWrapperRegBlockCore = 0, /**< */
47
48enum {
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). */
54static 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 */
64
65enum {
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 */
78
79enum {
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 */
90 kDtFlashMacroWrapperPeriphIoTck = 0, /**< */
91 kDtFlashMacroWrapperPeriphIoTms = 1, /**< */
92 kDtFlashMacroWrapperPeriphIoTdi = 2, /**< */
93 kDtFlashMacroWrapperPeriphIoTdo = 3, /**< */
95
96enum {
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 */
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 */
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 */
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 */
143static inline uint32_t dt_flash_macro_wrapper_primary_reg_block(
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 */
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 */
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 */
182
183
184
185#ifdef __cplusplus
186} // extern "C"
187#endif // __cplusplus
188
189#endif // OPENTITAN_DT_FLASH_MACRO_WRAPPER_H_