mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-28 12:30:58 +00:00
Commonise flash-based OTA. Add h7 support.
This commit is contained in:
1 parent
6e648c90b0
commit
b37efbe891
22 files changed
+2069
-1173
No files matched your search
@@ -0,0 +1,21 @@
|
||||
// Copyright (c) 2023 Cesanta Software Limited
|
||||
// All rights reserved
|
||||
|
||||
#pragma once
|
||||
|
||||
// Flash information
|
||||
void *mg_flash_start(void); // Return flash start address
|
||||
size_t mg_flash_size(void); // Return flash size
|
||||
size_t mg_flash_sector_size(void); // Return flash sector size
|
||||
size_t mg_flash_write_align(void); // Return flash write align, minimum 4
|
||||
int mg_flash_bank(void); // 0: not dual bank, 1: bank1, 2: bank2
|
||||
|
||||
// Write, erase, swap bank
|
||||
bool mg_flash_write(void *addr, const void *buf, size_t len);
|
||||
bool mg_flash_erase(void *addr); // Must be at sector boundary
|
||||
bool mg_flash_swap_bank(void);
|
||||
|
||||
// Convenience functions to store data on a flash sector with wear levelling
|
||||
// If `sector` is NULL, then the last sector of flash is used
|
||||
bool mg_flash_load(void *sector, uint32_t key, void *buf, size_t len);
|
||||
bool mg_flash_save(void *sector, uint32_t key, const void *buf, size_t len);
|
||||
Reference in new issue
Block a user