ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_mstp.h
Go to the documentation of this file.
1
57
58#pragma once
59
60#ifdef __cplusplus
61extern "C" {
62#endif
63
64#include <stdint.h>
65
66#include "ra8_err.h"
67#include "ra8_mstp_regs.h"
68
69/* =============================================================================
70 * Module-level lifecycle
71 * =============================================================================
72 */
73
108[[nodiscard]] ra8_err_t ra8_mstp_init(void);
109
110/* =============================================================================
111 * Per-peripheral enable / disable
112 * =============================================================================
113 */
114
175[[nodiscard]] ra8_err_t ra8_mstp_enable(ra8_mstp_t id);
176
220[[nodiscard]] ra8_err_t ra8_mstp_disable(ra8_mstp_t id);
221
249[[nodiscard]] ra8_err_t ra8_mstp_get_refcount(ra8_mstp_t id, uint8_t* out_ref);
250
278[[nodiscard]] ra8_err_t ra8_mstp_is_stopped(ra8_mstp_t id, bool* out_stopped);
279
280#ifdef __cplusplus
281}
282#endif
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
ra8_err_t ra8_mstp_enable(ra8_mstp_t id)
Reference-counted "ungate this peripheral" request.
Definition ra8_mstp.c:343
ra8_err_t ra8_mstp_is_stopped(ra8_mstp_t id, bool *out_stopped)
Read the current MSTP bit value for an id.
Definition ra8_mstp.c:432
ra8_err_t ra8_mstp_get_refcount(ra8_mstp_t id, uint8_t *out_ref)
Read the current ref count for an MSTP id.
Definition ra8_mstp.c:420
ra8_err_t ra8_mstp_init(void)
Re-establish the ra8_mstp ref-count table from current hardware state.
Definition ra8_mstp.c:291
ra8_err_t ra8_mstp_disable(ra8_mstp_t id)
Reference-counted "gate this peripheral" request.
Definition ra8_mstp.c:382
Module Stop Control (MSTP) register layout for the Renesas RA8D2.
ra8_mstp_t
Packed (reg << 8) | bit module-stop identifier.