mirror of
https://github.com/esp-rs/esp-hal.git
synced 2025-09-27 12:20:56 +00:00
106 lines
3.5 KiB
TOML
106 lines
3.5 KiB
TOML
[package]
|
|
name = "esp-println"
|
|
version = "0.15.0"
|
|
edition = "2024"
|
|
rust-version = "1.86.0"
|
|
description = "Provides `print!` and `println!` implementations various Espressif devices"
|
|
documentation = "https://docs.espressif.com/projects/rust/esp-println/latest/"
|
|
keywords = ["defmt", "embedded", "esp32", "espressif", "logging"]
|
|
categories = ["embedded", "hardware-support", "no-std"]
|
|
repository = "https://github.com/esp-rs/esp-hal"
|
|
license = "MIT OR Apache-2.0"
|
|
links = "esp-println"
|
|
|
|
[package.metadata.docs.rs]
|
|
cargo-args = ["-Z", "build-std=core"]
|
|
default-target = "riscv32imc-unknown-none-elf"
|
|
features = ["esp32c3"]
|
|
|
|
[lib]
|
|
bench = false
|
|
test = false
|
|
|
|
[dependencies]
|
|
document-features = "0.2.11"
|
|
|
|
# Unstable dependencies that are not (strictly) part of the public API
|
|
esp-sync = { version = "0.0.0", path = "../esp-sync", optional = true }
|
|
|
|
# Optional dependencies
|
|
portable-atomic = { version = "1.11.0", optional = true, default-features = false }
|
|
|
|
# Logging interfaces, they are mutually exclusive so they need to be behind separate features.
|
|
defmt = { version = "1.0.1", optional = true }
|
|
log-04 = { package = "log", version = "0.4.27", optional = true }
|
|
|
|
[build-dependencies]
|
|
esp-metadata-generated = { version = "0.1.0", path = "../esp-metadata-generated", features = ["build-script"] }
|
|
log-04 = { package = "log", version = "0.4.27" }
|
|
|
|
[features]
|
|
default = ["auto", "colors", "critical-section"]
|
|
|
|
esp32 = ["esp-metadata-generated/esp32"]
|
|
esp32c2 = ["esp-metadata-generated/esp32c2"]
|
|
esp32c3 = ["esp-metadata-generated/esp32c3"]
|
|
esp32c6 = ["esp-metadata-generated/esp32c6"]
|
|
esp32h2 = ["esp-metadata-generated/esp32h2"]
|
|
esp32s2 = ["esp-metadata-generated/esp32s2"]
|
|
esp32s3 = ["esp-metadata-generated/esp32s3"]
|
|
|
|
## Use a critical section around print calls. This ensures that the output is consistent.
|
|
critical-section = ["dep:esp-sync"]
|
|
## Prints the timestamp in the log message.
|
|
##
|
|
## This option requires the following function to be implemented:
|
|
##
|
|
## ```rust
|
|
## extern "Rust" {
|
|
## fn _esp_println_timestamp() -> u64;
|
|
## }
|
|
## ```
|
|
##
|
|
## This function should return the current timestamp in milliseconds since power on.
|
|
## When using [`esp_hal`], you can define this function as follows:
|
|
##
|
|
## ```rust
|
|
## #[no_mangle]
|
|
## pub extern "Rust" fn _esp_println_timestamp() -> u64 {
|
|
## esp_hal::time::Instant::now()
|
|
## .duration_since_epoch()
|
|
## .as_millis()
|
|
## }
|
|
## ```
|
|
##
|
|
## [`esp_hal`]: https://crates.io/crates/esp-hal
|
|
timestamp = []
|
|
|
|
#! ### Output interfaces
|
|
#! You must enable exactly 1 of the below features to enable to intended
|
|
#! communication method.
|
|
|
|
## Automatically select the best output interface for the target.
|
|
auto = ["dep:portable-atomic"]
|
|
## Use the `USB_SERIAL_JTAG` interface for printing. Available on ESP32-C3, ESP32-C6, ESP32-H2, ESP32-P4, and ESP32-S3.
|
|
jtag-serial = ["dep:portable-atomic"]
|
|
## Use the `UART0` peripheral for printing. Available on all devices.
|
|
uart = []
|
|
## Don't print anything
|
|
no-op = []
|
|
|
|
#! ### Logging framework features
|
|
## Enables using the `log` crate for logging.
|
|
log-04 = ["dep:log-04"]
|
|
## Enables printing using `defmt`.
|
|
##
|
|
## defmt-encoded output can only be read using espflash. With esp_hal, this works out of the box.
|
|
## Without esp_hal, you need to set the `--log-format defmt` argument for espflash.
|
|
defmt-espflash = ["dep:defmt", "defmt?/encoding-rzcobs"]
|
|
|
|
#! ### `log`-specific features
|
|
## Colors the message severity in the terminal.
|
|
colors = []
|
|
|
|
[lints.rust]
|
|
static_mut_refs = "allow"
|