Compare commits
1 Commits
main
...
0f209c152d
Author | SHA1 | Date | |
---|---|---|---|
0f209c152d |
@@ -34,9 +34,6 @@ It also contains the following helper crates:
|
|||||||
[`RTIC`](https://rtic.rs/2/book/en/) and [`embassy`](https://github.com/embassy-rs/embassy)
|
[`RTIC`](https://rtic.rs/2/book/en/) and [`embassy`](https://github.com/embassy-rs/embassy)
|
||||||
native Rust RTOSes.
|
native Rust RTOSes.
|
||||||
|
|
||||||
The majority of the HAL implementation and the Embassy-rs support are contained in the external
|
|
||||||
[`vorago-shared-periphs`](https://egit.irs.uni-stuttgart.de/rust/vorago-shared-periphs) crate.
|
|
||||||
|
|
||||||
## Using the `.cargo/config.toml` file
|
## Using the `.cargo/config.toml` file
|
||||||
|
|
||||||
Use the following command to have a starting `config.toml` file
|
Use the following command to have a starting `config.toml` file
|
||||||
|
@@ -4,11 +4,11 @@ version = "0.1.0"
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cortex-m = { version = "0.7", features = ["critical-section-single-core"] }
|
cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] }
|
||||||
cortex-m-rt = "0.7"
|
cortex-m-rt = "0.7"
|
||||||
defmt = "1"
|
defmt = "1"
|
||||||
defmt-rtt = "1"
|
defmt-rtt = "0.4"
|
||||||
panic-probe = { version = "1", features = ["print-defmt"] }
|
panic-probe = { version = "0.3", features = ["print-defmt"] }
|
||||||
embedded-hal = "1"
|
embedded-hal = "1"
|
||||||
|
|
||||||
[dependencies.va108xx-hal]
|
[dependencies.va108xx-hal]
|
||||||
|
@@ -35,7 +35,6 @@ enum TestCase {
|
|||||||
Pulse,
|
Pulse,
|
||||||
// Tie PA0, PA1 and PA3 to an oscilloscope
|
// Tie PA0, PA1 and PA3 to an oscilloscope
|
||||||
DelayGpio,
|
DelayGpio,
|
||||||
// PA0 can be checked with an oscillsope to verify timing correctness.
|
|
||||||
DelayMs,
|
DelayMs,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,6 +121,8 @@ fn main() -> ! {
|
|||||||
assert_eq!(mmio_porta.read_perid(), 0x004007e1);
|
assert_eq!(mmio_porta.read_perid(), 0x004007e1);
|
||||||
}
|
}
|
||||||
TestCase::Pulse => {
|
TestCase::Pulse => {
|
||||||
|
// TODO: Fix
|
||||||
|
/*
|
||||||
let mut output_pulsed = Output::new(pinsa.pa0, PinState::Low);
|
let mut output_pulsed = Output::new(pinsa.pa0, PinState::Low);
|
||||||
output_pulsed.configure_pulse_mode(true, PinState::Low);
|
output_pulsed.configure_pulse_mode(true, PinState::Low);
|
||||||
defmt::info!("Pulsing high 10 times..");
|
defmt::info!("Pulsing high 10 times..");
|
||||||
@@ -131,18 +132,21 @@ fn main() -> ! {
|
|||||||
cortex_m::asm::delay(25_000_000);
|
cortex_m::asm::delay(25_000_000);
|
||||||
}
|
}
|
||||||
output_pulsed.configure_pulse_mode(true, PinState::High);
|
output_pulsed.configure_pulse_mode(true, PinState::High);
|
||||||
defmt::info!("Pulsing low 10 times..");
|
rprintln!("Pulsing low 10 times..");
|
||||||
for _ in 0..10 {
|
for _ in 0..10 {
|
||||||
output_pulsed.set_low();
|
output_pulsed.set_low();
|
||||||
cortex_m::asm::delay(25_000_000);
|
cortex_m::asm::delay(25_000_000);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
TestCase::DelayGpio => {
|
TestCase::DelayGpio => {
|
||||||
let mut out_0 = Output::new(pinsa.pa0, PinState::Low);
|
// TODO: Fix
|
||||||
|
/*
|
||||||
|
let mut out_0 = pinsa.pa0.into_readable_push_pull_output();
|
||||||
out_0.configure_delay(true, false);
|
out_0.configure_delay(true, false);
|
||||||
let mut out_1 = Output::new(pinsa.pa1, PinState::Low);
|
let mut out_1 = pinsa.pa1.into_readable_push_pull_output();
|
||||||
out_1.configure_delay(false, true);
|
out_1.configure_delay(false, true);
|
||||||
let mut out_2 = Output::new(pinsa.pa3, PinState::Low);
|
let mut out_2 = pinsa.pa3.into_readable_push_pull_output();
|
||||||
out_2.configure_delay(true, true);
|
out_2.configure_delay(true, true);
|
||||||
for _ in 0..20 {
|
for _ in 0..20 {
|
||||||
out_0.toggle();
|
out_0.toggle();
|
||||||
@@ -150,6 +154,7 @@ fn main() -> ! {
|
|||||||
out_2.toggle();
|
out_2.toggle();
|
||||||
cortex_m::asm::delay(25_000_000);
|
cortex_m::asm::delay(25_000_000);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
TestCase::DelayMs => {
|
TestCase::DelayMs => {
|
||||||
let mut delay_timer = CountdownTimer::new(dp.tim1, 50.MHz());
|
let mut delay_timer = CountdownTimer::new(dp.tim1, 50.MHz());
|
||||||
@@ -162,16 +167,17 @@ fn main() -> ! {
|
|||||||
}
|
}
|
||||||
let ahb_freq: Hertz = 50.MHz();
|
let ahb_freq: Hertz = 50.MHz();
|
||||||
let mut syst_delay = cortex_m::delay::Delay::new(cp.SYST, ahb_freq.raw());
|
let mut syst_delay = cortex_m::delay::Delay::new(cp.SYST, ahb_freq.raw());
|
||||||
// Release image should be used to verify timings for pin PA0
|
// Test usecond delay using both TIM peripheral and SYST. Use the release image if you
|
||||||
for _ in 0..5 {
|
// want to verify the timings!
|
||||||
pa0.toggle();
|
loop {
|
||||||
syst_delay.delay_us(50);
|
|
||||||
pa0.toggle();
|
|
||||||
syst_delay.delay_us(50);
|
|
||||||
pa0.toggle();
|
pa0.toggle();
|
||||||
delay_timer.delay_us(50);
|
delay_timer.delay_us(50);
|
||||||
pa0.toggle();
|
pa0.toggle();
|
||||||
delay_timer.delay_us(50);
|
delay_timer.delay_us(50);
|
||||||
|
pa0.toggle();
|
||||||
|
syst_delay.delay_us(50);
|
||||||
|
pa0.toggle();
|
||||||
|
syst_delay.delay_us(50);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -7,7 +7,7 @@ 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"
|
||||||
defmt-rtt = "1"
|
defmt-rtt = "0.4"
|
||||||
defmt = "1"
|
defmt = "1"
|
||||||
panic-probe = { version = "1", features = ["defmt"] }
|
panic-probe = { version = "1", features = ["defmt"] }
|
||||||
crc = "3"
|
crc = "3"
|
||||||
|
@@ -12,8 +12,8 @@ The bootloader uses the following memory map:
|
|||||||
| 0x0 | Bootloader start | code up to 0x2FFE bytes |
|
| 0x0 | Bootloader start | code up to 0x2FFE bytes |
|
||||||
| 0x2FFE | Bootloader CRC | half-word |
|
| 0x2FFE | Bootloader CRC | half-word |
|
||||||
| 0x3000 | App image A start | code up to 0xE7F4 (~59K) bytes |
|
| 0x3000 | App image A start | code up to 0xE7F4 (~59K) bytes |
|
||||||
| 0x117F4 | App image A CRC check length | word |
|
| 0x117F8 | App image A CRC check length | word |
|
||||||
| 0x117F8 | App image A CRC check value | word |
|
| 0x117FC | App image A CRC check value | word |
|
||||||
| 0x117FC | App image B start | code up to 0xE7F4 (~59K) bytes |
|
| 0x117FC | App image B start | code up to 0xE7F4 (~59K) bytes |
|
||||||
| 0x1FFF0 | App image B CRC check length | word |
|
| 0x1FFF0 | App image B CRC check length | word |
|
||||||
| 0x1FFF4 | App image B CRC check value | word |
|
| 0x1FFF4 | App image B CRC check value | word |
|
||||||
|
@@ -5,7 +5,9 @@ edition = "2021"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cfg-if = "1"
|
cfg-if = "1"
|
||||||
|
# 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-async = "1"
|
embedded-hal-async = "1"
|
||||||
embedded-io = "0.6"
|
embedded-io = "0.6"
|
||||||
embedded-io-async = "0.6"
|
embedded-io-async = "0.6"
|
||||||
@@ -13,12 +15,13 @@ heapless = "0.8"
|
|||||||
static_cell = "2"
|
static_cell = "2"
|
||||||
|
|
||||||
defmt = "1"
|
defmt = "1"
|
||||||
defmt-rtt = "1"
|
defmt-rtt = "0.4"
|
||||||
panic-probe = { version = "1", features = ["print-defmt"] }
|
panic-probe = { version = "0.3", features = ["print-defmt"] }
|
||||||
|
|
||||||
critical-section = "1"
|
critical-section = "1"
|
||||||
|
# portable-atomic = { version = "1", features = ["unsafe-assume-single-core"]}
|
||||||
|
|
||||||
embassy-sync = "0.7"
|
embassy-sync = "0.6"
|
||||||
embassy-time = "0.4"
|
embassy-time = "0.4"
|
||||||
embassy-executor = { version = "0.7", features = [
|
embassy-executor = { version = "0.7", features = [
|
||||||
"arch-cortex-m",
|
"arch-cortex-m",
|
||||||
@@ -27,7 +30,7 @@ embassy-executor = { version = "0.7", features = [
|
|||||||
]}
|
]}
|
||||||
|
|
||||||
va108xx-hal = { version = "0.11", path = "../../va108xx-hal", features = ["defmt"] }
|
va108xx-hal = { version = "0.11", path = "../../va108xx-hal", features = ["defmt"] }
|
||||||
va108xx-embassy = { version = "0.2", path = "../../va108xx-embassy" }
|
va108xx-embassy = { version = "0.2" }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["ticks-hz-1_000", "va108xx-embassy/irq-oc30-oc31"]
|
default = ["ticks-hz-1_000", "va108xx-embassy/irq-oc30-oc31"]
|
||||||
|
@@ -59,10 +59,16 @@ static CHANNEL_PB22_TO_PB23: Channel<ThreadModeRawMutex, GpioCmd, 3> = Channel::
|
|||||||
async fn main(spawner: Spawner) {
|
async fn main(spawner: Spawner) {
|
||||||
defmt::println!("-- VA108xx Async GPIO Demo --");
|
defmt::println!("-- VA108xx Async GPIO Demo --");
|
||||||
|
|
||||||
let dp = pac::Peripherals::take().unwrap();
|
let mut dp = pac::Peripherals::take().unwrap();
|
||||||
|
|
||||||
// Safety: Only called once here.
|
// Safety: Only called once here.
|
||||||
va108xx_embassy::init(dp.tim23, dp.tim22, SYSCLK_FREQ);
|
va108xx_embassy::init(
|
||||||
|
&mut dp.sysconfig,
|
||||||
|
&dp.irqsel,
|
||||||
|
SYSCLK_FREQ,
|
||||||
|
dp.tim23,
|
||||||
|
dp.tim22,
|
||||||
|
);
|
||||||
|
|
||||||
let porta = PinsA::new(dp.porta);
|
let porta = PinsA::new(dp.porta);
|
||||||
let portb = PinsB::new(dp.portb);
|
let portb = PinsB::new(dp.portb);
|
||||||
|
@@ -52,10 +52,16 @@ static CONSUMER_UART_B: Mutex<RefCell<Option<Consumer<u8, 256>>>> = Mutex::new(R
|
|||||||
async fn main(spawner: Spawner) {
|
async fn main(spawner: Spawner) {
|
||||||
defmt::println!("-- VA108xx Async UART RX Demo --");
|
defmt::println!("-- VA108xx Async UART RX Demo --");
|
||||||
|
|
||||||
let dp = pac::Peripherals::take().unwrap();
|
let mut dp = pac::Peripherals::take().unwrap();
|
||||||
|
|
||||||
// Safety: Only called once here.
|
// Safety: Only called once here.
|
||||||
va108xx_embassy::init(dp.tim23, dp.tim22, SYSCLK_FREQ);
|
va108xx_embassy::init(
|
||||||
|
&mut dp.sysconfig,
|
||||||
|
&dp.irqsel,
|
||||||
|
SYSCLK_FREQ,
|
||||||
|
dp.tim23,
|
||||||
|
dp.tim22,
|
||||||
|
);
|
||||||
|
|
||||||
let porta = PinsA::new(dp.porta);
|
let porta = PinsA::new(dp.porta);
|
||||||
let mut led0 = Output::new(porta.pa10, PinState::Low);
|
let mut led0 = Output::new(porta.pa10, PinState::Low);
|
||||||
|
@@ -39,10 +39,16 @@ const STR_LIST: &[&str] = &[
|
|||||||
async fn main(_spawner: Spawner) {
|
async fn main(_spawner: Spawner) {
|
||||||
defmt::println!("-- VA108xx Async UART TX Demo --");
|
defmt::println!("-- VA108xx Async UART TX Demo --");
|
||||||
|
|
||||||
let dp = pac::Peripherals::take().unwrap();
|
let mut dp = pac::Peripherals::take().unwrap();
|
||||||
|
|
||||||
// Safety: Only called once here.
|
// Safety: Only called once here.
|
||||||
va108xx_embassy::init(dp.tim23, dp.tim22, SYSCLK_FREQ);
|
va108xx_embassy::init(
|
||||||
|
&mut dp.sysconfig,
|
||||||
|
&dp.irqsel,
|
||||||
|
SYSCLK_FREQ,
|
||||||
|
dp.tim23,
|
||||||
|
dp.tim22,
|
||||||
|
);
|
||||||
|
|
||||||
let porta = PinsA::new(dp.porta);
|
let porta = PinsA::new(dp.porta);
|
||||||
|
|
||||||
|
@@ -26,21 +26,23 @@ const SYSCLK_FREQ: Hertz = Hertz::from_raw(50_000_000);
|
|||||||
async fn main(_spawner: Spawner) {
|
async fn main(_spawner: Spawner) {
|
||||||
defmt::println!("-- VA108xx Embassy Demo --");
|
defmt::println!("-- VA108xx Embassy Demo --");
|
||||||
|
|
||||||
let dp = pac::Peripherals::take().unwrap();
|
let mut dp = pac::Peripherals::take().unwrap();
|
||||||
|
|
||||||
// Safety: Only called once here.
|
// Safety: Only called once here.
|
||||||
cfg_if::cfg_if! {
|
cfg_if::cfg_if! {
|
||||||
if #[cfg(not(feature = "custom-irqs"))] {
|
if #[cfg(not(feature = "custom-irqs"))] {
|
||||||
va108xx_embassy::init(
|
va108xx_embassy::init(
|
||||||
|
&mut dp.sysconfig,
|
||||||
|
&dp.irqsel,
|
||||||
|
SYSCLK_FREQ,
|
||||||
dp.tim23,
|
dp.tim23,
|
||||||
dp.tim22,
|
dp.tim22,
|
||||||
SYSCLK_FREQ,
|
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
va108xx_embassy::init_with_custom_irqs(
|
va108xx_embassy::init_with_custom_irqs(
|
||||||
|
SYSCLK_FREQ,
|
||||||
dp.tim23,
|
dp.tim23,
|
||||||
dp.tim22,
|
dp.tim22,
|
||||||
SYSCLK_FREQ,
|
|
||||||
pac::Interrupt::OC23,
|
pac::Interrupt::OC23,
|
||||||
pac::Interrupt::OC24,
|
pac::Interrupt::OC24,
|
||||||
);
|
);
|
||||||
|
@@ -6,7 +6,7 @@ edition = "2021"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
cortex-m = { version = "0.7", features = ["critical-section-single-core"] }
|
cortex-m = { version = "0.7", features = ["critical-section-single-core"] }
|
||||||
embedded-io = "0.6"
|
embedded-io = "0.6"
|
||||||
defmt-rtt = "1"
|
defmt-rtt = "0.4"
|
||||||
defmt = "1"
|
defmt = "1"
|
||||||
panic-probe = { version = "1", features = ["defmt"] }
|
panic-probe = { version = "1", features = ["defmt"] }
|
||||||
rtic = { version = "2", features = ["thumbv6-backend"] }
|
rtic = { version = "2", features = ["thumbv6-backend"] }
|
||||||
|
@@ -7,7 +7,7 @@ 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"
|
||||||
panic-halt = "1"
|
panic-halt = "1"
|
||||||
defmt-rtt = "1"
|
defmt-rtt = "0.4"
|
||||||
defmt = "1"
|
defmt = "1"
|
||||||
panic-probe = { version = "1", features = ["defmt"] }
|
panic-probe = { version = "1", features = ["defmt"] }
|
||||||
embedded-hal = "1"
|
embedded-hal = "1"
|
||||||
|
@@ -8,13 +8,13 @@ cortex-m = { version = "0.7", features = ["critical-section-single-core"]}
|
|||||||
cortex-m-rt = "0.7"
|
cortex-m-rt = "0.7"
|
||||||
embedded-io = "0.6"
|
embedded-io = "0.6"
|
||||||
defmt = "1"
|
defmt = "1"
|
||||||
defmt-rtt = { version = "1" }
|
defmt-rtt = { version = "0.4" }
|
||||||
panic-probe = { version = "1", features = ["print-defmt"] }
|
panic-probe = { version = "0.3", features = ["print-defmt"] }
|
||||||
num_enum = { version = "0.7", default-features = false }
|
num_enum = { version = "0.7", default-features = false }
|
||||||
cobs = { version = "0.4", default-features = false }
|
cobs = { version = "0.3", default-features = false }
|
||||||
satrs = { version = "0.3.0-alpha.1", default-features = false }
|
satrs = { version = "0.2", default-features = false }
|
||||||
ringbuf = { version = "0.4.7", default-features = false, features = ["portable-atomic"] }
|
ringbuf = { version = "0.4.7", default-features = false, features = ["portable-atomic"] }
|
||||||
spacepackets = { version = "0.15", default-features = false, features = ["defmt"] }
|
spacepackets = { version = "0.11", default-features = false, features = ["defmt"] }
|
||||||
# Even though we do not use this directly, we need to activate this feature explicitely
|
# Even though we do not use this directly, we need to activate this feature explicitely
|
||||||
# so that RTIC compiles because thumv6 does not have CAS operations natively.
|
# so that RTIC compiles because thumv6 does not have CAS operations natively.
|
||||||
portable-atomic = {version = "1", features = ["unsafe-assume-single-core"]}
|
portable-atomic = {version = "1", features = ["unsafe-assume-single-core"]}
|
||||||
|
@@ -10,7 +10,7 @@ cortex-m-rt = "0.7"
|
|||||||
panic-rtt-target = { version = "0.1.3" }
|
panic-rtt-target = { version = "0.1.3" }
|
||||||
rtt-target = { version = "0.5" }
|
rtt-target = { version = "0.5" }
|
||||||
embedded-hal = "1"
|
embedded-hal = "1"
|
||||||
va108xx-hal = { version = "0.11" }
|
va108xx-hal = { version = "0.10.0" }
|
||||||
|
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
codegen-units = 1
|
codegen-units = 1
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
#![no_std]
|
#![no_std]
|
||||||
|
|
||||||
use cortex_m_rt::entry;
|
use cortex_m_rt::entry;
|
||||||
use embedded_hal::delay::DelayNs;
|
use embedded_hal::{delay::DelayNs, digital::StatefulOutputPin};
|
||||||
use panic_rtt_target as _;
|
use panic_rtt_target as _;
|
||||||
use rtt_target::{rprintln, rtt_init_print};
|
use rtt_target::{rprintln, rtt_init_print};
|
||||||
use va108xx_hal::{gpio::PinsA, pac, prelude::*, timer::CountdownTimer};
|
use va108xx_hal::{gpio::PinsA, pac, prelude::*, timer::CountdownTimer};
|
||||||
@@ -15,11 +15,11 @@ fn main() -> ! {
|
|||||||
|
|
||||||
let mut dp = pac::Peripherals::take().unwrap();
|
let mut dp = pac::Peripherals::take().unwrap();
|
||||||
let mut timer = CountdownTimer::new(&mut dp.sysconfig, 50.MHz(), dp.tim0);
|
let mut timer = CountdownTimer::new(&mut dp.sysconfig, 50.MHz(), dp.tim0);
|
||||||
let porta = PinsA::new(&mut dp.sysconfig, dp.porta);
|
let porta = PinsA::new(&mut dp.sysconfig, Some(dp.ioconfig), dp.porta);
|
||||||
let mut led1 = porta.pa10.into_readable_push_pull_output();
|
let mut led1 = porta.pa10.into_readable_push_pull_output();
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
led1.toggle();
|
led1.toggle().ok();
|
||||||
timer.delay_ms(500);
|
timer.delay_ms(500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -10,7 +10,7 @@ cortex-m-rt = "0.7"
|
|||||||
panic-rtt-target = { version = "0.1.3" }
|
panic-rtt-target = { version = "0.1.3" }
|
||||||
rtt-target = { version = "0.5" }
|
rtt-target = { version = "0.5" }
|
||||||
embedded-hal = "1"
|
embedded-hal = "1"
|
||||||
va108xx-hal = { version = "0.11" }
|
va108xx-hal = { version = "0.10.0" }
|
||||||
|
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
codegen-units = 1
|
codegen-units = 1
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
#![no_std]
|
#![no_std]
|
||||||
|
|
||||||
use cortex_m_rt::entry;
|
use cortex_m_rt::entry;
|
||||||
use embedded_hal::delay::DelayNs;
|
use embedded_hal::{delay::DelayNs, digital::StatefulOutputPin};
|
||||||
use panic_rtt_target as _;
|
use panic_rtt_target as _;
|
||||||
use rtt_target::{rprintln, rtt_init_print};
|
use rtt_target::{rprintln, rtt_init_print};
|
||||||
use va108xx_hal::{gpio::PinsA, pac, prelude::*, timer::CountdownTimer};
|
use va108xx_hal::{gpio::PinsA, pac, prelude::*, timer::CountdownTimer};
|
||||||
@@ -15,11 +15,11 @@ fn main() -> ! {
|
|||||||
|
|
||||||
let mut dp = pac::Peripherals::take().unwrap();
|
let mut dp = pac::Peripherals::take().unwrap();
|
||||||
let mut timer = CountdownTimer::new(&mut dp.sysconfig, 50.MHz(), dp.tim0);
|
let mut timer = CountdownTimer::new(&mut dp.sysconfig, 50.MHz(), dp.tim0);
|
||||||
let porta = PinsA::new(&mut dp.sysconfig, dp.porta);
|
let porta = PinsA::new(&mut dp.sysconfig, Some(dp.ioconfig), dp.porta);
|
||||||
let mut led2 = porta.pa7.into_readable_push_pull_output();
|
let mut led2 = porta.pa7.into_readable_push_pull_output();
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
led2.toggle();
|
led2.toggle().ok();
|
||||||
timer.delay_ms(1000);
|
timer.delay_ms(1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -270,7 +270,7 @@ mod app {
|
|||||||
defmt::warn!("PUS TC error: {}", pus_tc.unwrap_err());
|
defmt::warn!("PUS TC error: {}", pus_tc.unwrap_err());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let pus_tc = pus_tc.unwrap();
|
let (pus_tc, _) = pus_tc.unwrap();
|
||||||
let mut write_and_send = |tm: &PusTmCreator| {
|
let mut write_and_send = |tm: &PusTmCreator| {
|
||||||
let written_size = tm.write_to_bytes(cx.local.verif_buf).unwrap();
|
let written_size = tm.write_to_bytes(cx.local.verif_buf).unwrap();
|
||||||
cx.shared.tm_rb.lock(|prod| {
|
cx.shared.tm_rb.lock(|prod| {
|
||||||
@@ -278,18 +278,18 @@ mod app {
|
|||||||
prod.buf.push_slice(&cx.local.verif_buf[0..written_size]);
|
prod.buf.push_slice(&cx.local.verif_buf[0..written_size]);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
let request_id = VerificationReportCreator::read_request_id_from_tc(&pus_tc);
|
let token = cx.local.verif_reporter.add_tc(&pus_tc);
|
||||||
let tm = cx
|
let (tm, accepted_token) = cx
|
||||||
.local
|
.local
|
||||||
.verif_reporter
|
.verif_reporter
|
||||||
.acceptance_success(cx.local.src_data_buf, &request_id, 0, 0, &[])
|
.acceptance_success(cx.local.src_data_buf, token, 0, 0, &[])
|
||||||
.expect("acceptance success failed");
|
.expect("acceptance success failed");
|
||||||
write_and_send(&tm);
|
write_and_send(&tm);
|
||||||
|
|
||||||
let tm = cx
|
let (tm, started_token) = cx
|
||||||
.local
|
.local
|
||||||
.verif_reporter
|
.verif_reporter
|
||||||
.start_success(cx.local.src_data_buf, &request_id, 0, 0, &[])
|
.start_success(cx.local.src_data_buf, accepted_token, 0, 0, &[])
|
||||||
.expect("acceptance success failed");
|
.expect("acceptance success failed");
|
||||||
write_and_send(&tm);
|
write_and_send(&tm);
|
||||||
|
|
||||||
@@ -308,7 +308,7 @@ mod app {
|
|||||||
let tm = cx
|
let tm = cx
|
||||||
.local
|
.local
|
||||||
.verif_reporter
|
.verif_reporter
|
||||||
.completion_success(cx.local.src_data_buf, &request_id, 0, 0, &[])
|
.completion_success(cx.local.src_data_buf, started_token, 0, 0, &[])
|
||||||
.expect("completion success failed");
|
.expect("completion success failed");
|
||||||
write_and_send(&tm);
|
write_and_send(&tm);
|
||||||
};
|
};
|
||||||
@@ -339,7 +339,7 @@ mod app {
|
|||||||
let tm = cx
|
let tm = cx
|
||||||
.local
|
.local
|
||||||
.verif_reporter
|
.verif_reporter
|
||||||
.completion_success(cx.local.src_data_buf, &request_id, 0, 0, &[])
|
.completion_success(cx.local.src_data_buf, started_token, 0, 0, &[])
|
||||||
.expect("completion success failed");
|
.expect("completion success failed");
|
||||||
write_and_send(&tm);
|
write_and_send(&tm);
|
||||||
}
|
}
|
||||||
@@ -349,7 +349,7 @@ mod app {
|
|||||||
let tm = cx
|
let tm = cx
|
||||||
.local
|
.local
|
||||||
.verif_reporter
|
.verif_reporter
|
||||||
.completion_success(cx.local.src_data_buf, &request_id, 0, 0, &[])
|
.completion_success(cx.local.src_data_buf, started_token, 0, 0, &[])
|
||||||
.expect("completion success failed");
|
.expect("completion success failed");
|
||||||
write_and_send(&tm);
|
write_and_send(&tm);
|
||||||
} else if pus_tc.service() == PusServiceId::MemoryManagement as u8 {
|
} else if pus_tc.service() == PusServiceId::MemoryManagement as u8 {
|
||||||
@@ -358,7 +358,7 @@ mod app {
|
|||||||
.verif_reporter
|
.verif_reporter
|
||||||
.step_success(
|
.step_success(
|
||||||
cx.local.src_data_buf,
|
cx.local.src_data_buf,
|
||||||
&request_id,
|
&started_token,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
&[],
|
&[],
|
||||||
@@ -408,7 +408,7 @@ mod app {
|
|||||||
.verif_reporter
|
.verif_reporter
|
||||||
.completion_failure(
|
.completion_failure(
|
||||||
cx.local.src_data_buf,
|
cx.local.src_data_buf,
|
||||||
&request_id,
|
started_token,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
FailParams::new(&[], &EcssEnumU8::new(0), &[]),
|
FailParams::new(&[], &EcssEnumU8::new(0), &[]),
|
||||||
@@ -417,7 +417,7 @@ mod app {
|
|||||||
} else {
|
} else {
|
||||||
cx.local
|
cx.local
|
||||||
.verif_reporter
|
.verif_reporter
|
||||||
.completion_success(cx.local.src_data_buf, &request_id, 0, 0, &[])
|
.completion_success(cx.local.src_data_buf, started_token, 0, 0, &[])
|
||||||
.expect("completion success failed")
|
.expect("completion success failed")
|
||||||
};
|
};
|
||||||
write_and_send(&tm);
|
write_and_send(&tm);
|
||||||
|
@@ -11,7 +11,7 @@ keywords = ["no-std", "hal", "cortex-m", "vorago", "va108xx"]
|
|||||||
categories = ["aerospace", "embedded", "no-std", "hardware-support"]
|
categories = ["aerospace", "embedded", "no-std", "hardware-support"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
vorago-shared-periphs = { git = "https://egit.irs.uni-stuttgart.de/rust/vorago-shared-periphs.git", features = ["vor1x"] }
|
vorago-shared-periphs = { path = "../../vorago-shared-periphs", features = ["vor1x"] }
|
||||||
va108xx-hal = { path = "../va108xx-hal" }
|
va108xx-hal = { path = "../va108xx-hal" }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
@@ -88,9 +88,9 @@ embassy_time_driver_irqs!(timekeeper_irq = OC29, alarm_irq = OC28);
|
|||||||
/// default case.
|
/// default case.
|
||||||
#[cfg(feature = "irqs-in-lib")]
|
#[cfg(feature = "irqs-in-lib")]
|
||||||
pub fn init<TimekeeperTim: TimMarker, AlarmTim: TimMarker>(
|
pub fn init<TimekeeperTim: TimMarker, AlarmTim: TimMarker>(
|
||||||
|
sysclk: Hertz,
|
||||||
timekeeper_tim: TimekeeperTim,
|
timekeeper_tim: TimekeeperTim,
|
||||||
alarm_tim: AlarmTim,
|
alarm_tim: AlarmTim,
|
||||||
sysclk: Hertz,
|
|
||||||
) {
|
) {
|
||||||
time_driver().__init(sysclk, timekeeper_tim, alarm_tim, TIMEKEEPER_IRQ, ALARM_IRQ)
|
time_driver().__init(sysclk, timekeeper_tim, alarm_tim, TIMEKEEPER_IRQ, ALARM_IRQ)
|
||||||
}
|
}
|
||||||
@@ -99,9 +99,9 @@ pub fn init<TimekeeperTim: TimMarker, AlarmTim: TimMarker>(
|
|||||||
///
|
///
|
||||||
/// Requires an explicit [pac::Interrupt] argument for the timekeeper and alarm IRQs.
|
/// Requires an explicit [pac::Interrupt] argument for the timekeeper and alarm IRQs.
|
||||||
pub fn init_with_custom_irqs<TimekeeperTim: TimMarker, AlarmTim: TimMarker>(
|
pub fn init_with_custom_irqs<TimekeeperTim: TimMarker, AlarmTim: TimMarker>(
|
||||||
|
sysclk: Hertz,
|
||||||
timekeeper_tim: TimekeeperTim,
|
timekeeper_tim: TimekeeperTim,
|
||||||
alarm_tim: AlarmTim,
|
alarm_tim: AlarmTim,
|
||||||
sysclk: Hertz,
|
|
||||||
timekeeper_irq: pac::Interrupt,
|
timekeeper_irq: pac::Interrupt,
|
||||||
alarm_irq: pac::Interrupt,
|
alarm_irq: pac::Interrupt,
|
||||||
) {
|
) {
|
||||||
|
@@ -12,11 +12,11 @@ categories = ["aerospace", "embedded", "no-std", "hardware-support"]
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cortex-m = { version = "0.7", features = ["critical-section-single-core"]}
|
cortex-m = { version = "0.7", features = ["critical-section-single-core"]}
|
||||||
vorago-shared-periphs = { git = "https://egit.irs.uni-stuttgart.de/rust/vorago-shared-periphs.git", features = ["vor1x"] }
|
vorago-shared-periphs = { path = "../../vorago-shared-periphs", features = ["vor1x"] }
|
||||||
fugit = "0.3"
|
fugit = "0.3"
|
||||||
thiserror = { version = "2", default-features = false }
|
thiserror = { version = "2", default-features = false }
|
||||||
va108xx = { version = "0.5", default-features = false, features = ["critical-section", "defmt"] }
|
va108xx = { version = "0.5", default-features = false, features = ["critical-section", "defmt"] }
|
||||||
defmt = { version = "1", optional = true }
|
defmt = { version = "0.3", optional = true }
|
||||||
|
|
||||||
[target.'cfg(all(target_arch = "arm", target_os = "none"))'.dependencies]
|
[target.'cfg(all(target_arch = "arm", target_os = "none"))'.dependencies]
|
||||||
portable-atomic = { version = "1", features = ["unsafe-assume-single-core"] }
|
portable-atomic = { version = "1", features = ["unsafe-assume-single-core"] }
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
//! API for the SPI peripheral.
|
//! API for the SPI peripheral.
|
||||||
//!
|
//!
|
||||||
//! The main abstraction provided by this module is the [Spi] an structure.
|
//! The main abstraction provided by this module is the [Spi] an structure.
|
||||||
//! It provides the [SpiBus trait](https://docs.rs/embedded-hal/latest/embedded_hal/spi/trait.SpiBus.html),
|
//! It provides the [embedded_hal::spi] traits, but also offer a low level interface
|
||||||
//! but also offer a low level interface via the [SpiLowLevel] trait.
|
//! via the [SpiLowLevel] trait.
|
||||||
//!
|
//!
|
||||||
//! ## Examples
|
//! ## Examples
|
||||||
//!
|
//!
|
||||||
|
@@ -8,10 +8,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
## [unreleased]
|
## [unreleased]
|
||||||
|
|
||||||
## [v0.5.1] 2025-07-22
|
|
||||||
|
|
||||||
defmt version v1
|
|
||||||
|
|
||||||
## [v0.5.0] 2025-02-17
|
## [v0.5.0] 2025-02-17
|
||||||
|
|
||||||
- Re-generated PAC with `svd2rust` v0.35.0 and added optional `defmt` and `Debug` implementations
|
- Re-generated PAC with `svd2rust` v0.35.0 and added optional `defmt` and `Debug` implementations
|
||||||
@@ -59,7 +55,7 @@ defmt version v1
|
|||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- Generated with patched version of `svd2rust`: See
|
- Generated with patched version of `svd2rust`: See
|
||||||
https://github.com/rust-embedded/svd2rust/pull/549 for more details.
|
https://github.com/rust-embedded/svd2rust/pull/549 for more details.
|
||||||
Some bitmasks were missing from register reader definitions.
|
Some bitmasks were missing from register reader definitions.
|
||||||
|
|
||||||
@@ -83,7 +79,3 @@ defmt version v1
|
|||||||
|
|
||||||
- First version of the PAC which builds. Uses a patched version
|
- First version of the PAC which builds. Uses a patched version
|
||||||
of `svd2rust`: https://github.com/rust-embedded/svd2rust
|
of `svd2rust`: https://github.com/rust-embedded/svd2rust
|
||||||
|
|
||||||
[unreleased]: https://egit.irs.uni-stuttgart.de/rust/va108xx-rs/compare/va108xx-v0.5.1...HEAD
|
|
||||||
[v0.5.1]: https://egit.irs.uni-stuttgart.de/rust/va108xx-rs/compare/va108xx-v0.5.0...va108xx-v0.5.1
|
|
||||||
[v0.5.0]: https://egit.irs.uni-stuttgart.de/rust/va108xx-rs/compare/va108xx-v0.4.0...va108xx-v0.5.0
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "va108xx"
|
name = "va108xx"
|
||||||
version = "0.5.1"
|
version = "0.5.0"
|
||||||
authors = ["Robin Mueller <muellerr@irs.uni-stuttgart.de>"]
|
authors = ["Robin Mueller <muellerr@irs.uni-stuttgart.de>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "PAC for the Vorago VA108xx family of microcontrollers"
|
description = "PAC for the Vorago VA108xx family of microcontrollers"
|
||||||
|
Reference in New Issue
Block a user