blob: 9aa111dc85dedddf4b09169ac491cee23f09d2cb [file] [log] [blame]
// Copyright 2020 The Pigweed Authors
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.
#pragma once
#include <cstdint>
namespace pw {
namespace partition_table {
enum DataType { kRawData, kKvs };
} // namespace partition_table
enum class PartitionPermission : bool {
kReadOnly = true,
kReadAndWrite = false,
struct PartitionTableEntry {
constexpr PartitionTableEntry(
const uint32_t start_sector_index,
const uint32_t end_sector_index,
const uint8_t partition_identifier,
partition_table::DataType datatype,
PartitionPermission permission = PartitionPermission::kReadAndWrite)
: partition_start_sector_index(start_sector_index),
partition_permission(permission) {}
const uint32_t partition_start_sector_index;
const uint32_t partition_end_sector_index;
const uint8_t partition_id;
const partition_table::DataType data_type;
const PartitionPermission partition_permission;
} // namespace pw