integrate va108xx-embassy into HAL, bump version
shared-hal-ci / Check build (push) Waiting to run
shared-hal-ci / Check formatting (push) Waiting to run
shared-hal-ci / Check Documentation Build (push) Waiting to run
shared-hal-ci / Clippy (push) Waiting to run
va108xx-ci / Check build (push) Waiting to run
va108xx-ci / Run Tests (push) Waiting to run
va108xx-ci / Check formatting (push) Waiting to run
va108xx-ci / Check Documentation Build (push) Waiting to run
va108xx-ci / Clippy (push) Waiting to run
va416xx-ci / Check build (push) Waiting to run
va416xx-ci / Run Tests (push) Waiting to run
va416xx-ci / Check formatting (push) Waiting to run
va416xx-ci / Check Documentation Build (push) Waiting to run
va416xx-ci / Clippy (push) Waiting to run
shared-hal-ci / Check build (pull_request) Waiting to run
shared-hal-ci / Check formatting (pull_request) Waiting to run
shared-hal-ci / Check Documentation Build (pull_request) Waiting to run
shared-hal-ci / Clippy (pull_request) Waiting to run
va108xx-ci / Check build (pull_request) Waiting to run
va108xx-ci / Run Tests (pull_request) Waiting to run
va108xx-ci / Check formatting (pull_request) Waiting to run
va108xx-ci / Check Documentation Build (pull_request) Waiting to run
va108xx-ci / Clippy (pull_request) Waiting to run
va416xx-ci / Check build (pull_request) Waiting to run
va416xx-ci / Run Tests (pull_request) Waiting to run
va416xx-ci / Check formatting (pull_request) Waiting to run
va416xx-ci / Check Documentation Build (pull_request) Waiting to run
va416xx-ci / Clippy (pull_request) Waiting to run
shared-hal-ci / Check build (push) Waiting to run
shared-hal-ci / Check formatting (push) Waiting to run
shared-hal-ci / Check Documentation Build (push) Waiting to run
shared-hal-ci / Clippy (push) Waiting to run
va108xx-ci / Check build (push) Waiting to run
va108xx-ci / Run Tests (push) Waiting to run
va108xx-ci / Check formatting (push) Waiting to run
va108xx-ci / Check Documentation Build (push) Waiting to run
va108xx-ci / Clippy (push) Waiting to run
va416xx-ci / Check build (push) Waiting to run
va416xx-ci / Run Tests (push) Waiting to run
va416xx-ci / Check formatting (push) Waiting to run
va416xx-ci / Check Documentation Build (push) Waiting to run
va416xx-ci / Clippy (push) Waiting to run
shared-hal-ci / Check build (pull_request) Waiting to run
shared-hal-ci / Check formatting (pull_request) Waiting to run
shared-hal-ci / Check Documentation Build (pull_request) Waiting to run
shared-hal-ci / Clippy (pull_request) Waiting to run
va108xx-ci / Check build (pull_request) Waiting to run
va108xx-ci / Run Tests (pull_request) Waiting to run
va108xx-ci / Check formatting (pull_request) Waiting to run
va108xx-ci / Check Documentation Build (pull_request) Waiting to run
va108xx-ci / Clippy (pull_request) Waiting to run
va416xx-ci / Check build (pull_request) Waiting to run
va416xx-ci / Run Tests (pull_request) Waiting to run
va416xx-ci / Check formatting (pull_request) Waiting to run
va416xx-ci / Check Documentation Build (pull_request) Waiting to run
va416xx-ci / Clippy (pull_request) Waiting to run
This commit is contained in:
@@ -57,7 +57,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@nightly
|
||||
- run: RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc -p va108xx --all-features
|
||||
- run: RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc -p va108xx-hal --all-features --no-deps
|
||||
- run: RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc -p va108xx-hal --features "defmt, embassy-oc30-oc31" --no-deps
|
||||
- run: RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc -p vorago-reb1 --no-deps
|
||||
|
||||
clippy:
|
||||
|
||||
@@ -70,7 +70,7 @@ clippy-shared-hal:
|
||||
[working-directory: 'va108xx']
|
||||
docs-va108xx:
|
||||
RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc -p va108xx --all-features
|
||||
RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc -p va108xx-hal --all-features --no-deps
|
||||
RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc -p va108xx-hal --features "defmt, embassy-oc30-oc31" --no-deps
|
||||
RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc -p vorago-reb1 --no-deps
|
||||
|
||||
[working-directory: 'va416xx']
|
||||
|
||||
@@ -4,7 +4,6 @@ members = [
|
||||
"vorago-reb1",
|
||||
"va108xx",
|
||||
"va108xx-hal",
|
||||
"va108xx-embassy",
|
||||
"examples/simple",
|
||||
"examples/rtic",
|
||||
"examples/embassy",
|
||||
|
||||
@@ -12,7 +12,7 @@ panic-probe = { version = "1", features = ["print-defmt"] }
|
||||
embedded-hal = "1"
|
||||
|
||||
[dependencies.va108xx-hal]
|
||||
version = "0.12"
|
||||
version = "0.13"
|
||||
features = ["rt"]
|
||||
path = "../va108xx-hal"
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ num_enum = { version = "0.7", default-features = false }
|
||||
static_assertions = "1"
|
||||
|
||||
[dependencies.va108xx-hal]
|
||||
version = "0.12"
|
||||
version = "0.13"
|
||||
path = "../va108xx-hal"
|
||||
features = ["defmt"]
|
||||
|
||||
|
||||
@@ -27,11 +27,10 @@ embassy-executor = { version = "0.10", features = [
|
||||
"executor-interrupt"
|
||||
]}
|
||||
|
||||
va108xx-hal = { version = "0.12", path = "../../va108xx-hal", features = ["defmt"] }
|
||||
va108xx-embassy = { version = "0.3", path = "../../va108xx-embassy" }
|
||||
va108xx-hal = { version = "0.13", path = "../../va108xx-hal", features = ["defmt"] }
|
||||
|
||||
[features]
|
||||
default = ["ticks-hz-1_000", "va108xx-embassy/irq-oc30-oc31"]
|
||||
default = ["ticks-hz-1_000", "va108xx-hal/embassy-oc30-oc31"]
|
||||
custom-irqs = []
|
||||
ticks-hz-1_000 = ["embassy-time/tick-hz-1_000"]
|
||||
ticks-hz-32_768 = ["embassy-time/tick-hz-32_768"]
|
||||
|
||||
@@ -61,7 +61,7 @@ async fn main(spawner: Spawner) {
|
||||
let dp = pac::Peripherals::take().unwrap();
|
||||
|
||||
// Safety: Only called once here.
|
||||
va108xx_embassy::init(dp.tim23, dp.tim22, SYSCLK_FREQ);
|
||||
va108xx_hal::embassy_time::init(dp.tim23, dp.tim22, SYSCLK_FREQ);
|
||||
unsafe {
|
||||
cortex_m::interrupt::enable();
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ async fn main(spawner: Spawner) {
|
||||
let dp = pac::Peripherals::take().unwrap();
|
||||
|
||||
// Safety: Only called once here.
|
||||
va108xx_embassy::init(dp.tim23, dp.tim22, SYSCLK_FREQ);
|
||||
va108xx_hal::embassy_time::init(dp.tim23, dp.tim22, SYSCLK_FREQ);
|
||||
|
||||
let porta = PinsA::new(dp.porta);
|
||||
let mut led0 = Output::new(porta.pa10, PinState::Low);
|
||||
|
||||
@@ -41,7 +41,7 @@ async fn main(_spawner: Spawner) {
|
||||
let dp = pac::Peripherals::take().unwrap();
|
||||
|
||||
// Safety: Only called once here.
|
||||
va108xx_embassy::init(dp.tim23, dp.tim22, SYSCLK_FREQ);
|
||||
va108xx_hal::embassy_time::init(dp.tim23, dp.tim22, SYSCLK_FREQ);
|
||||
|
||||
let porta = PinsA::new(dp.porta);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ use embassy_time::{Duration, Instant, Ticker};
|
||||
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(feature = "custom-irqs")] {
|
||||
use va108xx_embassy::embassy_time_driver_irqs;
|
||||
use va108xx_hal::embassy_time_driver_irqs;
|
||||
use va108xx_hal::pac::interrupt;
|
||||
embassy_time_driver_irqs!(timekeeper_irq = OC23, alarm_irq = OC24);
|
||||
}
|
||||
@@ -31,13 +31,13 @@ async fn main(_spawner: Spawner) {
|
||||
// Safety: Only called once here.
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(not(feature = "custom-irqs"))] {
|
||||
va108xx_embassy::init(
|
||||
va108xx_hal::embassy_time::init(
|
||||
dp.tim23,
|
||||
dp.tim22,
|
||||
SYSCLK_FREQ,
|
||||
);
|
||||
} else {
|
||||
va108xx_embassy::init_with_custom_irqs(
|
||||
va108xx_hal::embassy_time::init_with_custom_irqs(
|
||||
dp.tim23,
|
||||
dp.tim22,
|
||||
SYSCLK_FREQ,
|
||||
|
||||
@@ -14,5 +14,5 @@ rtic = { version = "2", features = ["thumbv6-backend"] }
|
||||
rtic-monotonics = { version = "2", features = ["cortex-m-systick"] }
|
||||
ringbuf = { version = "0.4.7", default-features = false, features = ["portable-atomic"] }
|
||||
|
||||
va108xx-hal = { version = "0.12", path = "../../va108xx-hal" }
|
||||
va108xx-hal = { version = "0.13", path = "../../va108xx-hal" }
|
||||
vorago-reb1 = { version = "0.9", path = "../../vorago-reb1" }
|
||||
|
||||
@@ -16,6 +16,6 @@ embedded-io = "0.7"
|
||||
portable-atomic = { version = "1", features = ["unsafe-assume-single-core"] }
|
||||
|
||||
[dependencies.va108xx-hal]
|
||||
version = "0.12"
|
||||
version = "0.13"
|
||||
path = "../../va108xx-hal"
|
||||
features = ["defmt"]
|
||||
|
||||
@@ -25,7 +25,7 @@ rtic = { version = "2", features = ["thumbv6-backend"] }
|
||||
rtic-monotonics = { version = "2", features = ["cortex-m-systick"] }
|
||||
|
||||
[dependencies.va108xx-hal]
|
||||
version = "0.12"
|
||||
version = "0.13"
|
||||
path = "../va108xx-hal"
|
||||
features = ["defmt"]
|
||||
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
Change Log
|
||||
=======
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## [unreleased]
|
||||
|
||||
## [v0.3.0] 2025-09-03
|
||||
|
||||
Bumped allowed va108xx-hal to v0.12
|
||||
|
||||
## [v0.2.1] 2025-03-07
|
||||
|
||||
- Bumped allowed va108xx-hal to v0.11
|
||||
|
||||
## [v0.2.0] 2025-02-17
|
||||
|
||||
- Bumped va108xx-hal to v0.10.0
|
||||
- Remove `embassy` module, expose public functions in library root directly
|
||||
|
||||
|
||||
## [v0.1.2] and [v0.1.1] 2025-02-13
|
||||
|
||||
Docs patch
|
||||
|
||||
## [v0.1.0] 2025-02-13
|
||||
|
||||
Initial release
|
||||
|
||||
[unreleased]: https://egit.irs.uni-stuttgart.de/rust/va108xx-rs/compare/va108xx-embassy-v0.3.0...HEAD
|
||||
[v0.3.0]: https://egit.irs.uni-stuttgart.de/rust/va108xx-rs/compare/va108xx-embassy-v0.2.1...va10xx-embassy-v0.3.0
|
||||
[v0.2.1]: https://egit.irs.uni-stuttgart.de/rust/va108xx-rs/compare/va108xx-embassy-v0.2.0...va10xx-embassy-v0.2.1
|
||||
[v0.2.0]: https://egit.irs.uni-stuttgart.de/rust/va108xx-rs/compare/va108xx-embassy-v0.1.2...va10xx-embassy-v0.2.0
|
||||
@@ -1,28 +0,0 @@
|
||||
[package]
|
||||
name = "va108xx-embassy"
|
||||
version = "0.3.0"
|
||||
edition = "2021"
|
||||
authors = ["Robin Mueller <muellerr@irs.uni-stuttgart.de>"]
|
||||
description = "Embassy-rs support for the Vorago VA108xx family of microcontrollers"
|
||||
homepage = "https://egit.irs.uni-stuttgart.de/rust/vorago-rs"
|
||||
repository = "https://egit.irs.uni-stuttgart.de/rust/vorago-rs"
|
||||
license = "Apache-2.0"
|
||||
keywords = ["no-std", "hal", "cortex-m", "vorago", "va108xx"]
|
||||
categories = ["aerospace", "embedded", "no-std", "hardware-support"]
|
||||
|
||||
[dependencies]
|
||||
vorago-shared-hal = { version = "0.3", path = "../../vorago-shared-hal", features = ["vor1x"] }
|
||||
va108xx-hal = { version = "0.12", path = "../va108xx-hal" }
|
||||
|
||||
[features]
|
||||
default = ["irq-oc30-oc31"]
|
||||
irqs-in-lib = []
|
||||
# This determines the reserved interrupt functions for the embassy time drivers. Only one
|
||||
# is allowed to be selected!
|
||||
irq-oc28-oc29 = ["irqs-in-lib"]
|
||||
irq-oc29-oc30 = ["irqs-in-lib"]
|
||||
irq-oc30-oc31 = ["irqs-in-lib"]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["thumbv6m-none-eabi"]
|
||||
rustdoc-args = ["--generate-link-to-definition"]
|
||||
@@ -1,10 +0,0 @@
|
||||
[](https://crates.io/crates/va108xx-embassy)
|
||||
[](https://docs.rs/va108xx-embassy)
|
||||
|
||||
# Embassy-rs support for the Vorago VA108xx MCU family
|
||||
|
||||
This repository contains the [embassy-rs](https://github.com/embassy-rs/embassy) support for the
|
||||
VA108xx family. Currently, it contains the time driver to allow using embassy-rs. It uses the TIM
|
||||
peripherals provided by the VA108xx family for this purpose.
|
||||
|
||||
The documentation contains more information on how to use this crate.
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
export RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options"
|
||||
cargo +nightly doc --open
|
||||
@@ -8,6 +8,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## [unreleased]
|
||||
|
||||
## [v0.13.0] 2026-05-18
|
||||
|
||||
- Bump `vorago-shared-hal` dependency to v0.3.
|
||||
- Integrate `va108xx-embassy` as a `embassy-time` module.
|
||||
|
||||
## [v0.12.0] 2025-09-03
|
||||
|
||||
## Changed
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
[package]
|
||||
name = "va108xx-hal"
|
||||
version = "0.12.0"
|
||||
version = "0.13.0"
|
||||
authors = ["Robin Mueller <muellerr@irs.uni-stuttgart.de>"]
|
||||
edition = "2021"
|
||||
edition = "2024"
|
||||
description = "HAL for the Vorago VA108xx family of microcontrollers"
|
||||
homepage = "https://egit.irs.uni-stuttgart.de/rust/vorago-rs"
|
||||
repository = "https://egit.irs.uni-stuttgart.de/rust/vorago-rs"
|
||||
@@ -28,6 +28,14 @@ default = ["rt"]
|
||||
rt = ["va108xx/rt"]
|
||||
defmt = ["dep:defmt", "vorago-shared-hal/defmt", "va108xx/defmt"]
|
||||
|
||||
# Embassy time features
|
||||
_irqs-in-lib = []
|
||||
# This determines the reserved interrupt functions for the embassy time drivers. Only one
|
||||
# is allowed to be selected!
|
||||
embassy-oc30-oc31 = ["_irqs-in-lib"]
|
||||
embassy-oc29-oc30 = ["_irqs-in-lib"]
|
||||
embassy-oc28-oc29 = ["_irqs-in-lib"]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
targets = ["thumbv6m-none-eabi"]
|
||||
|
||||
@@ -23,21 +23,20 @@
|
||||
//!
|
||||
//! You can disable the default features and then specify one of the features above to use the
|
||||
//! documented combination of IRQs. It is also possible to specify custom IRQs by importing and
|
||||
//! using the [embassy_time_driver_irqs] macro to declare the IRQ handlers in the
|
||||
//! using the [crate::embassy_time_driver_irqs] macro to declare the IRQ handlers in the
|
||||
//! application code. If this is done, [init_with_custom_irqs] must be used
|
||||
//! method to pass the IRQ numbers to the library.
|
||||
//!
|
||||
//! ## Examples
|
||||
//!
|
||||
//! [embassy example projects](https://egit.irs.uni-stuttgart.de/rust/vorago-rs/src/branch/main/va108xx/examples/embassy)
|
||||
#![no_std]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||
|
||||
#[cfg(feature = "irqs-in-lib")]
|
||||
use va108xx_hal::pac::{self, interrupt};
|
||||
use va108xx_hal::time::Hertz;
|
||||
use va108xx_hal::timer::TimInstance;
|
||||
use vorago_shared_hal::embassy::time_driver;
|
||||
#[cfg(feature = "_irqs-in-lib")]
|
||||
use crate::pac::{self, interrupt};
|
||||
use crate::time::Hertz;
|
||||
use crate::timer::TimInstance;
|
||||
|
||||
pub use vorago_shared_hal::embassy::time_driver;
|
||||
|
||||
/// Macro to define the IRQ handlers for the time driver.
|
||||
///
|
||||
@@ -45,7 +44,7 @@ use vorago_shared_hal::embassy::time_driver;
|
||||
/// the feature flags specified. However, the macro is exported to allow users to specify the
|
||||
/// interrupt handlers themselves.
|
||||
///
|
||||
/// Please note that you have to explicitely import the [macro@va108xx_hal::pac::interrupt]
|
||||
/// Please note that you have to explicitely import the [macro@crate::pac::interrupt]
|
||||
/// macro in the application code in case this macro is used there.
|
||||
#[macro_export]
|
||||
macro_rules! embassy_time_driver_irqs {
|
||||
@@ -59,7 +58,7 @@ macro_rules! embassy_time_driver_irqs {
|
||||
#[allow(non_snake_case)]
|
||||
fn $timekeeper_irq() {
|
||||
// Safety: We call it once here.
|
||||
unsafe { $crate::time_driver().on_interrupt_timekeeping() }
|
||||
unsafe { $crate::embassy_time::time_driver().on_interrupt_timekeeping() }
|
||||
}
|
||||
|
||||
const ALARM_IRQ: pac::Interrupt = pac::Interrupt::$alarm_irq;
|
||||
@@ -68,25 +67,25 @@ macro_rules! embassy_time_driver_irqs {
|
||||
#[allow(non_snake_case)]
|
||||
fn $alarm_irq() {
|
||||
// Safety: We call it once here.
|
||||
unsafe { $crate::time_driver().on_interrupt_alarm() }
|
||||
unsafe { $crate::embassy_time::time_driver().on_interrupt_alarm() }
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Provide three combinations of IRQs for the time driver by default.
|
||||
|
||||
#[cfg(feature = "irq-oc30-oc31")]
|
||||
#[cfg(feature = "embassy-oc30-oc31")]
|
||||
embassy_time_driver_irqs!(timekeeper_irq = OC31, alarm_irq = OC30);
|
||||
#[cfg(feature = "irq-oc29-oc30")]
|
||||
#[cfg(feature = "embassy-oc29-oc30")]
|
||||
embassy_time_driver_irqs!(timekeeper_irq = OC30, alarm_irq = OC29);
|
||||
#[cfg(feature = "irq-oc28-oc29")]
|
||||
#[cfg(feature = "embassy-oc28-oc29")]
|
||||
embassy_time_driver_irqs!(timekeeper_irq = OC29, alarm_irq = OC28);
|
||||
|
||||
/// Initialization method for embassy.
|
||||
///
|
||||
/// This should be used if the interrupt handler is provided by the library, which is the
|
||||
/// default case.
|
||||
#[cfg(feature = "irqs-in-lib")]
|
||||
#[cfg(feature = "_irqs-in-lib")]
|
||||
pub fn init<TimekeeperTim: TimInstance, AlarmTim: TimInstance>(
|
||||
timekeeper_tim: TimekeeperTim,
|
||||
alarm_tim: AlarmTim,
|
||||
@@ -102,8 +101,8 @@ pub fn init_with_custom_irqs<TimekeeperTim: TimInstance, AlarmTim: TimInstance>(
|
||||
timekeeper_tim: TimekeeperTim,
|
||||
alarm_tim: AlarmTim,
|
||||
sysclk: Hertz,
|
||||
timekeeper_irq: pac::Interrupt,
|
||||
alarm_irq: pac::Interrupt,
|
||||
timekeeper_irq: crate::pac::Interrupt,
|
||||
alarm_irq: crate::pac::Interrupt,
|
||||
) {
|
||||
time_driver().__init(sysclk, timekeeper_tim, alarm_tim, timekeeper_irq, alarm_irq)
|
||||
}
|
||||
@@ -29,9 +29,11 @@ pub mod time;
|
||||
pub mod timer;
|
||||
pub mod uart;
|
||||
|
||||
pub mod embassy_time;
|
||||
|
||||
pub use vorago_shared_hal::{
|
||||
disable_nvic_interrupt, enable_nvic_interrupt, FunctionSelect, InterruptConfig,
|
||||
PeripheralSelect,
|
||||
FunctionSelect, InterruptConfig, PeripheralSelect, disable_nvic_interrupt,
|
||||
enable_nvic_interrupt,
|
||||
};
|
||||
|
||||
/// This is the NONE destination reigster value for the IRQSEL peripheral.
|
||||
|
||||
@@ -15,11 +15,11 @@ cortex-m = { version = "0.7", features = ["critical-section-single-core"] }
|
||||
cortex-m-rt = "0.7"
|
||||
embedded-hal = "1"
|
||||
nb = "1"
|
||||
bitbybit = "1.3"
|
||||
bitbybit = "2"
|
||||
arbitrary-int = "2"
|
||||
max116xx-10bit = "0.3"
|
||||
|
||||
va108xx-hal = { version = "0.12", path = "../va108xx-hal", features = ["rt"] }
|
||||
va108xx-hal = { version = "0.13", path = "../va108xx-hal", features = ["rt"] }
|
||||
|
||||
[features]
|
||||
rt = ["va108xx-hal/rt"]
|
||||
|
||||
Reference in New Issue
Block a user