ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_mrms_regs.h
Go to the documentation of this file.
1
40
41#pragma once
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47#include <stdint.h>
48
49/* =============================================================================
50 * Base address
51 * =============================================================================
52 */
53
58typedef enum : uintptr_t {
59 k_ra8_mrms_base_addr = 0x4013C000UL,
61
62/* =============================================================================
63 * Register offsets within the MRMS block
64 * =============================================================================
65 */
66
71typedef enum : uint16_t {
76
77/* =============================================================================
78 * Field encodings
79 * =============================================================================
80 */
81
93typedef enum : uint32_t {
94 k_ra8_mrcfreq_key = 0x1E000000UL,
95 k_ra8_mrefreq_key = 0xE1000000UL,
97
107typedef enum : uint32_t {
108 k_ra8_mrcpfb_disable = 0x00000000UL,
109 k_ra8_mrcpfb_enable = 0x00000001UL,
111
121typedef enum : uint32_t {
124
125/* =============================================================================
126 * Inline accessors
127 * =============================================================================
128 */
129
143static inline volatile uint32_t* ra8_mrms_mrcpfb(void)
144{
145 return (volatile uint32_t*)((uintptr_t)k_ra8_mrms_base_addr + (uintptr_t)k_ra8_mrms_off_mrcpfb);
146}
147
161static inline volatile uint32_t* ra8_mrms_mrcfreq(void)
162{
163 return (volatile uint32_t*)((uintptr_t)k_ra8_mrms_base_addr + (uintptr_t)k_ra8_mrms_off_mrcfreq);
164}
165
179static inline volatile uint32_t* ra8_mrms_mrefreq(void)
180{
181 return (volatile uint32_t*)((uintptr_t)k_ra8_mrms_base_addr + (uintptr_t)k_ra8_mrms_off_mrefreq);
182}
183
184#ifdef __cplusplus
185}
186#endif
static volatile uint32_t * ra8_mrms_mrefreq(void)
Get pointer to the 32-bit MREFREQ register (MRPCLK frequency).
static volatile uint32_t * ra8_mrms_mrcpfb(void)
Get pointer to the 32-bit MRCPFB register.
ra8_mrms_pfb_threshold_t
MRICLK frequency threshold below which the prefetch buffer must remain disabled.
@ k_ra8_mrcpfb_threshold_mhz
Minimum MRICLK MHz to enable PFB.
ra8_mrms_key_t
Mandatory key bytes that must occupy the upper byte of MRCFREQ / MREFREQ for hardware to accept the w...
@ k_ra8_mrcfreq_key
MRCFREQ unlock key, upper byte = 0x1E.
@ k_ra8_mrefreq_key
MREFREQ unlock key, upper byte = 0xE1.
ra8_mrms_addr_t
Base address for the MRMS register block.
@ k_ra8_mrms_base_addr
R_MRMS base.
ra8_mrms_pfb_t
Values written to MRCPFB to enable / disable the prefetch buffer.
@ k_ra8_mrcpfb_disable
Prefetch buffer off.
@ k_ra8_mrcpfb_enable
Prefetch buffer on.
ra8_mrms_offset_t
Per-register offsets relative to k_ra8_mrms_base_addr.
@ k_ra8_mrms_off_mrcfreq
MRCFREQ MRICLK frequency latch (key 0x1E).
@ k_ra8_mrms_off_mrcpfb
MRCPFB prefetch buffer enable.
@ k_ra8_mrms_off_mrefreq
MREFREQ MRPCLK frequency latch (key 0xE1).
static volatile uint32_t * ra8_mrms_mrcfreq(void)
Get pointer to the 32-bit MRCFREQ register (MRICLK frequency).