39typedef enum : uint32_t {
84 if (flash_address == LX_NULL) {
85 return (
UINT)LX_ERROR;
87 if (destination == LX_NULL) {
88 return (
UINT)LX_ERROR;
90 for (
ULONG i = 0U; i < words; i++) {
91 destination[i] = flash_address[i];
93 return (
UINT)LX_SUCCESS;
118 if (flash_address == LX_NULL) {
119 return (
UINT)LX_ERROR;
121 if (source == LX_NULL) {
122 return (
UINT)LX_ERROR;
124 for (
ULONG i = 0U; i < words; i++) {
125 flash_address[i] = source[i];
127 return (
UINT)LX_SUCCESS;
148 LX_PARAMETER_NOT_USED(erase_count);
150 return (
UINT)LX_ERROR;
156 return (
UINT)LX_SUCCESS;
177 return (
UINT)LX_ERROR;
182 return (
UINT)LX_ERROR;
185 return (
UINT)LX_SUCCESS;
190 if (nor_flash == LX_NULL) {
191 return (
UINT)LX_ERROR;
201 return (
UINT)LX_SUCCESS;
static ULONG s_ram_sector_buf[LX_NOR_SECTOR_SIZE]
LevelX per-open sector scratch (one logical sector wide).
static UINT internal_ram_block_erase(ULONG block, ULONG erase_count)
Erase one block to the LevelX erased pattern.
static UINT internal_ram_write(ULONG *flash_address, ULONG *source, ULONG words)
Write words ULONGs from source to the backing pointer.
lx_nor_ram_const_t
Geometry + sentinel constants for the RAM NOR driver.
@ k_lx_nor_ram_words_per_block
ULONG words/block.
@ k_lx_nor_ram_erased
LevelX erased word.
@ k_lx_nor_ram_total_words
Backing word count.
@ k_lx_nor_ram_total_blocks
NOR blocks.
unsigned int lx_nor_ram_init(struct LX_NOR_FLASH_STRUCT *nor_flash)
LevelX NOR driver-initialise callback over the static SRAM backing.
static UINT internal_ram_block_erased_verify(ULONG block)
Verify one block is fully erased.
static ULONG s_ram_backing[k_lx_nor_ram_total_words]
The fake NOR media (persists across open/close within one boot).
void lx_nor_ram_wipe(void)
Erase the entire SRAM backing to the LevelX "erased" pattern.
static UINT internal_ram_read(ULONG *flash_address, ULONG *destination, ULONG words)
Read words ULONGs from the backing pointer into destination.
RAM-backed standalone-LevelX NOR driver (the ra8_cache_store DIP seam).
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
static ra8_err_t internal_ram_read(void *ctx, uint32_t lba, uint32_t count, uint8_t *buf)
RAM backend: read count blocks at lba into buf.
static ra8_err_t internal_ram_write(void *context, const uint8_t *data, uint16_t length, uint16_t *written)
Append one complete transfer fragment to private RAM storage.
unsigned int UINT
ThreadX-compatible unsigned int (host stub).
unsigned long ULONG
ThreadX-compatible unsigned long (host stub).