Compare commits
5 Commits
va416xx-ha
...
857b59c3c2
Author | SHA1 | Date | |
---|---|---|---|
857b59c3c2
|
|||
d231905aca
|
|||
911fe8771e
|
|||
cea9c2fc37
|
|||
9d1f1e3dac
|
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@@ -39,9 +39,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: dtolnay/rust-toolchain@nightly
|
- uses: dtolnay/rust-toolchain@nightly
|
||||||
- run: RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc -p vorago-peb1
|
- run: RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc --features va41630
|
||||||
- run: RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc -p va416xx-hal --features va41630
|
|
||||||
- run: RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc -p va416xx
|
|
||||||
|
|
||||||
clippy:
|
clippy:
|
||||||
name: Clippy
|
name: Clippy
|
||||||
|
@@ -24,11 +24,7 @@ It also contains the following helper crates:
|
|||||||
- The [`flashloader`](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/flashloader)
|
- The [`flashloader`](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/flashloader)
|
||||||
crate contains a sample flashloader which is able to update the redundant images in the NVM which
|
crate contains a sample flashloader which is able to update the redundant images in the NVM which
|
||||||
is compatible to the provided bootloader as well.
|
is compatible to the provided bootloader as well.
|
||||||
- The [`examples`](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/examples)
|
- The `examples` folder contains various example applications crates for the HAL and the PAC.
|
||||||
folder contains various example applications crates using the HAL and the PAC.
|
|
||||||
This folder also contains dedicated example applications using the
|
|
||||||
[`RTIC`](https://rtic.rs/2/book/en/) and [`embassy`](https://github.com/embassy-rs/embassy)
|
|
||||||
native Rust RTOSes.
|
|
||||||
|
|
||||||
## Using the `.cargo/config.toml` file
|
## Using the `.cargo/config.toml` file
|
||||||
|
|
||||||
|
4
automation/Jenkinsfile
vendored
4
automation/Jenkinsfile
vendored
@@ -25,9 +25,7 @@ pipeline {
|
|||||||
stage('Docs') {
|
stage('Docs') {
|
||||||
steps {
|
steps {
|
||||||
sh """
|
sh """
|
||||||
RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc -p vorago-peb1
|
RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc --all-features
|
||||||
RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc -p va416xx-hal --features va41630
|
|
||||||
RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc -p va416xx
|
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,25 +0,0 @@
|
|||||||
VA416xx Example Applications
|
|
||||||
========
|
|
||||||
|
|
||||||
This folder contains various examples
|
|
||||||
Consult the main README first for setup of the repository.
|
|
||||||
|
|
||||||
## Simple examples
|
|
||||||
|
|
||||||
```rs
|
|
||||||
cargo run --example blinky
|
|
||||||
```
|
|
||||||
|
|
||||||
You can have a look at the `simple/examples` folder to see all available simple examples
|
|
||||||
|
|
||||||
## RTIC example
|
|
||||||
|
|
||||||
```rs
|
|
||||||
cargo run --bin rtic-example
|
|
||||||
```
|
|
||||||
|
|
||||||
## Embassy example
|
|
||||||
|
|
||||||
```rs
|
|
||||||
cargo run --bin embassy-example
|
|
||||||
```
|
|
@@ -1,5 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "rtic-example"
|
name = "rtic"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
|
@@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
# [unreleased]
|
# [unreleased]
|
||||||
|
|
||||||
# [v0.2.0] 2024-09-18
|
# [v0.2.0]
|
||||||
|
|
||||||
- Documentation improvements
|
- Documentation improvements
|
||||||
- Improved UART typing support: Validity of passed pins is now checked properly
|
- Improved UART typing support: Validity of passed pins is now checked properly
|
||||||
@@ -25,9 +25,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
- Fixes for the SPI implementation where the clock divider values were not calculated
|
- Fixes for the SPI implementation where the clock divider values were not calculated
|
||||||
correctly
|
correctly
|
||||||
- Fixes for UART IRQ handler implementation
|
- Fixes for UART IRQ handler implementation
|
||||||
- Add new IRQ router initialization method `irq_router::enable_and_init_irq_router`. This method
|
|
||||||
also sets the initial values of some registers to 0 where the datasheet and the actual reset
|
|
||||||
value are inconsistent, which can lead to weird bugs like IRQs not being triggered properly.
|
|
||||||
|
|
||||||
## Added
|
## Added
|
||||||
|
|
||||||
|
@@ -311,12 +311,6 @@ impl ClkgenCfgr {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
pub fn pll_cfg(mut self, pll_cfg: PllCfg) -> Self {
|
|
||||||
self.pll_cfg = Some(pll_cfg);
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn ref_clk_sel(mut self, ref_clk_sel: RefClkSel) -> Self {
|
pub fn ref_clk_sel(mut self, ref_clk_sel: RefClkSel) -> Self {
|
||||||
self.ref_clk_sel = ref_clk_sel;
|
self.ref_clk_sel = ref_clk_sel;
|
||||||
@@ -324,7 +318,7 @@ impl ClkgenCfgr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Configures all clocks and return a clock configuration structure containing the final
|
/// Configures all clocks and return a clock configuration structure containing the final
|
||||||
/// frozen clocks.
|
/// frozen clock.
|
||||||
///
|
///
|
||||||
/// Internal implementation details: This implementation is based on the HAL implementation
|
/// Internal implementation details: This implementation is based on the HAL implementation
|
||||||
/// which performs a lot of delays. I do not know if all of those are necessary, but
|
/// which performs a lot of delays. I do not know if all of those are necessary, but
|
||||||
@@ -505,7 +499,7 @@ impl Clocks {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the frequency of the APB0 which is equal to the system clock.
|
/// Returns the frequency of the APB0 which is equal to the system clock.
|
||||||
pub const fn apb0(&self) -> Hertz {
|
pub fn apb0(&self) -> Hertz {
|
||||||
self.sysclk()
|
self.sysclk()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -21,6 +21,7 @@
|
|||||||
//! ## Examples
|
//! ## Examples
|
||||||
//!
|
//!
|
||||||
//! - [Blinky example](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/examples/simple/examples/blinky.rs)
|
//! - [Blinky example](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/examples/simple/examples/blinky.rs)
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Eq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
||||||
pub struct IsMaskedError;
|
pub struct IsMaskedError;
|
||||||
|
@@ -1,16 +1,8 @@
|
|||||||
//! IRQ Router peripheral support.
|
|
||||||
use crate::{
|
use crate::{
|
||||||
clock::{PeripheralSelect, SyscfgExt},
|
clock::{PeripheralSelect, SyscfgExt},
|
||||||
pac,
|
pac,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// This enables and initiates the peripheral.
|
|
||||||
///
|
|
||||||
/// Please note that this method also writes 0 to the registers which do not have 0 as the default
|
|
||||||
/// reset value. The programmers guide v1.2 and the actual values inspected using a SVD viewer
|
|
||||||
/// are inconsistent here, and the registers being non-zero can actually lead to weird bugs
|
|
||||||
/// when working with interrupts. Registers DMASELx and ADCSEL/DMASELx will reset to 0x7f and 0x1f
|
|
||||||
/// respectively instead of 0x00.
|
|
||||||
pub fn enable_and_init_irq_router(sysconfig: &mut pac::Sysconfig, irq_router: &pac::IrqRouter) {
|
pub fn enable_and_init_irq_router(sysconfig: &mut pac::Sysconfig, irq_router: &pac::IrqRouter) {
|
||||||
sysconfig.enable_peripheral_clock(PeripheralSelect::IrqRouter);
|
sysconfig.enable_peripheral_clock(PeripheralSelect::IrqRouter);
|
||||||
sysconfig.assert_periph_reset_for_two_cycles(PeripheralSelect::IrqRouter);
|
sysconfig.assert_periph_reset_for_two_cycles(PeripheralSelect::IrqRouter);
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
//! 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
|
||||||
//! with interrupts, it is strongly recommended to set up the IRQ router with the
|
//! with interrupts, it is strongly recommended to set up the IRQ router with the
|
||||||
//! [crate::irq_router] module at the very least because that peripheral has confusing and/or
|
//! [crate::irq_router] module at the very least because that peripheral has confusing and/or
|
||||||
//! faulty register reset values which might lead to weird bugs and glitches.
|
//! faulty register reset values which might leads to weird bugs and glitches.
|
||||||
#![no_std]
|
#![no_std]
|
||||||
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
@@ -46,6 +46,7 @@ pub mod edac;
|
|||||||
pub mod gpio;
|
pub mod gpio;
|
||||||
pub mod i2c;
|
pub mod i2c;
|
||||||
pub mod irq_router;
|
pub mod irq_router;
|
||||||
|
pub mod nvm;
|
||||||
pub mod pwm;
|
pub mod pwm;
|
||||||
pub mod spi;
|
pub mod spi;
|
||||||
pub mod time;
|
pub mod time;
|
||||||
@@ -54,9 +55,6 @@ pub mod typelevel;
|
|||||||
pub mod uart;
|
pub mod uart;
|
||||||
pub mod wdt;
|
pub mod wdt;
|
||||||
|
|
||||||
#[cfg(feature = "va41630")]
|
|
||||||
pub mod nvm;
|
|
||||||
|
|
||||||
#[cfg(not(feature = "va41628"))]
|
#[cfg(not(feature = "va41628"))]
|
||||||
pub mod adc;
|
pub mod adc;
|
||||||
#[cfg(not(feature = "va41628"))]
|
#[cfg(not(feature = "va41628"))]
|
||||||
|
@@ -1,10 +1,3 @@
|
|||||||
//! Non-volatile memory (NVM) driver.
|
|
||||||
//!
|
|
||||||
//! Provides a basic API to work with the internal NVM of the VA41630 MCU.
|
|
||||||
//!
|
|
||||||
//! # Examples
|
|
||||||
//!
|
|
||||||
//! - [Flashloader application](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/flashloader)
|
|
||||||
use embedded_hal::spi::MODE_0;
|
use embedded_hal::spi::MODE_0;
|
||||||
|
|
||||||
use crate::clock::{Clocks, SyscfgExt};
|
use crate::clock::{Clocks, SyscfgExt};
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
//! ## Examples
|
//! ## Examples
|
||||||
//!
|
//!
|
||||||
//! - [UART simple example](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/examples/simple/examples/uart.rs)
|
//! - [UART simple example](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/examples/simple/examples/uart.rs)
|
||||||
//! - [Flashloader app using UART with IRQs](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/flashloader)
|
|
||||||
use core::ops::Deref;
|
use core::ops::Deref;
|
||||||
|
|
||||||
use embedded_hal_nb::serial::Read;
|
use embedded_hal_nb::serial::Read;
|
||||||
|
@@ -410,65 +410,5 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "cortex-debug",
|
|
||||||
"request": "launch",
|
|
||||||
"name": "Embassy Example",
|
|
||||||
"servertype": "jlink",
|
|
||||||
"jlinkscript": "${workspaceFolder}/jlink/JLinkSettings.JLinkScript",
|
|
||||||
"cwd": "${workspaceRoot}",
|
|
||||||
"device": "Cortex-M4",
|
|
||||||
"svdFile": "${workspaceFolder}/va416xx/svd/va416xx.svd.patched",
|
|
||||||
"preLaunchTask": "embassy-example",
|
|
||||||
"overrideLaunchCommands": [
|
|
||||||
"monitor halt",
|
|
||||||
"monitor reset",
|
|
||||||
"load",
|
|
||||||
],
|
|
||||||
"executable": "${workspaceFolder}/target/thumbv7em-none-eabihf/debug/embassy-example",
|
|
||||||
"interface": "swd",
|
|
||||||
"runToEntryPoint": "main",
|
|
||||||
"rttConfig": {
|
|
||||||
"enabled": true,
|
|
||||||
"address": "auto",
|
|
||||||
"decoders": [
|
|
||||||
{
|
|
||||||
"port": 0,
|
|
||||||
"timestamp": true,
|
|
||||||
"type": "console"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "cortex-debug",
|
|
||||||
"request": "launch",
|
|
||||||
"name": "RTIC Example",
|
|
||||||
"servertype": "jlink",
|
|
||||||
"jlinkscript": "${workspaceFolder}/jlink/JLinkSettings.JLinkScript",
|
|
||||||
"cwd": "${workspaceRoot}",
|
|
||||||
"device": "Cortex-M4",
|
|
||||||
"svdFile": "${workspaceFolder}/va416xx/svd/va416xx.svd.patched",
|
|
||||||
"preLaunchTask": "embassy-example",
|
|
||||||
"overrideLaunchCommands": [
|
|
||||||
"monitor halt",
|
|
||||||
"monitor reset",
|
|
||||||
"load",
|
|
||||||
],
|
|
||||||
"executable": "${workspaceFolder}/target/thumbv7em-none-eabihf/debug/rtic-example",
|
|
||||||
"interface": "swd",
|
|
||||||
"runToEntryPoint": "main",
|
|
||||||
"rttConfig": {
|
|
||||||
"enabled": true,
|
|
||||||
"address": "auto",
|
|
||||||
"decoders": [
|
|
||||||
{
|
|
||||||
"port": 0,
|
|
||||||
"timestamp": true,
|
|
||||||
"type": "console"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@@ -186,18 +186,5 @@
|
|||||||
"kind": "build",
|
"kind": "build",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"label": "rtic-example",
|
|
||||||
"type": "shell",
|
|
||||||
"command": "~/.cargo/bin/cargo", // note: full path to the cargo
|
|
||||||
"args": [
|
|
||||||
"build",
|
|
||||||
"--bin",
|
|
||||||
"rtic-example"
|
|
||||||
],
|
|
||||||
"group": {
|
|
||||||
"kind": "build",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
}
|
}
|
Reference in New Issue
Block a user