-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathCargo.toml
More file actions
132 lines (108 loc) · 4.49 KB
/
Copy pathCargo.toml
File metadata and controls
132 lines (108 loc) · 4.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
[package]
name = "py32-hal"
version = "0.4.1"
edition = "2024"
authors = ["Decaday <myDecaday@outlook.com>", "Andelf <andelf@gmail.com>"]
description = "HAL and Embassy support for the Py32 family of microcontrollers"
repository = "https://github.com/py32-rs/py32-hal"
documentation = "https://docs.rs/py32-hal"
homepage = "https://github.com/py32-rs/py32-hal"
categories = ["embedded", "no-std", "hardware-support"]
keywords = ["py32", "hal", "embedded", "no-std", "hardware-support"]
readme = "README.md"
license = "MIT OR Apache-2.0"
[dependencies]
# py32-metapac = { version = "0.5.0", path = "../py32-data/build/py32-metapac"}
py32-metapac = { version = "0.5.0", git = "https://github.com/py32-rs/py32-metapac.git" }
# --- Cortex-M ---
cortex-m = { version = "0.7", features = [
"critical-section-single-core",
"critical-section",
] }
cortex-m-rt = "0.7"
# --- embedded-hal family ---
embedded-hal-02 = { package = "embedded-hal", version = "0.2.7", features = ["unproven"] }
embedded-hal-1 = { package = "embedded-hal", version = "1.0" }
embedded-hal-async = "1.0"
embedded-hal-nb = "1.0"
# --- Other embedded crates ---
embedded-can = "0.4"
embedded-io = "0.7"
embedded-io-async = "0.7"
embedded-storage = "0.3"
nb = "1.1"
# --- Embassy ---
embassy-hal-internal = { version = "0.5", features = [
"cortex-m",
"prio-bits-4",
] }
embassy-sync = "0.8"
embassy-futures = "0.1"
embassy-time-driver = { version = "0.2", optional = true }
embassy-time = { version = "0.5", optional = true }
embassy-time-queue-utils = { version = "0.3", optional = true }
embassy-embedded-hal = { version = "0.6", default-features = false }
embassy-usb-driver = { version = "0.2", optional = true }
# --- USB ---
musb = { version = "0.3", optional = true, features = ["prebuild"] }
usb-device = { version = "0.3", optional = true }
# --- Utilities ---
cfg-if = "1.0"
critical-section = "1.2"
futures-util = { version = "0.3", default-features = false }
portable-atomic = { version = "1", features = ["require-cas"], optional = true }
# --- Opt-in logging ---
defmt = { version = "1", optional = true }
defmt-rtt = { version = "1", optional = true }
log = { version = "0.4", optional = true }
[build-dependencies]
# py32-metapac = { version = "0.5.0", path = "../py32-data/build/py32-metapac", default-features = false, features = [
py32-metapac = { version = "0.5.0", git = "https://github.com/py32-rs/py32-metapac.git", default-features = false, features = [
"metadata",
] }
proc-macro2 = "1.0.89"
quote = "1.0.37"
[dev-dependencies]
critical-section = { version = "1.1", features = ["std"] }
proptest = "1.5.0"
proptest-state-machine = "0.3.0"
[features]
default = ["rt", "memory-x", "defmt", "time", "exti"]
# --- Core ---
rt = ["py32-metapac/rt"]
memory-x = ["py32-metapac/memory-x"]
# --- Debug / logging ---
defmt = ["dep:defmt", "dep:defmt-rtt", "embassy-usb-driver/defmt", "musb?/defmt"]
# --- Embassy ---
time = ["dep:embassy-time", "embassy-embedded-hal/time"]
exti = []
# --- USB ---
embassy-usb-driver-impl = ["dep:musb", "dep:embassy-usb-driver", "musb/embassy-usb-driver-impl"]
usb-device-impl = ["dep:musb", "dep:usb-device", "musb/usb-device-impl"]
# --- MCU selection ---
py32f002b = ["py32-metapac/py32f002b"]
py32f030f16 = ["py32-metapac/py32f030f16"]
py32f030k28 = ["py32-metapac/py32f030k28"]
py32f072c1b = ["py32-metapac/py32f072c1b", "dep:musb", "musb/builtin-py32f07x"]
# --- Time driver ---
# CC1 is used as the halfway-rollover interrupt; any additional CC channels
# provide timer alarms for embassy-time. embassy-time requires at least one
# allocatable alarm, so timers with only CC1 (e.g. TIM16/TIM17) are NOT
# eligible. (1CH / 1CH_CMP are excluded; all others are fine.)
time-driver-any = ["_time-driver"]
time-driver-tim1 = ["_time-driver"]
time-driver-tim3 = ["_time-driver"]
time-driver-tim15 = ["_time-driver"]
time-driver-systick = ["dep:portable-atomic", "_time-driver"]
_time-driver = ["dep:embassy-time-driver", "time", "dep:embassy-time-queue-utils"]
# --- Safety ---
# WARNING: this allows reusing SWD debug pins, which is dangerous!
# This HAL has no power-on delay, so reconfiguring SWD pins immediately on
# startup can permanently lock you out of reprogramming ("brick") the chip.
# The risk is critical on MCUs without a BOOT button and bootloader
# (e.g. PY32F002B, PY32L020, PY32C64x — on PA2 and PB6).
# Enable only if you understand the risk and have a recovery plan.
unsafe-reuse-swd-pins = []
[package.metadata.docs.rs]
default-target = "thumbv6m-none-eabi"
features = ["py32f072c1b", "embassy-usb-driver-impl"]