Software APIs
dif_pinmux_autogen.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
6
7#ifndef OPENTITAN_SW_DEVICE_LIB_DIF_AUTOGEN_DIF_PINMUX_AUTOGEN_H_
8#define OPENTITAN_SW_DEVICE_LIB_DIF_AUTOGEN_DIF_PINMUX_AUTOGEN_H_
9
10// THIS FILE HAS BEEN GENERATED, DO NOT EDIT MANUALLY. COMMAND:
11// util/autogen_dif.py -i
12// hw/top_earlgrey/ip_autogen/pinmux/data/pinmux.hjson -o
13// bazel-out/k8-fastbuild/bin/sw/device/lib/dif/autogen
14
15
16/**
17 * @file
18 * @brief <a href="/book/hw/ip/pinmux/">PINMUX</a> Device Interface Functions
19 */
20
21#include <stdbool.h>
22#include <stdint.h>
23
27#include "hw/top/dt/pinmux.h" // Generated.
28
29#ifdef __cplusplus
30extern "C" {
31#endif // __cplusplus
32
33/**
34 * A handle to pinmux.
35 *
36 * This type should be treated as opaque by users.
37 */
38typedef struct dif_pinmux {
39 /**
40 * The base address for the pinmux hardware registers.
41 */
43 /**
44 * The instance, set to `kDtPinmuxCount` if not initialized
45 * through `dif_pinmux_init_from_dt`.
46 */
49
50/**
51 * Creates a new handle for a(n) pinmux peripheral.
52 *
53 * This function does not actuate the hardware.
54 *
55 * @param base_addr The MMIO base address of the pinmux peripheral.
56 * @param[out] pinmux Out param for the initialized handle.
57 * @return The result of the operation.
58 *
59 * DEPRECATED This function exists solely for the transition to
60 * dt-based DIFs and will be removed in the future.
61 */
64 mmio_region_t base_addr,
65 dif_pinmux_t *pinmux);
66
67/**
68 * Creates a new handle for a(n) pinmux peripheral.
69 *
70 * This function does not actuate the hardware.
71 *
72 * @param dt The devicetable description of the device.
73 * @param[out] pinmux Out param for the initialized handle.
74 * @return The result of the operation.
75 */
78 dt_pinmux_t dt,
79 dif_pinmux_t *pinmux);
80
81/**
82 * Get the DT handle from this DIF.
83 *
84 * If this DIF was initialized by `dif_pinmux_init_from_dt(dt, ..)`
85 * then this function will return `dt`. Otherwise it will return an error.
86 *
87 * @param pinmux A pinmux handle.
88 * @param[out] dt DT handle.
89 * @return `kDifBadArg` if the DIF has no DT information, `kDifOk` otherwise.
90 */
93 const dif_pinmux_t *pinmux,
94 dt_pinmux_t *dt);
95
96 /**
97 * A pinmux alert type.
98 */
99 typedef enum dif_pinmux_alert {
100 /**
101 * This fatal alert is triggered when a fatal TL-UL bus integrity fault is detected.
102 */
105
106 /**
107 * Forces a particular alert, causing it to be escalated as if the hardware
108 * had raised it.
109 *
110 * @param pinmux A pinmux handle.
111 * @param alert The alert to force.
112 * @return The result of the operation.
113 */
116 const dif_pinmux_t *pinmux,
117 dif_pinmux_alert_t alert);
118
119
120#ifdef __cplusplus
121} // extern "C"
122#endif // __cplusplus
123
124#endif // OPENTITAN_SW_DEVICE_LIB_DIF_AUTOGEN_DIF_PINMUX_AUTOGEN_H_