|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Battery Backup Function (VBATT / BAT*) register layout for the RA8D2. More...
#include <stdint.h>Go to the source code of this file.
Functions | |
| static volatile uint8_t * | ra8_bkup_vbattmnselr (void) |
| Pointer to 8-bit VBATTMNSELR (HUM Ch 12.2.5 p 503). | |
| static volatile uint8_t * | ra8_bkup_vbtbpcr1 (void) |
| Pointer to 8-bit VBTBPCR1 (HUM Ch 12.2.11 p 507). | |
| static volatile uint8_t * | ra8_bkup_vbtber (void) |
| Pointer to 8-bit VBTBER (HUM Ch 12.2.6 p 504). | |
| static volatile uint8_t * | ra8_bkup_vbtbpcr2 (void) |
| Pointer to 8-bit VBTBPCR2 (HUM Ch 12.2.12 p 508). | |
| static volatile uint8_t * | ra8_bkup_vbtbpsr (void) |
| Pointer to 8-bit VBTBPSR (HUM Ch 12.2.13 p 509). | |
| static volatile uint8_t * | ra8_bkup_vbtadsr (void) |
| Pointer to 8-bit VBTADSR (HUM Ch 12.2.14 p 509). | |
| static volatile uint8_t * | ra8_bkup_vbtadcr1 (void) |
| Pointer to 8-bit VBTADCR1 (HUM Ch 12.2.15 p 510). | |
| static volatile uint8_t * | ra8_bkup_vbtadcr2 (void) |
| Pointer to 8-bit VBTADCR2 (HUM Ch 12.2.16 p 511). | |
| static volatile uint8_t * | ra8_bkup_vbtadcr3 (void) |
| Pointer to 8-bit VBTADCR3 (HUM Ch 12.2.17 p 511). | |
| static volatile uint8_t * | ra8_bkup_vbtictlr (void) |
| Pointer to 8-bit VBTICTLR (HUM Ch 12.2.8 p 505). | |
| static volatile uint8_t * | ra8_bkup_vbtictlr2 (void) |
| Pointer to 8-bit VBTICTLR2 (HUM Ch 12.2.9 p 506). | |
| static volatile uint8_t * | ra8_bkup_vbtimonr (void) |
| Pointer to 8-bit VBTIMONR (HUM Ch 12.2.10 p 506). | |
| static volatile uint8_t * | ra8_bkup_vbtncwcr (void) |
| Pointer to 8-bit VBTNCWCR (HUM Ch 12.2.18 p 511). | |
| static volatile uint32_t * | ra8_bkup_bbfsar (void) |
| Pointer to 32-bit BBFSAR (HUM Ch 12.2.1 p 500). | |
| static volatile uint16_t * | ra8_bkup_vbrsabar (void) |
| Pointer to 16-bit VBRSABAR (HUM Ch 12.2.2 p 502). | |
| static volatile uint16_t * | ra8_bkup_vbrpabars (void) |
| Pointer to 16-bit VBRPABARS (HUM Ch 12.2.3 p 502). | |
| static volatile uint16_t * | ra8_bkup_vbrpabarns (void) |
| Pointer to 16-bit VBRPABARNS (HUM Ch 12.2.4 p 503). | |
| static volatile uint8_t * | ra8_bkup_vbtbkr (uint16_t index) |
| Pointer to one VBTBKRn byte (HUM Ch 12.2.7 p 505). | |
| static volatile uint32_t * | ra8_bkup_vbtbkr_word (uint8_t word_index) |
| Pointer to one VBTBKR 32-bit word slot (4 bytes). | |
Battery Backup Function (VBATT / BAT*) register layout for the RA8D2.
The RA8D2 battery backup block lives inside the SYSC peripheral window (base 0x4001_E000, non-secure alias 0x5001_E000). The full SYSC layout is described in ra8_system_regs.h; this header narrowly mirrors only the BAT* / VBT* register offsets so the battery-backup driver can be reviewed and extended without touching the shared system header.
| Offset | Reg | Width | Purpose |
|---|---|---|---|
| 0x3B0 | VBRSABAR | 16 | Backup-register secure / non-secure boundary |
| 0x3B4 | VBRPABARS | 16 | Backup-register privilege boundary (Secure) |
| 0x3B8 | VBRPABARNS | 16 | Backup-register privilege boundary (Non-sec) |
| 0x3D0 | BBFSAR | 32 | Battery Backup security attribute |
| 0xA84 | VBATTMNSELR | 8 | VBATT voltage-monitor function select |
| 0xA88 | VBTBPCR1 | 8 | Battery power-supply switch stop |
| 0xC40 | VBTBER | 8 | VBATT backup-register access enable (VBAE) |
| 0xC45 | VBTBPCR2 | 8 | VBATT VDETBATT level + VDETE |
| 0xC46 | VBTBPSR | 8 | VBATT power-supply status (VBPORF/VBPORM/SWM) |
| 0xC48 | VBTADSR | 8 | VBATT tamper-detection status (VBTADF[2:0]) |
| 0xC49 | VBTADCR1 | 8 | Tamper IRQ enable + backup-clear enable |
| 0xC4A | VBTADCR2 | 8 | RTC time-capture event source select |
| 0xC4C | VBTICTLR | 8 | RTCICn input enable |
| 0xC4D | VBTICTLR2 | 8 | RTCICn edge / noise-canceller select |
| 0xC4E | VBTIMONR | 8 | RTCICn live input level monitor |
| 0xC50 | VBTNCWCR | 8 | Noise canceller width select |
| 0xC54 | VBTADCR3 | 8 | Tamper HUK Zeroization enable |
| 0xD00 | VBTBKRn | 8 | 128 backup-register bytes (n = 0..127) |
Definition in file ra8_bkup_regs.h.
| enum ra8_bkup_addr_t : uintptr_t |
Battery-backup register window base.
Same physical base as k_ra8_system_base_addr – the BAT* registers live inside the SYSC block. We expose a separate enum value so the bkup driver does not have to depend on the system header.
| Enumerator | |
|---|---|
| k_ra8_bkup_base_addr | SYSC + battery backup base. |
Definition at line 59 of file ra8_bkup_regs.h.
| enum ra8_bkup_bbfsar_mask_t : uint32_t |
BBFSAR target masks (HUM Ch 12.2.1 p 500).
Definition at line 242 of file ra8_bkup_regs.h.
| enum ra8_bkup_limits_t : uint16_t |
Backup-register array dimensions and small numeric limits.
Definition at line 95 of file ra8_bkup_regs.h.
| enum ra8_bkup_off_t : uint16_t |
Byte-offsets of every BAT* / VBT* register the driver touches.
Citations are HUM Ch 12.2.x section numbers, all inside p 498..519.
Definition at line 70 of file ra8_bkup_regs.h.
| enum ra8_bkup_vbattmnselr_mask_t : uint8_t |
Single-bit masks for VBATTMNSELR (HUM Ch 12.2.5 p 503).
| Enumerator | |
|---|---|
| k_ra8_bkup_vbattmnselr_mask_vbtmnsel | VBTMNSEL @ bit 0. |
Definition at line 168 of file ra8_bkup_regs.h.
| enum ra8_bkup_vbtadcr1_mask_t : uint8_t |
Bit masks for VBTADCR1 (HUM Ch 12.2.15 p 510).
Definition at line 181 of file ra8_bkup_regs.h.
| enum ra8_bkup_vbtadcr2_mask_t : uint8_t |
Bit masks for VBTADCR2 (HUM Ch 12.2.16 p 511).
Definition at line 193 of file ra8_bkup_regs.h.
| enum ra8_bkup_vbtadcr3_mask_t : uint8_t |
Bit masks for VBTADCR3 (HUM Ch 12.2.17 p 511).
Definition at line 201 of file ra8_bkup_regs.h.
| enum ra8_bkup_vbtadsr_mask_t : uint8_t |
Single-bit masks for VBTADSR tamper-detection flags (HUM Ch 12.2.14 p 510).
Definition at line 173 of file ra8_bkup_regs.h.
| enum ra8_bkup_vbtber_bit_t : uint8_t |
Bit positions inside VBTBER (HUM Ch 12.2.6 p 504).
| Enumerator | |
|---|---|
| k_ra8_bkup_vbtber_bit_vbae | VBAE: VBTBKRn access enable. |
Definition at line 110 of file ra8_bkup_regs.h.
| enum ra8_bkup_vbtber_mask_t : uint8_t |
Single-bit masks for VBTBER fields.
| Enumerator | |
|---|---|
| k_ra8_bkup_vbtber_mask_vbae | VBAE @ bit 3. |
Definition at line 118 of file ra8_bkup_regs.h.
| enum ra8_bkup_vbtbpcr1_bit_t : uint8_t |
Bit positions inside VBTBPCR1 (HUM Ch 12.2.11 p 507).
| Enumerator | |
|---|---|
| k_ra8_bkup_vbtbpcr1_bit_bpwswstp | Battery power-supply switch stop. |
Definition at line 126 of file ra8_bkup_regs.h.
| enum ra8_bkup_vbtbpcr1_mask_t : uint8_t |
Single-bit masks for VBTBPCR1.
| Enumerator | |
|---|---|
| k_ra8_bkup_vbtbpcr1_mask_bpwswstp | BPWSWSTP @ bit 0. |
Definition at line 131 of file ra8_bkup_regs.h.
| enum ra8_bkup_vbtbpcr2_bit_t : uint8_t |
Bit positions inside VBTBPCR2 (HUM Ch 12.2.12 p 508).
| Enumerator | |
|---|---|
| k_ra8_bkup_vbtbpcr2_bit_vdete | VDETE: VCC drop-detection enable. |
| k_ra8_bkup_vbtbpcr2_shift_lvl | VDETLVL[2:0] @ [2:0]. |
Definition at line 139 of file ra8_bkup_regs.h.
| enum ra8_bkup_vbtbpcr2_mask_t : uint8_t |
Field masks for VBTBPCR2.
| Enumerator | |
|---|---|
| k_ra8_bkup_vbtbpcr2_mask_vdete | VDETE @ bit 4. |
| k_ra8_bkup_vbtbpcr2_mask_lvl | VDETLVL[2:0]. |
Definition at line 145 of file ra8_bkup_regs.h.
| enum ra8_bkup_vbtbpsr_bit_t : uint8_t |
Bit positions inside VBTBPSR (HUM Ch 12.2.13 p 509).
| Enumerator | |
|---|---|
| k_ra8_bkup_vbtbpsr_bit_vbporf | VBATT_POR flag (W0C). |
| k_ra8_bkup_vbtbpsr_bit_vbporm | VBATT_R level monitor. |
| k_ra8_bkup_vbtbpsr_bit_swm | Battery switch monitor. |
Definition at line 154 of file ra8_bkup_regs.h.
| enum ra8_bkup_vbtbpsr_mask_t : uint8_t |
Single-bit masks for VBTBPSR.
| Enumerator | |
|---|---|
| k_ra8_bkup_vbtbpsr_mask_vbporf | VBATT_POR flag. |
| k_ra8_bkup_vbtbpsr_mask_vbporm | VBATT_R OK. |
| k_ra8_bkup_vbtbpsr_mask_swm | Switch monitor. |
Definition at line 161 of file ra8_bkup_regs.h.
| enum ra8_bkup_vbtictlr2_mask_t : uint8_t |
Bit masks for VBTICTLR2 (HUM Ch 12.2.9 p 506).
Definition at line 217 of file ra8_bkup_regs.h.
| enum ra8_bkup_vbtictlr_mask_t : uint8_t |
Bit masks for VBTICTLR (HUM Ch 12.2.8 p 505).
Definition at line 209 of file ra8_bkup_regs.h.
| enum ra8_bkup_vbtimonr_mask_t : uint8_t |
Bit masks for VBTIMONR (HUM Ch 12.2.10 p 506).
Definition at line 229 of file ra8_bkup_regs.h.
| enum ra8_bkup_vbtncwcr_mask_t : uint8_t |
Bit masks for VBTNCWCR (HUM Ch 12.2.18 p 511).
| Enumerator | |
|---|---|
| k_ra8_bkup_vbtncwcr_mask_vincw | VINCW[2:0] @ [2:0]. |
Definition at line 237 of file ra8_bkup_regs.h.
|
inlinestatic |
Pointer to 32-bit BBFSAR (HUM Ch 12.2.1 p 500).
Definition at line 338 of file ra8_bkup_regs.h.
References k_ra8_bkup_base_addr, and k_ra8_bkup_off_bbfsar.
Referenced by ra8_bkup_security_apply(), and ra8_bkup_security_get().
|
inlinestatic |
Pointer to 8-bit VBATTMNSELR (HUM Ch 12.2.5 p 503).
Definition at line 259 of file ra8_bkup_regs.h.
References k_ra8_bkup_base_addr, and k_ra8_bkup_off_vbattmnselr.
Referenced by ra8_bkup_get_voltage_monitor_enabled(), and ra8_bkup_set_voltage_monitor().
|
inlinestatic |
Pointer to 16-bit VBRPABARNS (HUM Ch 12.2.4 p 503).
Definition at line 357 of file ra8_bkup_regs.h.
References k_ra8_bkup_base_addr, and k_ra8_bkup_off_vbrpabarns.
Referenced by ra8_bkup_security_apply(), and ra8_bkup_security_get().
|
inlinestatic |
Pointer to 16-bit VBRPABARS (HUM Ch 12.2.3 p 502).
Definition at line 350 of file ra8_bkup_regs.h.
References k_ra8_bkup_base_addr, and k_ra8_bkup_off_vbrpabars.
Referenced by ra8_bkup_security_apply(), and ra8_bkup_security_get().
|
inlinestatic |
Pointer to 16-bit VBRSABAR (HUM Ch 12.2.2 p 502).
Definition at line 344 of file ra8_bkup_regs.h.
References k_ra8_bkup_base_addr, and k_ra8_bkup_off_vbrsabar.
Referenced by ra8_bkup_security_apply(), and ra8_bkup_security_get().
|
inlinestatic |
Pointer to 8-bit VBTADCR1 (HUM Ch 12.2.15 p 510).
Definition at line 296 of file ra8_bkup_regs.h.
References k_ra8_bkup_base_addr, and k_ra8_bkup_off_vbtadcr1.
Referenced by ra8_bkup_isr_handle(), ra8_bkup_no_switch_init(), ra8_bkup_tamper_disable(), and ra8_bkup_tamper_init().
|
inlinestatic |
Pointer to 8-bit VBTADCR2 (HUM Ch 12.2.16 p 511).
Definition at line 302 of file ra8_bkup_regs.h.
References k_ra8_bkup_base_addr, and k_ra8_bkup_off_vbtadcr2.
Referenced by ra8_bkup_no_switch_init(), ra8_bkup_tamper_disable(), and ra8_bkup_tamper_init().
|
inlinestatic |
Pointer to 8-bit VBTADCR3 (HUM Ch 12.2.17 p 511).
Definition at line 308 of file ra8_bkup_regs.h.
References k_ra8_bkup_base_addr, and k_ra8_bkup_off_vbtadcr3.
Referenced by ra8_bkup_tamper_disable(), and ra8_bkup_tamper_init().
|
inlinestatic |
Pointer to 8-bit VBTADSR (HUM Ch 12.2.14 p 509).
Definition at line 290 of file ra8_bkup_regs.h.
References k_ra8_bkup_base_addr, and k_ra8_bkup_off_vbtadsr.
Referenced by ra8_bkup_clear_status(), ra8_bkup_get_status(), ra8_bkup_init(), ra8_bkup_isr_handle(), ra8_bkup_no_switch_init(), ra8_bkup_tamper_disable(), and ra8_bkup_tamper_init().
|
inlinestatic |
Pointer to 8-bit VBTBER (HUM Ch 12.2.6 p 504).
Definition at line 272 of file ra8_bkup_regs.h.
References k_ra8_bkup_base_addr, and k_ra8_bkup_off_vbtber.
Referenced by ra8_bkup_deinit(), and ra8_bkup_init().
|
inlinestatic |
Pointer to one VBTBKRn byte (HUM Ch 12.2.7 p 505).
| [in] | index | Backup-register index in 0..127. Out-of-range indices return nullptr (the caller is expected to validate, but the accessor is defensive). |
Definition at line 372 of file ra8_bkup_regs.h.
References k_ra8_bkup_base_addr, k_ra8_bkup_off_vbtbkr0, k_ra8_bkup_reg_count, and k_ra8_bkup_reg_stride.
Referenced by ra8_bkup_read_byte(), ra8_bkup_write_byte(), and ra8_bkup_zero_all().
|
inlinestatic |
Pointer to one VBTBKR 32-bit word slot (4 bytes).
| [in] | word_index | Word index in 0..31. The 128-byte VBTBKRn array is little-endian per HUM Ch 12.2.7. |
Definition at line 389 of file ra8_bkup_regs.h.
References k_ra8_bkup_base_addr, k_ra8_bkup_off_vbtbkr0, k_ra8_bkup_word_count, and k_ra8_bkup_word_stride.
Referenced by ra8_bkup_read_word(), and ra8_bkup_write_word().
|
inlinestatic |
Pointer to 8-bit VBTBPCR1 (HUM Ch 12.2.11 p 507).
Definition at line 266 of file ra8_bkup_regs.h.
References k_ra8_bkup_base_addr, and k_ra8_bkup_off_vbtbpcr1.
Referenced by ra8_bkup_cold_start_init(), ra8_bkup_deinit(), ra8_bkup_init(), and ra8_bkup_no_switch_init().
|
inlinestatic |
Pointer to 8-bit VBTBPCR2 (HUM Ch 12.2.12 p 508).
Definition at line 278 of file ra8_bkup_regs.h.
References k_ra8_bkup_base_addr, and k_ra8_bkup_off_vbtbpcr2.
Referenced by ra8_bkup_cold_start_init(), ra8_bkup_init(), and ra8_bkup_no_switch_init().
|
inlinestatic |
Pointer to 8-bit VBTBPSR (HUM Ch 12.2.13 p 509).
Definition at line 284 of file ra8_bkup_regs.h.
References k_ra8_bkup_base_addr, and k_ra8_bkup_off_vbtbpsr.
Referenced by ra8_bkup_clear_status(), ra8_bkup_cold_start_init(), ra8_bkup_get_status(), ra8_bkup_init(), ra8_bkup_no_switch_init(), and ra8_bkup_warm_start_check().
|
inlinestatic |
Pointer to 8-bit VBTICTLR (HUM Ch 12.2.8 p 505).
Definition at line 314 of file ra8_bkup_regs.h.
References k_ra8_bkup_base_addr, and k_ra8_bkup_off_vbtictlr.
Referenced by ra8_bkup_no_switch_init(), ra8_bkup_set_input_enable(), ra8_bkup_tamper_disable(), and ra8_bkup_tamper_init().
|
inlinestatic |
Pointer to 8-bit VBTICTLR2 (HUM Ch 12.2.9 p 506).
Definition at line 320 of file ra8_bkup_regs.h.
References k_ra8_bkup_base_addr, and k_ra8_bkup_off_vbtictlr2.
Referenced by ra8_bkup_no_switch_init(), ra8_bkup_tamper_disable(), and ra8_bkup_tamper_init().
|
inlinestatic |
Pointer to 8-bit VBTIMONR (HUM Ch 12.2.10 p 506).
Definition at line 326 of file ra8_bkup_regs.h.
References k_ra8_bkup_base_addr, and k_ra8_bkup_off_vbtimonr.
Referenced by ra8_bkup_read_input().
|
inlinestatic |
Pointer to 8-bit VBTNCWCR (HUM Ch 12.2.18 p 511).
Definition at line 332 of file ra8_bkup_regs.h.
References k_ra8_bkup_base_addr, and k_ra8_bkup_off_vbtncwcr.
Referenced by ra8_bkup_tamper_init().