Compare commits

..

No commits in common. "main" and "va416xx-v0.4.0" have entirely different histories.

18 changed files with 102 additions and 71 deletions

View File

@ -14,7 +14,7 @@ This workspace contains the following crates:
PAC crate containing basic low-level register definition PAC crate containing basic low-level register definition
- The [`va416xx-hal`](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/va416xx-hal) - The [`va416xx-hal`](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/va416xx-hal)
HAL crate containing higher-level abstractions on top of the PAC register crate. HAL crate containing higher-level abstractions on top of the PAC register crate.
- The [`va416xx-embassy`](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/va416xx-embassy) - The [`va416xx-embassy`](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/va108xx-embassy)
crate containing support for running the embassy-rs RTOS. crate containing support for running the embassy-rs RTOS.
- The [`vorago-peb1`](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/vorago-peb1) - The [`vorago-peb1`](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/vorago-peb1)
BSP crate containing support for the PEB1 development board. BSP crate containing support for the PEB1 development board.

View File

@ -7,9 +7,9 @@ edition = "2021"
cortex-m = "0.7" cortex-m = "0.7"
cortex-m-rt = "0.7" cortex-m-rt = "0.7"
embedded-hal = "1" embedded-hal = "1"
panic-rtt-target = { version = "0.2" } panic-rtt-target = { version = "0.1.3" }
panic-halt = { version = "1" } panic-halt = { version = "0.2" }
rtt-target = { version = "0.6" } rtt-target = { version = "0.5" }
crc = "3" crc = "3"
static_assertions = "1" static_assertions = "1"

View File

@ -12,9 +12,9 @@ embedded-io = "0.6"
embedded-hal-async = "1" embedded-hal-async = "1"
embedded-io-async = "0.6" embedded-io-async = "0.6"
rtt-target = { version = "0.6" } rtt-target = { version = "0.5" }
heapless = "0.8" heapless = "0.8"
panic-rtt-target = { version = "0.2" } panic-rtt-target = { version = "0.1" }
static_cell = "2" static_cell = "2"
critical-section = "1" critical-section = "1"
once_cell = { version = "1", default-features = false, features = ["critical-section"] } once_cell = { version = "1", default-features = false, features = ["critical-section"] }
@ -28,8 +28,11 @@ embassy-executor = { version = "0.7", features = [
"executor-interrupt" "executor-interrupt"
]} ]}
va416xx-hal = { version = "0.4.1" } va416xx-embassy = { path = "../../va416xx-embassy", default-features = false }
va416xx-embassy = { version = "0.1", default-features = false }
[dependencies.va416xx-hal]
path = "../../va416xx-hal"
features = ["va41630"]
[features] [features]
default = ["ticks-hz-1_000", "va416xx-embassy/irq-tim14-tim15"] default = ["ticks-hz-1_000", "va416xx-embassy/irq-tim14-tim15"]

View File

@ -7,11 +7,13 @@ edition = "2021"
cortex-m = { version = "0.7", features = ["critical-section-single-core"] } cortex-m = { version = "0.7", features = ["critical-section-single-core"] }
cortex-m-rt = "0.7" cortex-m-rt = "0.7"
embedded-hal = "1" embedded-hal = "1"
rtt-target = { version = "0.6" } rtt-target = { version = "0.5" }
rtic-sync = { version = "1.3", features = ["defmt-03"] } rtic-sync = { version = "1.3", features = ["defmt-03"] }
panic-rtt-target = { version = "0.2" } panic-rtt-target = { version = "0.1.3" }
va416xx-hal = { version = "0.4", features = ["va41630"] } [dependencies.va416xx-hal]
path = "../../va416xx-hal"
features = ["va41630"]
[dependencies.rtic] [dependencies.rtic]
version = "2" version = "2"

View File

@ -7,16 +7,17 @@ edition = "2021"
cortex-m = { version = "0.7", features = ["critical-section-single-core"] } cortex-m = { version = "0.7", features = ["critical-section-single-core"] }
cortex-m-rt = "0.7" cortex-m-rt = "0.7"
critical-section = "1" critical-section = "1"
panic-rtt-target = { version = "0.2" } panic-rtt-target = { version = "0.1.3" }
rtt-target = { version = "0.6" } rtt-target = { version = "0.5" }
embedded-hal = "1" embedded-hal = "1"
embedded-hal-nb = "1" embedded-hal-nb = "1"
nb = "1" nb = "1"
embedded-io = "0.6" embedded-io = "0.6"
panic-halt = "1" panic-halt = "0.2"
accelerometer = "0.12" accelerometer = "0.12"
va416xx-hal = { version = "0.4", features = ["va41630"] } [dependencies.va416xx-hal]
path = "../../va416xx-hal"
[dependencies.vorago-peb1] [dependencies.vorago-peb1]
path = "../../vorago-peb1" path = "../../vorago-peb1"

View File

@ -9,20 +9,44 @@ cortex-m-rt = "0.7"
embedded-hal = "1" embedded-hal = "1"
embedded-hal-nb = "1" embedded-hal-nb = "1"
embedded-io = "0.6" embedded-io = "0.6"
panic-rtt-target = { version = "0.2" } panic-rtt-target = { version = "0.1.3" }
rtt-target = { version = "0.6" } rtt-target = { version = "0.5" }
rtt-log = "0.5" rtt-log = "0.3"
log = "0.4" log = "0.4"
crc = "3" crc = "3"
rtic-sync = "1" rtic-sync = "1"
static_cell = "2" static_cell = "2"
satrs = { version = "0.3.0-alpha.0", default-features = false }
ringbuf = { version = "0.4", default-features = false }
once_cell = { version = "1", default-features = false, features = ["critical-section"] }
spacepackets = { version = "0.13", default-features = false }
cobs = { version = "0.3", default-features = false }
va416xx-hal = { version = "0.4", features = ["va41630"] } [dependencies.satrs]
version = "0.2"
default-features = false
rtic = { version = "2", features = ["thumbv7-backend"] } [dependencies.ringbuf]
rtic-monotonics = { version = "2", features = ["cortex-m-systick"] } version = "0.4"
default-features = false
[dependencies.once_cell]
version = "1"
default-features = false
features = ["critical-section"]
[dependencies.spacepackets]
version = "0.11"
default-features = false
[dependencies.cobs]
git = "https://github.com/robamu/cobs.rs.git"
branch = "all_features"
default-features = false
[dependencies.va416xx-hal]
path = "../va416xx-hal"
features = ["va41630"]
[dependencies.rtic]
version = "2"
features = ["thumbv7-backend"]
[dependencies.rtic-monotonics]
version = "2"
features = ["cortex-m-systick"]

View File

@ -11,7 +11,7 @@ panic-rtt-target = { version = "0.1.3" }
rtt-target = { version = "0.5" } rtt-target = { version = "0.5" }
cortex-m = { version = "0.7", features = ["critical-section-single-core"] } cortex-m = { version = "0.7", features = ["critical-section-single-core"] }
embedded-hal = "1" embedded-hal = "1"
va416xx-hal = { path = "0.4", features = ["va41630"] } va416xx-hal = { path = "../../va416xx-hal", features = ["va41630"] }
[profile.dev] [profile.dev]
codegen-units = 1 codegen-units = 1

View File

@ -11,7 +11,7 @@ panic-rtt-target = { version = "0.1.3" }
rtt-target = { version = "0.5" } rtt-target = { version = "0.5" }
cortex-m = { version = "0.7", features = ["critical-section-single-core"] } cortex-m = { version = "0.7", features = ["critical-section-single-core"] }
embedded-hal = "1" embedded-hal = "1"
va416xx-hal = { path = "0.4", features = ["va41630"] } va416xx-hal = { path = "../../va416xx-hal", features = ["va41630"] }
[profile.dev] [profile.dev]
codegen-units = 1 codegen-units = 1

View File

@ -8,6 +8,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [unreleased] ## [unreleased]
## [v0.1.0] 2025-02-18 ## [v0.1.0] 2025-02-13
Initial release Initial release

View File

@ -21,20 +21,17 @@ portable-atomic = "1"
once_cell = { version = "1", default-features = false, features = ["critical-section"] } once_cell = { version = "1", default-features = false, features = ["critical-section"] }
va416xx-hal = { version = "0.4.1" } va416xx-hal = { version = "0.3", path = "../va416xx-hal" }
[features] [features]
default = ["irq-tim14-tim15"] default = ["irq-tim14-tim15"]
irqs-in-lib = []
# This determines the reserved interrupt functions for the embassy time drivers. Only one # This determines the reserved interrupt functions for the embassy time drivers. Only one
# is allowed to be selected! # is allowed to be selected!
irq-tim14-tim15 = ["_irqs-in-lib"] irq-tim14-tim15 = ["irqs-in-lib"]
irq-tim13-tim14 = ["_irqs-in-lib"] irq-tim13-tim14 = ["irqs-in-lib"]
# These TIMs are clocked slower! # These TIMs are clocked slower!
irq-tim22-tim23 = ["_irqs-in-lib"] irq-tim22-tim23 = ["irqs-in-lib"]
# Private feature.
_irqs-in-lib = []
[package.metadata.docs.rs] [package.metadata.docs.rs]
rustdoc-args = ["--generate-link-to-definition"] rustdoc-args = ["--generate-link-to-definition"]

View File

@ -136,13 +136,13 @@ pub unsafe fn init<
alarm: AlarmTim, alarm: AlarmTim,
clocks: &Clocks, clocks: &Clocks,
) { ) {
#[cfg(feature = "_irqs-in-lib")] #[cfg(feature = "irqs-in-lib")]
assert_eq!( assert_eq!(
TimekeeperTim::ID, TimekeeperTim::ID,
TIMEKEEPER_IRQ as u8 - TIM_IRQ_OFFSET as u8, TIMEKEEPER_IRQ as u8 - TIM_IRQ_OFFSET as u8,
"Timekeeper TIM and IRQ missmatch" "Timekeeper TIM and IRQ missmatch"
); );
#[cfg(feature = "_irqs-in-lib")] #[cfg(feature = "irqs-in-lib")]
assert_eq!( assert_eq!(
AlarmTim::ID, AlarmTim::ID,
ALARM_IRQ as u8 - TIM_IRQ_OFFSET as u8, ALARM_IRQ as u8 - TIM_IRQ_OFFSET as u8,

View File

@ -8,12 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
# [unreleased] # [unreleased]
# [v0.4.1] 2025-02-18 # [v0.4.0]
- Chip selection is not enforced anymore, but advised through documentation. This makes using
the HAL in libraries a lot easier.
# [v0.4.0] 2025-02-18
## Changed ## Changed
@ -49,7 +44,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Asynchronous UART RX support. - Asynchronous UART RX support.
- Add new `get_tim_raw` unsafe method to retrieve TIM peripheral blocks. - Add new `get_tim_raw` unsafe method to retrieve TIM peripheral blocks.
- `Uart::with_with_interrupt` and `Uart::new_without_interrupt` - `Uart::with_with_interrupt` and `Uart::new_without_interrupt`
- A lot of missing `defmt::Format` implementations.
# [v0.3.0] 2024-30-09 # [v0.3.0] 2024-30-09

View File

@ -1,6 +1,6 @@
[package] [package]
name = "va416xx-hal" name = "va416xx-hal"
version = "0.4.1" version = "0.3.0"
authors = ["Robin Mueller <muellerr@irs.uni-stuttgart.de>"] authors = ["Robin Mueller <muellerr@irs.uni-stuttgart.de>"]
edition = "2021" edition = "2021"
description = "HAL for the Vorago VA416xx family of MCUs" description = "HAL for the Vorago VA416xx family of MCUs"
@ -23,18 +23,23 @@ embedded-io-async = "0.6"
num_enum = { version = "0.7", default-features = false } num_enum = { version = "0.7", default-features = false }
typenum = "1" typenum = "1"
bitflags = "2" bitflags = "2"
bitfield = { version = ">=0.17, <=0.18"} bitfield = "0.17"
fugit = "0.3" fugit = "0.3"
delegate = ">=0.12, <=0.13" delegate = "0.12"
heapless = "0.8" heapless = "0.8"
void = { version = "1", default-features = false } void = { version = "1", default-features = false }
thiserror = { version = "2", default-features = false } thiserror = { version = "2", default-features = false }
portable-atomic = "1" portable-atomic = "1"
embassy-sync = "0.6" embassy-sync = "0.6"
va416xx = { version = "0.4", features = ["critical-section"], default-features = false }
defmt = { version = "0.3", optional = true } defmt = { version = "0.3", optional = true }
[dependencies.va416xx]
default-features = false
path = "../va416xx"
version = "0.4"
features = ["critical-section"]
[features] [features]
default = ["rt", "revb"] default = ["rt", "revb"]
rt = ["va416xx/rt"] rt = ["va416xx/rt"]

View File

@ -11,17 +11,14 @@ raw PAC. This crate also implements traits specified by the
[embedded-hal](https://github.com/rust-embedded/embedded-hal) project, making it compatible with [embedded-hal](https://github.com/rust-embedded/embedded-hal) project, making it compatible with
various drivers in the embedded rust ecosystem. various drivers in the embedded rust ecosystem.
It is generally advised to enable ONE of the following device features to use this crate You have to enable one of the following device features to use this crate depending on
depending on which chip you are using: which chip you are using:
- `va41630` - `va41630`
- `va41629` - `va41629`
- `va41628` - `va41628`
- `va41620` - `va41620`
If no chip is specified, only access to APIs which are common for all families or
which are not disabled for specific families is granted.
## Building ## Building
Building an application requires the `thumbv7em-none-eabihf` cross-compiler toolchain. Building an application requires the `thumbv7em-none-eabihf` cross-compiler toolchain.

View File

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
export RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" export RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options"
cargo +nightly doc --features "defmt va41630" --open cargo +nightly doc --all-features --open

View File

@ -1,23 +1,20 @@
//! This is the **H**ardware **A**bstraction **L**ayer (HAL) for the VA416xx MCU family. //! This is the **H**ardware **A**bstraction **L**ayer (HAL) for the VA416xx MCU family.
//! //!
//! It is an additional hardware abstraction on top of the [peripheral access API](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/va416xx). //! It is an additional hardware abstraction on top of the [peripheral access API](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/va416xx).
//!
//! It is the result of reading the datasheet for the device and encoding a type-safe layer over the //! It is the result of reading the datasheet for the device and encoding a type-safe layer over the
//! raw PAC. This crate also implements traits specified by the //! raw PAC. This crate also implements traits specified by the
//! [embedded-hal](https://github.com/rust-embedded/embedded-hal) project, making it compatible with //! [embedded-hal](https://github.com/rust-embedded/embedded-hal) project, making it compatible with
//! various drivers in the embedded rust ecosystem. //! various drivers in the embedded rust ecosystem.
//!
//! It is generally advised to enable ONE of the following device features to use this crate //! You have to enable one of the following device features to use this crate depending on
//! depending on which chip you are using: //! which chip you are using:
//!
//! - `va41630` //! - `va41630`
//! - `va41629` //! - `va41629`
//! - `va41628` //! - `va41628`
//! - `va41620` //! - `va41620`
//! //!
//! If no option is specified, only access to APIs which are common for all families or
//! which are not disabled for specific families is granted.
//!
//! When using this HAL and writing applications for the VA416xx family in general, it is strongly //! When using this HAL and writing applications for the VA416xx family in general, it is strongly
//! recommended that you set up the clock properly, because the default internal HBO clock //! recommended that you set up the clock properly, because the default internal HBO clock
//! is not very accurate. You can use the [crate::clock] module for this. If you are working //! is not very accurate. You can use the [crate::clock] module for this. If you are working
@ -29,6 +26,15 @@
#[cfg(test)] #[cfg(test)]
extern crate std; extern crate std;
#[cfg(not(feature = "device-selected"))]
compile_error!(
"This crate requires one of the following device features enabled:
va41630
va41629
va41628
"
);
use gpio::Port; use gpio::Port;
pub use va416xx as device; pub use va416xx as device;
pub use va416xx as pac; pub use va416xx as pac;

View File

@ -8,10 +8,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
# [unreleased] # [unreleased]
# [v0.1.1] 2025-02-18
- Bump allowed HAL version to v0.4
# [v0.1.0] 2024-10-01 # [v0.1.0] 2024-10-01
- Initial release - Initial release

View File

@ -1,6 +1,6 @@
[package] [package]
name = "vorago-peb1" name = "vorago-peb1"
version = "0.1.1" version = "0.1.0"
authors = ["Robin Mueller <muellerr@irs.uni-stuttgart.de>"] authors = ["Robin Mueller <muellerr@irs.uni-stuttgart.de>"]
edition = "2021" edition = "2021"
description = "Board Support Crate for the Vorago PEB1 development board" description = "Board Support Crate for the Vorago PEB1 development board"
@ -14,9 +14,15 @@ categories = ["embedded", "no-std", "hardware-support"]
cortex-m = "0.7" cortex-m = "0.7"
cortex-m-rt = "0.7" cortex-m-rt = "0.7"
embedded-hal = "1" embedded-hal = "1"
lis2dh12 = { version = "0.7", features = ["out_f32"] }
va416xx-hal = { version = ">=0.3, <=0.4", features = ["va41630"] } [dependencies.va416xx-hal]
path = "../va416xx-hal"
features = ["va41630"]
version = ">=0.3, <0.4"
[dependencies.lis2dh12]
version = "0.7"
features = ["out_f32"]
[features] [features]
rt = ["va416xx-hal/rt"] rt = ["va416xx-hal/rt"]