|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Cross-TU shared surface for the ra8_bkup driver split. More...
Go to the source code of this file.
Functions | |
| void | priv_ra8_bkup_internal_rmw8 (volatile uint8_t *reg, uint8_t mask, bool enable, uint16_t unlock_val) |
| Set or clear a bit in an 8-bit PRCR-protected RMW register. | |
Variables | |
| const char * | g_bkup_tag |
| Log tag used for this driver's diagnostics. | |
| bool | s_bkup_initialized |
| true once any of the lifecycle init helpers have run. | |
Cross-TU shared surface for the ra8_bkup driver split.
The ra8_bkup driver is split across three translation units to stay under the per-file line-count cap, one per responsibility:
This src/-local header carries the handful of symbols those TUs share: the driver-wide log tag, the init latch that gates the ISR, and the protected read-modify-write helper. Everything else stayed private to the TU that owns it – the tamper channel-bit helper and per-channel validator are used nowhere else, and the security TU borrows nothing but the log tag. It is NOT part of the public ABI; production code outside this driver must use ra8_bkup.h.
Definition in file ra8_bkup_internal.h.
| void priv_ra8_bkup_internal_rmw8 | ( | volatile uint8_t * | reg, |
| uint8_t | mask, | ||
| bool | enable, | ||
| uint16_t | unlock_val ) |
Set or clear a bit in an 8-bit PRCR-protected RMW register.
The read half needs no unlock (PRCR gates writes only, HUM Ch 13.1 p 520), so only the store runs inside the protection window. The caller supplies the window because this driver spans three groups: PRC1 for the VBT* file and PRC3 for VBATTMNSELR.
Shared by both register-touching TUs of the driver: ra8_bkup.c uses it for the status W0C paths and the voltage-monitor select, and ra8_bkup_tamper.c uses it for the per-channel input enable.
| [in,out] | reg | Pointer to the live 8-bit register. |
| [in] | mask | Bit mask to manipulate. |
| [in] | enable | true to set, false to clear. |
| [in] | unlock_val | k_ra8_prcr_unlock_* for reg's group. |
reg (HUM Table 13.1). reg's PRCR group is locked is discarded silently, with no bus fault and no status flag (issue #131). Do not separate the write from its unlock.Definition at line 172 of file ra8_bkup.c.
References RA8_PROTECTED_WRITE.
Referenced by ra8_bkup_clear_status(), ra8_bkup_isr_handle(), ra8_bkup_set_input_enable(), and ra8_bkup_set_voltage_monitor().
|
extern |
Log tag used for this driver's diagnostics.
Log tag every TU of this driver logs under.
Defined once here and shared with the tamper and security TUs through ra8_bkup_internal.h, so the whole driver logs under one identity.
Defined once in ra8_bkup.c. The tamper and security TUs reference it through this declaration rather than each defining their own copy, so the driver has a single logging identity and a single object.
Definition at line 88 of file ra8_bkup.c.
Referenced by internal_validate_security_cfg(), internal_validate_tamper_channels(), ra8_bkup_cold_start_init(), ra8_bkup_deinit(), ra8_bkup_get_status(), ra8_bkup_get_voltage_monitor_enabled(), ra8_bkup_init(), ra8_bkup_no_switch_init(), ra8_bkup_read_byte(), ra8_bkup_read_input(), ra8_bkup_read_word(), ra8_bkup_security_apply(), ra8_bkup_security_get(), ra8_bkup_tamper_init(), ra8_bkup_warm_start_check(), ra8_bkup_write_byte(), and ra8_bkup_write_word().
|
extern |
true once any of the lifecycle init helpers have run.
Defined here and referenced from ra8_bkup_tamper.c through ra8_bkup_internal.h: ra8_bkup_tamper_init is an init entry point in its own right, so it sets the flag too.
Defined once in ra8_bkup.c and referenced from ra8_bkup_tamper.c through this declaration: ra8_bkup_tamper_init is an init entry point in its own right, so it sets the latch too. Read only by ra8_bkup_isr_handle, which returns k_ra8_err_not_initialized while the latch is clear.
Definition at line 120 of file ra8_bkup.c.
Referenced by ra8_bkup_cold_start_init(), ra8_bkup_deinit(), ra8_bkup_init(), ra8_bkup_isr_handle(), ra8_bkup_no_switch_init(), and ra8_bkup_tamper_init().