initial import from picomap firmware
This commit is contained in:
20
include/flash.h
Normal file
20
include/flash.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#include <tuple>
|
||||
|
||||
namespace flash {
|
||||
|
||||
constexpr uint32_t FLASH_BASE = 0x10000000;
|
||||
constexpr uint32_t FLASH_SIZE = 2 * 1024 * 1024;
|
||||
|
||||
struct slot {
|
||||
bool valid;
|
||||
uint32_t version;
|
||||
bool hash_ok;
|
||||
auto as_tuple() const { return std::tie(valid, version, hash_ok); }
|
||||
auto as_tuple() { return std::tie(valid, version, hash_ok); }
|
||||
};
|
||||
|
||||
slot scan(uint32_t flash_offset);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user