[package]
name = "rlvgl-platform"
version = "0.2.3"
authors = ["Ira Abbott <ira@softobotos.com>"]
edition = "2024"
license = "MIT"
description = "Platform backends, blitters, and hardware integration for rlvgl."
readme = "README.md"
repository = "https://github.com/softoboros/rlvgl"
homepage = "https://github.com/softoboros/rlvgl"
documentation = "https://docs.rs/rlvgl-platform"
keywords = ["embedded", "graphics", "ui", "lvgl", "no_std"]
categories = ["embedded", "gui", "no-std", "graphics"]
publish = true

[dependencies]
rlvgl-core = { version = "0.2.2", path = "../core", default-features = false }
embedded-hal = { version = "1.0", optional = true }
display-interface = { version = "0.5", optional = true }
display-interface-spi = { version = "0.5", optional = true }
winit = { version = "0.30.12", optional = true }
wgpu = { version = "0.19", optional = true, features = ["wgsl"] }
pollster = { version = "0.3", optional = true }
eframe = { version = "0.27", default-features = false, features = ["glow"], optional = true }
embedded-graphics = { version = "0.8", optional = true }
image = { version = "0.25", default-features = false, features = ["png"], optional = true }
bitflags = { version = "2", default-features = false }
heapless = { version = "0.8", default-features = false }
# `portable-atomic` polyfills wider/RMW atomics on targets that lack them in
# core::sync::atomic (e.g. `riscv32imc-unknown-none-elf`, which has no `A`
# extension). On targets that already have hardware atomics it is a no-op
# re-export of `core::sync::atomic`. The polyfill backend is selected
# downstream: esp-hal-driven binaries enable `unsafe-assume-single-core` via
# their own dep on `portable-atomic`; bare riscv32 binaries that lack a
# single-core assumption should enable the `critical-section` feature
# instead and provide a critical-section impl.
portable-atomic = { version = "1", default-features = false }
tracing-subscriber = { version = "0.3", optional = true, features = ["env-filter", "fmt"] }
embedded-sdmmc = { version = "0.9", default-features = false, optional = true }
rlvgl-decomp = { version = "0.2.2", path = "../rlvgl-decomp", optional = true }
libloading = { version = "0.8", optional = true }
uefi = { version = "0.36.1", optional = true }
rlvgl-playit = { path = "../playit", version = "0.2.2", default-features = false, optional = true }
ssd1306 = { version = "0.9", default-features = false, features = ["graphics"], optional = true }
libc = { version = "0.2", optional = true }

[target.'cfg(any(target_arch = "arm", target_os = "none"))'.dependencies]
stm32h7 = { version = "0.15.1", optional = true, features = ["stm32h747cm7", "rt"] }
stm32h7xx-hal = { version = "0.16", optional = true, features = ["stm32h747cm7", "sdmmc", "xspi"] }
cortex-m = { version = "0.7", optional = true, features = ["critical-section-single-core", "cm7"] }
cortex-m-semihosting = { version = "0.5", optional = true }
fatfs = { version = "0.3", default-features = false, features = ["alloc", "core_io"], optional = true }

[features]
default = []
regression = []
## Enable optional SDRAM RAM test blocks in platform
sdram_ramtest = []
# DSIM-ERRATA-001 resolution: simulator implies fontdue — every known
# simulator consumer needs text, and the stub draw_text shipped two
# invisible-text binaries (disco-sim, user-sim) before anyone noticed.
simulator = ["wgpu", "winit", "embedded-graphics", "eframe", "pollster", "dep:image", "tracing-subscriber", "dep:libloading", "fontdue"]
uefi = ["dep:uefi", "dep:rlvgl-playit"]
st7789 = ["embedded-hal", "display-interface", "display-interface-spi"]
ssd1306 = ["dep:ssd1306", "embedded-hal", "display-interface", "embedded-graphics"]
stm32h747i_disco = ["stm32h7", "embedded-hal", "stm32h7xx-hal", "cortex-m", "rlvgl-core/fs"]
## Opt-in to the experimental DSI host bring-up sequence
experimental_dsi_host = []
semihosting = ["dep:cortex-m-semihosting"]
fatfs_nostd = ["dep:fatfs"]
sd_storage = ["dep:embedded-sdmmc"]
audio = ["stm32h7", "embedded-hal"]
dma2d = ["stm32h7"]
freertos = []
splash = ["dep:rlvgl-decomp"]
## Host-only mock implementation of the typed DMA2D submission API.
## Used by `examples/disco-sim/tests/typed_dma2d_host.rs` and any future
## host-side test that wants to exercise `BackBuffer::dma_dst()` /
## `InFlight<T>` lifecycle without hardware.
mock_blitter = []
fontdue = ["rlvgl-core/fontdue"]
png = ["rlvgl-core/png"]
jpeg = ["rlvgl-core/jpeg"]
gif = ["rlvgl-core/gif"]
qrcode = ["rlvgl-core/qrcode"]
apng = ["rlvgl-core/apng", "dep:image"]
lottie = ["rlvgl-core/lottie"]
canvas = ["rlvgl-core/canvas", "embedded-graphics"]
pinyin = ["rlvgl-core/pinyin"]
linux_fbdev = ["dep:libc"]
fatfs = ["rlvgl-core/fatfs"]
nes = ["rlvgl-core/nes"]

[dev-dependencies]
base64 = "0.21"
fatfs = "0.3"
fscommon = "0.1"
trybuild = "1.0"
