|
PER Firmware
|
STM32G4 internal-flash register-level implementation interface. More...
#include <stdbool.h>#include <stdint.h>Go to the source code of this file.
Classes | |
| struct | flash_operation_context_t |
Functions | |
| bool | FLASH_PRIV_begin_read (void) |
| Acquire the flash operation lock, wait for idle, and clear status. | |
| bool | FLASH_PRIV_end_read (void) |
| Finish a read operation and release the operation lock. | |
| bool | FLASH_PRIV_begin_operation (flash_operation_context_t *context) |
| Prepare the controller for programming or page erase. | |
| bool | FLASH_PRIV_end_operation (const flash_operation_context_t *context) |
| Finalize a completed operation, restore cache state, lock the controller, and release the operation lock. | |
| uint32_t | FLASH_PRIV_get_size_bytes (void) |
| Read the device-reported internal flash capacity. | |
| uint32_t | FLASH_PRIV_get_page_size_bytes (void) |
| Determine the active page size from the dual-bank option bit. | |
| bool | FLASH_PRIV_program_double_word (uint32_t address, uint64_t data) |
| Program one STM32G4 double word. | |
| bool | FLASH_PRIV_erase_page (uint32_t page_address) |
| Erase one complete flash page. | |
STM32G4 internal-flash register-level implementation interface.
Only flash.c and flash_priv.c should include this header. The public API operates on byte ranges; this interface owns controller lock, cache, bank, page, and status-register details.
| bool FLASH_PRIV_begin_operation | ( | flash_operation_context_t * | context | ) |
Prepare the controller for programming or page erase.
This validates the operating voltage, waits for idle, disables data cache, unlocks the controller, and clears stale status flags.
| context | Output cache state restored by FLASH_PRIV_end_operation(). |
| bool FLASH_PRIV_begin_read | ( | void | ) |
Acquire the flash operation lock, wait for idle, and clear status.
| bool FLASH_PRIV_end_operation | ( | const flash_operation_context_t * | context | ) |
Finalize a completed operation, restore cache state, lock the controller, and release the operation lock.
| context | Cache state returned by FLASH_PRIV_begin_operation(). |
| bool FLASH_PRIV_end_read | ( | void | ) |
Finish a read operation and release the operation lock.
| bool FLASH_PRIV_erase_page | ( | uint32_t | page_address | ) |
Erase one complete flash page.
The page number and bank are derived from the absolute page address and the current device bank configuration.
| page_address | Address of the page start. |
| uint32_t FLASH_PRIV_get_page_size_bytes | ( | void | ) |
Determine the active page size from the dual-bank option bit.
| uint32_t FLASH_PRIV_get_size_bytes | ( | void | ) |
Read the device-reported internal flash capacity.
| bool FLASH_PRIV_program_double_word | ( | uint32_t | address, |
| uint64_t | data ) |
Program one STM32G4 double word.
| address | 8-byte-aligned flash destination. |
| data | 64-bit value written low word first. |