46static const char*
s_tag =
"PWR";
49typedef enum : uint16_t {
57typedef enum : uint8_t {
103 const uint8_t reg = (uint8_t)(((uint16_t)source >> 8) &
k_pwr_byte_mask);
178 const uint32_t mask = (uint32_t)1U << bit;
193 const uint32_t mask = (uint32_t)1U << bit;
207 const uint32_t mask = (uint32_t)1U << bit;
208 *out_enabled = ((*p & mask) != 0U);
225 if ((wupen0 == 0U) && (wupen1 == 0U)) {
static const char * s_tag
Logging / check tag.
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
High-level Clock Generation Circuit driver.
ra8_err_t ra8_cgc_get_clock_hz(ra8_clock_id_t id, uint32_t *out_hz)
Query the current frequency of a clock-tree domain.
ra8_clock_id_t
Identifiers for the clock-tree frequencies queryable at runtime.
Validation and Error-Checking Macros for ra8-firmware.
#define RA8_CHECK_NULL_PTR(ptr, tag, message)
Reject nullptr pointer, returning k_ra8_err_null_ptr.
Error Code Definitions for ra8-firmware.
@ k_ra8_err_invalid_arg
Invalid function argument.
@ k_ra8_err_invalid_state
Module in wrong state for requested operation.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Shared CPU-intrinsic seam for the HAL drivers (host/target split).
static void ra8_hw_wfi(void)
Wait For Interrupt: place the core in low-power wait.
Lightweight Logging Interface for ra8-firmware.
#define ra8_log_error_val(tag, message, value)
RA8 log error val.
#define ra8_log_info(tag, message)
RA8 log info.
#define ra8_log_error(tag, message)
RA8 log error.
Low Power Mode (LPM) register layout for the Renesas RA8D2.
@ k_ra8_lpm_wupen0_off
WUPEN0 (32b) – HUM Ch 14.2.19 p 550.
@ k_ra8_lpm_wupen1_off
WUPEN1 (32b) – HUM Ch 14.2.20 p 552.
Ref-counted Module Stop Control wrapper for the RA8D2.
ra8_err_t ra8_mstp_enable(ra8_mstp_t id)
Reference-counted "ungate this peripheral" request.
ra8_err_t ra8_mstp_init(void)
Re-establish the ra8_mstp ref-count table from current hardware state.
ra8_err_t ra8_mstp_disable(ra8_mstp_t id)
Reference-counted "gate this peripheral" request.
Module Stop Control (MSTP) register layout for the Renesas RA8D2.
ra8_mstp_t
Packed (reg << 8) | bit module-stop identifier.
ra8_err_t ra8_pwr_module_request(ra8_mstp_t id)
Ask for a peripheral's clock to be enabled.
ra8_pwr_dim_t
WUPEN address-decode bounds.
@ k_ra8_pwr_wupen_bits
32 bits per register.
@ k_ra8_pwr_wupen_count
WUPEN0 + WUPEN1.
static void internal_wfi(void)
WFI wrapper.
void ra8_pwr_enter_sleep(void)
Enter CPU sleep mode (peripherals continue running).
static bool internal_decode_wake(ra8_pwr_wake_t source, uint8_t *out_reg, uint8_t *out_bit)
Decode and validate a packed wake source.
ra8_err_t ra8_pwr_wake_source_is_enabled(ra8_pwr_wake_t source, bool *out_enabled)
Read the current WUPEN bit value for a source.
ra8_err_t ra8_pwr_init(void)
Initialise the LPM substrate.
ra8_err_t ra8_pwr_enter_software_standby(void)
Enter Software Standby mode.
ra8_err_t ra8_pwr_module_release(ra8_mstp_t id)
Release a previously-requested peripheral.
static volatile uint32_t * internal_wupen_ptr(uint8_t reg)
Pointer to one of the 32-bit WUPEN registers.
ra8_err_t ra8_pwr_get_clock_hz(ra8_clock_id_t id, uint32_t *out_hz)
Forward to ra8_cgc_get_clock_hz() for naming consistency.
pwr_mask_t
Low-byte mask for register/bit decomposition.
@ k_pwr_byte_mask
Pwr byte mask.
ra8_err_t ra8_pwr_set_wake_source(ra8_pwr_wake_t source)
Enable an LPM wake source.
ra8_err_t ra8_pwr_clear_wake_source(ra8_pwr_wake_t source)
Disable an LPM wake source.
Low Power Mode + clock-domain wrapper.
ra8_pwr_wake_t
Packed (WUPEN register, bit) wake-source identifier.
System Control (SYSC) register layout for the Renesas RA8D2.
@ k_ra8_system_base_addr
R_SYSTEM.