14 Commits

Author SHA1 Message Date
aea3d835f0 Merge pull request 'prepare embassy release' (#63) from prep-embassy-release into main
Reviewed-on: #63
2025-02-18 18:33:02 +01:00
5f39b916fa prepare embassy release 2025-02-18 18:26:38 +01:00
6d8a114f49 Merge pull request 'prepare HAL patch and embassy release' (#62) from prep-hal-patch-embassy-release into main
Reviewed-on: #62
2025-02-18 18:24:09 +01:00
969f0f4ca5 prepare HAL patch and embassy release 2025-02-18 18:20:11 +01:00
b6971ab7eb Merge pull request 'bump all dependencies and prepare BSP and embassy release' (#61) from prep-bsp-embassy-releases into main
Reviewed-on: #61
2025-02-18 16:56:44 +01:00
41b215e326 bump all dependencies and prepare BSP and embassy release 2025-02-18 16:55:08 +01:00
43da650d78 Merge pull request 'prep HAL release v0.4.0' (#60) from prep-hal-v0.4.0 into main
Reviewed-on: #60
2025-02-18 16:27:58 +01:00
c67f50c96c prep HAL release v0.4.0 2025-02-18 16:26:44 +01:00
770d6cb905 date fix CHANGELOG 2025-02-18 15:16:14 +01:00
9878f3b493 Merge pull request 'update VS Code files' (#59) from update-vscode-files into main
Reviewed-on: #59
2025-02-17 11:38:03 +01:00
1b07d0f258 update VS Code files 2025-02-17 11:36:40 +01:00
d785f8ab88 Merge pull request 'fix for UART example' (#58) from example-fix into main
Reviewed-on: #58
2025-02-17 11:35:40 +01:00
527243ab96 fix for UART example 2025-02-17 11:35:11 +01:00
617ba3cca0 Merge pull request 'PAC changelog' (#57) from pac-changelog into main
Reviewed-on: #57
2025-02-17 11:33:22 +01:00
21 changed files with 202 additions and 104 deletions

View File

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

View File

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

View File

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

View File

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

View File

@@ -33,10 +33,10 @@ fn main() -> ! {
let rx = gpiob.pg1.into_funsel_1();
let uart0 = uart::Uart::new(
&mut dp.sysconfig,
dp.uart0,
(tx, rx),
Hertz::from_raw(115200),
&mut dp.sysconfig,
&clocks,
);
let (mut tx, mut rx) = uart0.split();

View File

@@ -9,44 +9,20 @@ cortex-m-rt = "0.7"
embedded-hal = "1"
embedded-hal-nb = "1"
embedded-io = "0.6"
panic-rtt-target = { version = "0.1.3" }
rtt-target = { version = "0.5" }
rtt-log = "0.3"
panic-rtt-target = { version = "0.2" }
rtt-target = { version = "0.6" }
rtt-log = "0.5"
log = "0.4"
crc = "3"
rtic-sync = "1"
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 }
[dependencies.satrs]
version = "0.2"
default-features = false
va416xx-hal = { version = "0.4", features = ["va41630"] }
[dependencies.ringbuf]
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"]
rtic = { version = "2", features = ["thumbv7-backend"] }
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" }
cortex-m = { version = "0.7", features = ["critical-section-single-core"] }
embedded-hal = "1"
va416xx-hal = { path = "../../va416xx-hal", features = ["va41630"] }
va416xx-hal = { path = "0.4", features = ["va41630"] }
[profile.dev]
codegen-units = 1

View File

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

View File

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

View File

@@ -21,17 +21,20 @@ portable-atomic = "1"
once_cell = { version = "1", default-features = false, features = ["critical-section"] }
va416xx-hal = { version = "0.3", path = "../va416xx-hal" }
va416xx-hal = { version = "0.4.1" }
[features]
default = ["irq-tim14-tim15"]
irqs-in-lib = []
# This determines the reserved interrupt functions for the embassy time drivers. Only one
# is allowed to be selected!
irq-tim14-tim15 = ["irqs-in-lib"]
irq-tim13-tim14 = ["irqs-in-lib"]
irq-tim14-tim15 = ["_irqs-in-lib"]
irq-tim13-tim14 = ["_irqs-in-lib"]
# 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]
rustdoc-args = ["--generate-link-to-definition"]

View File

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

View File

@@ -8,7 +8,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
# [unreleased]
# [v0.4.0]
# [v0.4.1] 2025-02-18
- 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
@@ -44,6 +49,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Asynchronous UART RX support.
- Add new `get_tim_raw` unsafe method to retrieve TIM peripheral blocks.
- `Uart::with_with_interrupt` and `Uart::new_without_interrupt`
- A lot of missing `defmt::Format` implementations.
# [v0.3.0] 2024-30-09

View File

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

View File

@@ -11,14 +11,17 @@ raw PAC. This crate also implements traits specified by the
[embedded-hal](https://github.com/rust-embedded/embedded-hal) project, making it compatible with
various drivers in the embedded rust ecosystem.
You have to enable one of the following device features to use this crate depending on
which chip you are using:
It is generally advised to enable ONE of the following device features to use this crate
depending on which chip you are using:
- `va41630`
- `va41629`
- `va41628`
- `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 an application requires the `thumbv7em-none-eabihf` cross-compiler toolchain.

View File

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

View File

@@ -1,20 +1,23 @@
//! 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 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
//! [embedded-hal](https://github.com/rust-embedded/embedded-hal) project, making it compatible with
//! various drivers in the embedded rust ecosystem.
//! You have to enable one of the following device features to use this crate depending on
//! which chip you are using:
//!
//! It is generally advised to enable ONE of the following device features to use this crate
//! depending on which chip you are using:
//!
//! - `va41630`
//! - `va41629`
//! - `va41628`
//! - `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
//! 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
@@ -26,15 +29,6 @@
#[cfg(test)]
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;
pub use va416xx as device;
pub use va416xx as pac;

View File

@@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [unreleased]
## [v0.4.0] 2025-02-17
## [v0.4.0] 2025-02-18
- Re-generated PAC with `svd2rust` v0.35.0 and added optional `defmt` and `Debug` implementations

View File

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

View File

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

View File

@@ -353,7 +353,7 @@
{
"type": "cortex-debug",
"request": "launch",
"name": "UART Echo with IRQ",
"name": "UART Line Terminated Example",
"servertype": "jlink",
"jlinkscript": "${workspaceFolder}/jlink/JLinkSettings.JLinkScript",
"cwd": "${workspaceRoot}",
@@ -500,5 +500,95 @@
]
}
},
{
"type": "cortex-debug",
"request": "launch",
"name": "Async GPIO Example",
"servertype": "jlink",
"jlinkscript": "${workspaceFolder}/jlink/JLinkSettings.JLinkScript",
"cwd": "${workspaceRoot}",
"device": "Cortex-M4",
"svdFile": "${workspaceFolder}/va416xx/svd/va416xx.svd.patched",
"preLaunchTask": "async-gpio",
"overrideLaunchCommands": [
"monitor halt",
"monitor reset",
"load",
],
"executable": "${workspaceFolder}/target/thumbv7em-none-eabihf/debug/async-gpio",
"interface": "swd",
"runToEntryPoint": "main",
"rttConfig": {
"enabled": true,
"address": "auto",
"decoders": [
{
"port": 0,
"timestamp": true,
"type": "console"
}
]
}
},
{
"type": "cortex-debug",
"request": "launch",
"name": "Async UART TX Example",
"servertype": "jlink",
"jlinkscript": "${workspaceFolder}/jlink/JLinkSettings.JLinkScript",
"cwd": "${workspaceRoot}",
"device": "Cortex-M4",
"svdFile": "${workspaceFolder}/va416xx/svd/va416xx.svd.patched",
"preLaunchTask": "async-uart-tx",
"overrideLaunchCommands": [
"monitor halt",
"monitor reset",
"load",
],
"executable": "${workspaceFolder}/target/thumbv7em-none-eabihf/debug/async-uart-tx",
"interface": "swd",
"runToEntryPoint": "main",
"rttConfig": {
"enabled": true,
"address": "auto",
"decoders": [
{
"port": 0,
"timestamp": true,
"type": "console"
}
]
}
},
{
"type": "cortex-debug",
"request": "launch",
"name": "Async UART RX Example",
"servertype": "jlink",
"jlinkscript": "${workspaceFolder}/jlink/JLinkSettings.JLinkScript",
"cwd": "${workspaceRoot}",
"device": "Cortex-M4",
"svdFile": "${workspaceFolder}/va416xx/svd/va416xx.svd.patched",
"preLaunchTask": "async-uart-rx",
"overrideLaunchCommands": [
"monitor halt",
"monitor reset",
"load",
],
"executable": "${workspaceFolder}/target/thumbv7em-none-eabihf/debug/async-uart-rx",
"interface": "swd",
"runToEntryPoint": "main",
"rttConfig": {
"enabled": true,
"address": "auto",
"decoders": [
{
"port": 0,
"timestamp": true,
"type": "console"
}
]
}
},
]
}
}

View File

@@ -199,6 +199,19 @@
"kind": "build",
}
},
{
"label": "async-gpio",
"type": "shell",
"command": "~/.cargo/bin/cargo", // note: full path to the cargo
"args": [
"build",
"--bin",
"async-gpio"
],
"group": {
"kind": "build",
}
},
{
"label": "rtic-example",
"type": "shell",
@@ -212,5 +225,31 @@
"kind": "build",
}
},
{
"label": "async-uart-tx",
"type": "shell",
"command": "~/.cargo/bin/cargo", // note: full path to the cargo
"args": [
"build",
"--bin",
"async-uart-tx"
],
"group": {
"kind": "build",
}
},
{
"label": "async-uart-rx",
"type": "shell",
"command": "~/.cargo/bin/cargo", // note: full path to the cargo
"args": [
"build",
"--bin",
"async-uart-rx"
],
"group": {
"kind": "build",
}
},
]
}