File syn_port_flash.h¶
FileList > port > syn_port_flash.h
Go to the source code of this file
Flash storage port interface — implement these for your platform. More...
#include "../common/syn_defs.h"#include <stddef.h>#include <stdint.h>
Public Functions¶
| Type | Name |
|---|---|
| SYN_Status | syn_port_flash_erase (uint32_t addr) Erase a flash sector. |
| SYN_Status | syn_port_flash_read (uint32_t addr, void * buf, size_t len) Read from flash. |
| uint32_t | syn_port_flash_sector_size (uint32_t addr) Get the sector size for the given address. |
| SYN_Status | syn_port_flash_write (uint32_t addr, const void * buf, size_t len) Write to flash. |
Detailed Description¶
Used by the parameter store module for wear-leveled persistent storage. The port exposes raw sector-level operations; SyntropicOS handles wear leveling.
Public Functions Documentation¶
function syn_port_flash_erase¶
Erase a flash sector.
Parameters:
addrStart address of the sector (must be sector-aligned).
Returns:
SYN_OK on success.
function syn_port_flash_read¶
Read from flash.
Parameters:
addrSource address in flash.bufDestination buffer.lenNumber of bytes to read.
Returns:
SYN_OK on success.
function syn_port_flash_sector_size¶
Get the sector size for the given address.
Parameters:
addrAddress within the sector.
Returns:
Sector size in bytes.
function syn_port_flash_write¶
Write to flash.
Flash must be erased before writing (writes can only clear bits). The implementation should handle any alignment requirements.
Parameters:
addrDestination address in flash.bufSource data.lenNumber of bytes to write.
Returns:
SYN_OK on success.
The documentation for this class was generated from the following file src/syntropic/port/syn_port_flash.h