733 uint32_t* out_code_dec,
734 uint32_t* out_extra_ted,
735 uint32_t* out_extra_dec);
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
ra8_err_t ra8_flash_set_ecc_decoder_enable(bool enable)
Toggle MRCDECC.DECECEN (read-side ECC decoder).
ra8_err_t ra8_flash_arc_read(ra8_flash_arc_id_t counter, uint32_t *out_count)
Read the current value of an anti-rollback counter.
ra8_err_t ra8_flash_set_security_attribution(uint16_t new_msar)
Update MSAR (MRAM Security Attribution).
ra8_err_t ra8_flash_init(const ra8_flash_cfg_t *cfg)
Initialise the MRAM controller for safe read access.
ra8_err_t ra8_flash_get_startup_area(uint8_t *out_btflg, uint8_t *out_fspr)
Read the current start-up area selection.
ra8_err_t ra8_flash_write_block(uint32_t mram_addr, const uint8_t *src, uint32_t len, ra8_flash_world_t world)
Program 1..32 contiguous bytes into one MRAM page.
ra8_err_t ra8_flash_erase_block(uint32_t mram_addr, ra8_flash_world_t world)
Erase (= program to all 0xFF) one 32-byte MRAM block.
ra8_err_t ra8_flash_set_ecc_encoder_enable(bool enable)
Toggle MRCEECC.ECCEN (program-side ECC encoder).
ra8_err_t ra8_flash_extra_mram_erase(uint32_t mram_addr)
Erase one 32-byte block of extra-MRAM via MACI.
ra8_err_t ra8_flash_get_ecc_error_addr(uint32_t *out_code_ted, uint32_t *out_code_dec, uint32_t *out_extra_ted, uint32_t *out_extra_dec)
Snapshot the latched ECC fault addresses.
ra8_err_t ra8_flash_reset(void)
Reset the MRAM peripheral and clear status.
ra8_err_t ra8_flash_set_update_transfer(uint8_t list_select)
Trigger the MRAM update transfer (MCTRCNTR).
ra8_err_t ra8_flash_set_rww_disable(bool disable)
Disable the read-while-write prefetch buffer.
ra8_err_t ra8_flash_zeroize_huk(void)
Trigger the W-HUK zeroize via MREZC.
ra8_err_t ra8_flash_set_irq_enable(ra8_flash_irq_src_t src, bool enable)
Enable or disable MRAM-controller IRQs by source.
ra8_err_t ra8_flash_update_clock_freq(uint16_t mrcfreq_mhz, uint8_t mrefreq_mhz)
Re-issue the keyed MRCFREQ / MREFREQ to track a clock change.
uint32_t ra8_flash_dispatch_isr(void)
Run the MRAM IRQ dispatcher (call from the BSP vector).
ra8_err_t ra8_flash_callback_set(ra8_flash_callback_t cb, void *user_ctx)
Register the unified IRQ callback.
ra8_err_t ra8_flash_config_set_write(uint32_t target_addr, const uint16_t *words)
Issue an 8-halfword MACI program command to the OFS or extra-MRAM area.
ra8_err_t ra8_flash_get_status(uint8_t *out_status)
Snapshot the program-status register.
ra8_err_t ra8_flash_get_extended_status(ra8_flash_status_ext_t *out)
Snapshot every status register the HUM exposes.
ra8_err_t ra8_flash_get_program_error_addr(uint32_t *out_addr)
Snapshot the program-error address (MRCPEA).
ra8_err_t ra8_flash_get_update_status(uint8_t *out_busy, uint8_t *out_done, uint8_t *out_err)
Poll the MRAM update-transfer status.
ra8_err_t ra8_flash_arc_increment(ra8_flash_arc_id_t counter)
Increment the selected anti-rollback counter.
ra8_err_t ra8_flash_enter_pe_mode(void)
Enter MRAM P/E mode.
ra8_err_t ra8_flash_block_protect_set(ra8_flash_world_t world, bool lock, bool permanent)
Set or clear the per-world block-protection lock.
ra8_err_t ra8_flash_clear_status(uint8_t mask)
Clear sticky program-error bits in MRCPS.
ra8_err_t ra8_flash_force_stop(void)
Issue the MACI forced stop command.
ra8_err_t ra8_flash_set_startup_area(ra8_flash_startup_t target, bool temporary)
Switch the start-up area between default and alternate banks.
ra8_err_t ra8_flash_msuinitr_kick(void)
Kick MSUINITR to re-load the OFS sequencer.
ra8_err_t ra8_flash_extra_mram_write(uint32_t mram_addr, const uint8_t *src, uint32_t len)
Program 1..32 contiguous bytes into the general-purpose extra-MRAM window.
ra8_err_t ra8_flash_deinit(void)
Deinitialise: lock all program gates and re-enable prefetch.
ra8_err_t ra8_flash_exit_pe_mode(void)
Exit MRAM P/E mode (return to read mode).
Flash / MRAM controller register layout for the Renesas RA8D2.
Code MRAM driver – shared types (enums, structs, callback typedef).
ra8_flash_arc_id_t
Anti-rollback counter identifier.
ra8_flash_startup_t
Boot-area selection for ra8_flash_set_startup_area.
ra8_flash_irq_src_t
Source identifier for unified flash IRQ dispatcher.
ra8_flash_world_t
Which secure-attribution gate to open for a write.
void(* ra8_flash_callback_t)(const ra8_flash_isr_event_t *ev)
Callback signature for the unified flash IRQ dispatcher.
Initialisation descriptor for ra8_flash_init.
Extended status snapshot (MRCPS + MSTATR + MASTAT + MREZS).