[package]
name          = "esp-storage"
version       = "0.8.1"
edition       = "2024"
rust-version  = "1.86.0"
description   = "Implementation of embedded-storage traits to access unencrypted ESP32 flash"
documentation = "https://docs.espressif.com/projects/rust/esp-storage/latest/"
keywords      = ["embedded-storage", "esp32", "espressif", "no-std"]
categories    = ["embedded", "hardware-support", "no-std"]
repository    = "https://github.com/esp-rs/esp-hal"
license       = "MIT OR Apache-2.0"

[package.metadata.espressif]
check-configs = [
    { features = [] },
    { features = ["critical-section"] },
    { features = ["bytewise-read"]},
    { features = ["critical-section", "bytewise-read"] },
]
clippy-configs = [{ features = ["critical-section", "bytewise-read"] }]

[package.metadata.docs.rs]
default-target = "riscv32imac-unknown-none-elf"
features       = ["esp32c6"]

[lib]
bench = false

[dependencies]
embedded-storage = "0.3.1"
procmacros       = { version = "0.21.0", package = "esp-hal-procmacros", path = "../esp-hal-procmacros" }
esp-hal = { version = "1.0.0", path = "../esp-hal", default-features = false, optional = true}

# Optional dependencies
esp-sync         = { version = "0.1.1", path = "../esp-sync", optional = true }
esp-rom-sys      = { version = "0.1.3", path = "../esp-rom-sys", optional = true }
defmt  = { version = "1.0.1", optional = true }

# Unstable dependencies that are not (strictly) part of the public API
document-features = "0.2"

[build-dependencies]
esp-metadata-generated = { version = "0.3.0", path = "../esp-metadata-generated", features = ["build-script"] }

[features]
default = ["critical-section"]

## Place the flash operations in a critical section
critical-section = []

## Bytewise read emulation
bytewise-read = []

## Implement `defmt::Format` on certain types.
defmt = ["dep:defmt"]

#! ### Chip selection
#! One of the following features must be enabled to select the target chip:

##
esp32c2   = ["esp-hal/esp32c2", "esp-hal/unstable", "esp-rom-sys/esp32c2", "esp-sync/esp32c2"]
##
esp32c3   = ["esp-hal/esp32c3", "esp-hal/unstable", "esp-rom-sys/esp32c3", "esp-sync/esp32c3"]
##
esp32c6   = ["esp-hal/esp32c6", "esp-hal/unstable", "esp-rom-sys/esp32c6", "esp-sync/esp32c6"]
##
esp32h2   = ["esp-hal/esp32h2", "esp-hal/unstable", "esp-rom-sys/esp32h2", "esp-sync/esp32h2"]
##
esp32     = ["esp-hal/esp32", "esp-hal/unstable", "esp-rom-sys/esp32", "esp-sync/esp32"]
##
esp32s2   = ["esp-hal/esp32s2", "esp-hal/unstable", "esp-rom-sys/esp32s2", "esp-sync/esp32s2"]
##
esp32s3   = ["esp-hal/esp32s3", "esp-hal/unstable", "esp-rom-sys/esp32s3", "esp-sync/esp32s3"]
## Used for testing on a host.
emulation = []
