improve SPI HAL

This commit is contained in:
Robin Müller 2024-07-04 17:10:01 +02:00
parent abb78c2682
commit 395a6a0538
Signed by: muellerr
GPG Key ID: A649FB78196E3849
10 changed files with 823 additions and 990 deletions

View File

@ -30,4 +30,4 @@ features = ["cortex-m-systick"]
[dependencies.va108xx-hal] [dependencies.va108xx-hal]
version = "0.6" version = "0.6"
path = "../../va108xx-hal" path = "../../va108xx-hal"
features = ["rt", "defmt"] features = ["rt", "defmt"]

View File

@ -3,12 +3,14 @@
#![no_std] #![no_std]
use cortex_m_rt::entry; use cortex_m_rt::entry;
use panic_halt as _; use panic_rtt_target as _;
use rtt_target::{rprintln, rtt_init_print}; use rtt_target::{rprintln, rtt_init_print};
use va108xx_hal as _;
#[entry] #[entry]
fn main() -> ! { fn main() -> ! {
rtt_init_print!(); rtt_init_print!();
rprintln!("-- VA108XX RTT example --");
let mut counter = 0; let mut counter = 0;
loop { loop {
rprintln!("{}: Hello, world!", counter); rprintln!("{}: Hello, world!", counter);

View File

@ -73,12 +73,12 @@ fn main() -> ! {
pinsa.pa30.into_funsel_1(), pinsa.pa30.into_funsel_1(),
pinsa.pa29.into_funsel_1(), pinsa.pa29.into_funsel_1(),
); );
let mut spia = Spi::spia( let mut spia = Spi::new(
&mut dp.sysconfig,
50.MHz(),
dp.spia, dp.spia,
(sck, miso, mosi), (sck, miso, mosi),
50.MHz(),
spi_cfg, spi_cfg,
Some(&mut dp.sysconfig),
None, None,
); );
spia.set_fill_word(FILL_WORD); spia.set_fill_word(FILL_WORD);
@ -90,12 +90,12 @@ fn main() -> ! {
pinsb.pb8.into_funsel_2(), pinsb.pb8.into_funsel_2(),
pinsb.pb7.into_funsel_2(), pinsb.pb7.into_funsel_2(),
); );
let mut spia = Spi::spia( let mut spia = Spi::new(
&mut dp.sysconfig,
50.MHz(),
dp.spia, dp.spia,
(sck, miso, mosi), (sck, miso, mosi),
50.MHz(),
spi_cfg, spi_cfg,
Some(&mut dp.sysconfig),
None, None,
); );
spia.set_fill_word(FILL_WORD); spia.set_fill_word(FILL_WORD);
@ -107,12 +107,12 @@ fn main() -> ! {
pinsb.pb4.into_funsel_1(), pinsb.pb4.into_funsel_1(),
pinsb.pb3.into_funsel_1(), pinsb.pb3.into_funsel_1(),
); );
let mut spib = Spi::spib( let mut spib = Spi::new(
&mut dp.sysconfig,
50.MHz(),
dp.spib, dp.spib,
(sck, miso, mosi), (sck, miso, mosi),
50.MHz(),
spi_cfg, spi_cfg,
Some(&mut dp.sysconfig),
None, None,
); );
spib.set_fill_word(FILL_WORD); spib.set_fill_word(FILL_WORD);
@ -195,6 +195,10 @@ fn main() -> ! {
if EXAMPLE_SEL == ExampleSelect::Loopback { if EXAMPLE_SEL == ExampleSelect::Loopback {
// Can't really verify correct reply here. // Can't really verify correct reply here.
spi.write(&[0x42]).expect("write failed"); spi.write(&[0x42]).expect("write failed");
// Need small delay.. otherwise we will read back the sent byte (which we don't want here).
// The write function will return as soon as all bytes were shifted out, ignoring the
// reply bytes.
delay.delay_us(50);
// Because of the loopback mode, we should get back the fill word here. // Because of the loopback mode, we should get back the fill word here.
spi.read(&mut reply_buf[0..1]).unwrap(); spi.read(&mut reply_buf[0..1]).unwrap();
assert_eq!(reply_buf[0], FILL_WORD); assert_eq!(reply_buf[0], FILL_WORD);

View File

@ -65,7 +65,7 @@ mod app {
let irq_cfg = IrqCfg::new(pac::interrupt::OC3, true, true); let irq_cfg = IrqCfg::new(pac::interrupt::OC3, true, true);
let (mut irq_uart, _) = let (mut irq_uart, _) =
uart::Uart::uartb(dp.uartb, (tx, rx), 115200.Hz(), &mut dp.sysconfig, 50.MHz()) uart::Uart::new(&mut dp.sysconfig, 50.MHz(), dp.uartb, (tx, rx), 115200.Hz())
.into_uart_with_irq(irq_cfg, Some(&mut dp.sysconfig), Some(&mut dp.irqsel)) .into_uart_with_irq(irq_cfg, Some(&mut dp.sysconfig), Some(&mut dp.irqsel))
.downgrade(); .downgrade();
irq_uart irq_uart

View File

@ -28,7 +28,7 @@ fn main() -> ! {
let tx = gpioa.pa9.into_funsel_2(); let tx = gpioa.pa9.into_funsel_2();
let rx = gpioa.pa8.into_funsel_2(); let rx = gpioa.pa8.into_funsel_2();
let uarta = uart::Uart::uarta(dp.uarta, (tx, rx), 115200.Hz(), &mut dp.sysconfig, 50.MHz()); let uarta = uart::Uart::new(&mut dp.sysconfig, 50.MHz(), dp.uarta, (tx, rx), 115200.Hz());
let (mut tx, mut rx) = uarta.split(); let (mut tx, mut rx) = uarta.split();
writeln!(tx, "Hello World\r").unwrap(); writeln!(tx, "Hello World\r").unwrap();
loop { loop {

View File

@ -6,6 +6,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/) The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/). and this project adheres to [Semantic Versioning](http://semver.org/).
## [v0.7.0] 2024-07-04
- Replace `uarta` and `uartb` `Uart` constructors by `new` method.
## [v0.6.0] 2024-06-16 ## [v0.6.0] 2024-06-16
- Updated `embedded-hal` to v1 - Updated `embedded-hal` to v1

File diff suppressed because it is too large Load Diff

View File

@ -11,7 +11,7 @@ use libm::floorf;
pub use crate::IrqCfg; pub use crate::IrqCfg;
use crate::{ use crate::{
clock::{self, enable_peripheral_clock, PeripheralClocks}, clock::{enable_peripheral_clock, PeripheralClocks},
gpio::pins::{ gpio::pins::{
AltFunc1, AltFunc2, AltFunc3, Pin, PA16, PA17, PA18, PA19, PA2, PA26, PA27, PA3, PA30, AltFunc1, AltFunc2, AltFunc3, Pin, PA16, PA17, PA18, PA19, PA2, PA26, PA27, PA3, PA30,
PA31, PA8, PA9, PB18, PB19, PB20, PB21, PB22, PB23, PB6, PB7, PB8, PB9, PA31, PA8, PA9, PB18, PB19, PB20, PB21, PB22, PB23, PB6, PB7, PB8, PB9,
@ -19,6 +19,7 @@ use crate::{
pac::{self, uarta as uart_base}, pac::{self, uarta as uart_base},
time::Hertz, time::Hertz,
utility::unmask_irq, utility::unmask_irq,
PeripheralSelect,
}; };
//================================================================================================== //==================================================================================================
@ -306,7 +307,7 @@ pub struct UartBase<Uart> {
} }
/// Serial abstraction. Entry point to create a new UART /// Serial abstraction. Entry point to create a new UART
pub struct Uart<Uart, Pins> { pub struct Uart<Uart, Pins> {
uart_base: UartBase<Uart>, inner: UartBase<Uart>,
pins: Pins, pins: Pins,
} }
@ -353,6 +354,7 @@ impl<UART> Tx<UART> {
pub trait Instance: Deref<Target = uart_base::RegisterBlock> { pub trait Instance: Deref<Target = uart_base::RegisterBlock> {
fn ptr() -> *const uart_base::RegisterBlock; fn ptr() -> *const uart_base::RegisterBlock;
const IDX: u8; const IDX: u8;
const PERIPH_SEL: PeripheralSelect;
} }
impl<UART: Instance> UartBase<UART> { impl<UART: Instance> UartBase<UART> {
@ -483,14 +485,34 @@ impl<UART: Instance> UartBase<UART> {
} }
} }
impl<UART, PINS> Uart<UART, PINS> impl<UartInstance, PinsInstance> Uart<UartInstance, PinsInstance>
where where
UART: Instance, UartInstance: Instance,
PinsInstance: Pins<UartInstance>,
{ {
pub fn new(
syscfg: &mut va108xx::Sysconfig,
sys_clk: impl Into<Hertz>,
uart: UartInstance,
pins: PinsInstance,
config: impl Into<Config>,
) -> Self {
crate::clock::enable_peripheral_clock(syscfg, UartInstance::PERIPH_SEL);
Uart {
inner: UartBase {
uart,
tx: Tx::new(),
rx: Rx::new(),
},
pins,
}
.init(config.into(), sys_clk.into())
}
/// This function assumes that the peripheral clock was alredy enabled /// This function assumes that the peripheral clock was alredy enabled
/// in the SYSCONFIG register /// in the SYSCONFIG register
fn init(mut self, config: Config, sys_clk: Hertz) -> Self { fn init(mut self, config: Config, sys_clk: Hertz) -> Self {
self.uart_base = self.uart_base.init(config, sys_clk); self.inner = self.inner.init(config, sys_clk);
self self
} }
@ -501,7 +523,7 @@ where
irq_cfg: IrqCfg, irq_cfg: IrqCfg,
sys_cfg: Option<&mut pac::Sysconfig>, sys_cfg: Option<&mut pac::Sysconfig>,
irq_sel: Option<&mut pac::Irqsel>, irq_sel: Option<&mut pac::Irqsel>,
) -> UartWithIrq<UART, PINS> { ) -> UartWithIrq<UartInstance, PinsInstance> {
let (uart, pins) = self.downgrade_internal(); let (uart, pins) = self.downgrade_internal();
UartWithIrq { UartWithIrq {
pins, pins,
@ -520,75 +542,75 @@ where
#[inline] #[inline]
pub fn enable_rx(&mut self) { pub fn enable_rx(&mut self) {
self.uart_base.enable_rx(); self.inner.enable_rx();
} }
#[inline] #[inline]
pub fn disable_rx(&mut self) { pub fn disable_rx(&mut self) {
self.uart_base.enable_rx(); self.inner.enable_rx();
} }
#[inline] #[inline]
pub fn enable_tx(&mut self) { pub fn enable_tx(&mut self) {
self.uart_base.enable_tx(); self.inner.enable_tx();
} }
#[inline] #[inline]
pub fn disable_tx(&mut self) { pub fn disable_tx(&mut self) {
self.uart_base.disable_tx(); self.inner.disable_tx();
} }
#[inline] #[inline]
pub fn clear_rx_fifo(&mut self) { pub fn clear_rx_fifo(&mut self) {
self.uart_base.clear_rx_fifo(); self.inner.clear_rx_fifo();
} }
#[inline] #[inline]
pub fn clear_tx_fifo(&mut self) { pub fn clear_tx_fifo(&mut self) {
self.uart_base.clear_tx_fifo(); self.inner.clear_tx_fifo();
} }
#[inline] #[inline]
pub fn clear_rx_status(&mut self) { pub fn clear_rx_status(&mut self) {
self.uart_base.clear_rx_status(); self.inner.clear_rx_status();
} }
#[inline] #[inline]
pub fn clear_tx_status(&mut self) { pub fn clear_tx_status(&mut self) {
self.uart_base.clear_tx_status(); self.inner.clear_tx_status();
} }
pub fn listen(&self, event: Event) { pub fn listen(&self, event: Event) {
self.uart_base.listen(event); self.inner.listen(event);
} }
pub fn unlisten(&self, event: Event) { pub fn unlisten(&self, event: Event) {
self.uart_base.unlisten(event); self.inner.unlisten(event);
} }
pub fn release(self) -> (UART, PINS) { pub fn release(self) -> (UartInstance, PinsInstance) {
(self.uart_base.release(), self.pins) (self.inner.release(), self.pins)
} }
fn downgrade_internal(self) -> (UartBase<UART>, PINS) { fn downgrade_internal(self) -> (UartBase<UartInstance>, PinsInstance) {
let base = UartBase { let base = UartBase {
uart: self.uart_base.uart, uart: self.inner.uart,
tx: self.uart_base.tx, tx: self.inner.tx,
rx: self.uart_base.rx, rx: self.inner.rx,
}; };
(base, self.pins) (base, self.pins)
} }
pub fn downgrade(self) -> UartBase<UART> { pub fn downgrade(self) -> UartBase<UartInstance> {
UartBase { UartBase {
uart: self.uart_base.uart, uart: self.inner.uart,
tx: self.uart_base.tx, tx: self.inner.tx,
rx: self.uart_base.rx, rx: self.inner.rx,
} }
} }
pub fn split(self) -> (Tx<UART>, Rx<UART>) { pub fn split(self) -> (Tx<UartInstance>, Rx<UartInstance>) {
self.uart_base.split() self.inner.split()
} }
} }
@ -597,6 +619,8 @@ impl Instance for pac::Uarta {
pac::Uarta::ptr() as *const _ pac::Uarta::ptr() as *const _
} }
const IDX: u8 = 0; const IDX: u8 = 0;
const PERIPH_SEL: PeripheralSelect = PeripheralSelect::Uart0;
} }
impl Instance for pac::Uartb { impl Instance for pac::Uartb {
@ -604,36 +628,8 @@ impl Instance for pac::Uartb {
pac::Uartb::ptr() as *const _ pac::Uartb::ptr() as *const _
} }
const IDX: u8 = 1; const IDX: u8 = 1;
}
macro_rules! uart_impl { const PERIPH_SEL: PeripheralSelect = PeripheralSelect::Uart1;
($($UARTX:path: ($uartx:ident, $clk_enb_enum:path),)+) => {
$(
impl<PINS: Pins<$UARTX>> Uart<$UARTX, PINS> {
pub fn $uartx(
uart: $UARTX,
pins: PINS,
config: impl Into<Config>,
syscfg: &mut pac::Sysconfig,
sys_clk: impl Into<Hertz>
) -> Self
{
enable_peripheral_clock(syscfg, $clk_enb_enum);
Uart {
uart_base: UartBase {
uart,
tx: Tx::new(),
rx: Rx::new(),
},
pins,
}
.init(config.into(), sys_clk.into())
}
}
)+
}
} }
impl<UART: Instance> UartWithIrqBase<UART> { impl<UART: Instance> UartWithIrqBase<UART> {
@ -871,10 +867,12 @@ impl<UART: Instance, PINS> UartWithIrq<UART, PINS> {
} }
} }
/*
uart_impl! { uart_impl! {
pac::Uarta: (uarta, clock::PeripheralClocks::Uart0), pac::Uarta: (uarta, clock::PeripheralClocks::Uart0),
pac::Uartb: (uartb, clock::PeripheralClocks::Uart1), pac::Uartb: (uartb, clock::PeripheralClocks::Uart1),
} }
*/
impl<Uart> Tx<Uart> where Uart: Instance {} impl<Uart> Tx<Uart> where Uart: Instance {}

View File

@ -18,6 +18,17 @@
"executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/blinky-leds", "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/blinky-leds",
"interface": "jtag", "interface": "jtag",
"runToEntryPoint": "main", "runToEntryPoint": "main",
"rttConfig": {
"enabled": true,
"address": "0x10000000",
"decoders": [
{
"port": 0,
"timestamp": true,
"type": "console"
}
]
}
}, },
{ {
"type": "cortex-debug", "type": "cortex-debug",
@ -28,9 +39,20 @@
"device": "Cortex-M0", "device": "Cortex-M0",
"svdFile": "./va108xx/svd/va108xx.svd.patched", "svdFile": "./va108xx/svd/va108xx.svd.patched",
"preLaunchTask": "rust: cargo build hal tests", "preLaunchTask": "rust: cargo build hal tests",
"executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/tests", "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/board-tests",
"interface": "jtag", "interface": "jtag",
"runToEntryPoint": "main", "runToEntryPoint": "main",
"rttConfig": {
"enabled": true,
"address": "0x10000000",
"decoders": [
{
"port": 0,
"timestamp": true,
"type": "console"
}
]
}
}, },
{ {
"type": "cortex-debug", "type": "cortex-debug",
@ -44,6 +66,17 @@
"executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/rtt-log", "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/rtt-log",
"interface": "jtag", "interface": "jtag",
"runToEntryPoint": "main", "runToEntryPoint": "main",
"rttConfig": {
"enabled": true,
"address": "0x10000000",
"decoders": [
{
"port": 0,
"timestamp": true,
"type": "console"
}
]
}
}, },
{ {
"type": "cortex-debug", "type": "cortex-debug",
@ -57,6 +90,17 @@
"executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/blinky-button-irq", "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/blinky-button-irq",
"interface": "jtag", "interface": "jtag",
"runToEntryPoint": "main", "runToEntryPoint": "main",
"rttConfig": {
"enabled": true,
"address": "0x10000000",
"decoders": [
{
"port": 0,
"timestamp": true,
"type": "console"
}
]
}
}, },
{ {
"type": "cortex-debug", "type": "cortex-debug",
@ -70,6 +114,17 @@
"executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/timer-ticks", "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/timer-ticks",
"interface": "jtag", "interface": "jtag",
"runToEntryPoint": "main", "runToEntryPoint": "main",
"rttConfig": {
"enabled": true,
"address": "0x10000000",
"decoders": [
{
"port": 0,
"timestamp": true,
"type": "console"
}
]
}
}, },
{ {
"type": "cortex-debug", "type": "cortex-debug",
@ -83,6 +138,17 @@
"executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/uart", "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/uart",
"interface": "jtag", "interface": "jtag",
"runToEntryPoint": "main", "runToEntryPoint": "main",
"rttConfig": {
"enabled": true,
"address": "0x10000000",
"decoders": [
{
"port": 0,
"timestamp": true,
"type": "console"
}
]
}
}, },
{ {
"type": "cortex-debug", "type": "cortex-debug",
@ -96,6 +162,17 @@
"executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/spi", "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/spi",
"interface": "jtag", "interface": "jtag",
"runToEntryPoint": "main", "runToEntryPoint": "main",
"rttConfig": {
"enabled": true,
"address": "0x10000000",
"decoders": [
{
"port": 0,
"timestamp": true,
"type": "console"
}
]
}
}, },
{ {
"type": "cortex-debug", "type": "cortex-debug",
@ -109,11 +186,22 @@
"executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/adt75-temp-sensor", "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/adt75-temp-sensor",
"interface": "jtag", "interface": "jtag",
"runToEntryPoint": "main", "runToEntryPoint": "main",
"rttConfig": {
"enabled": true,
"address": "0x10000000",
"decoders": [
{
"port": 0,
"timestamp": true,
"type": "console"
}
]
}
}, },
{ {
"type": "cortex-debug", "type": "cortex-debug",
"request": "launch", "request": "launch",
"name": "Debug Button Blinky RTIC", "name": "Button Blinky RTIC Example",
"servertype": "jlink", "servertype": "jlink",
"cwd": "${workspaceRoot}", "cwd": "${workspaceRoot}",
"device": "Cortex-M0", "device": "Cortex-M0",
@ -122,11 +210,22 @@
"executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/blinky-button-rtic", "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/blinky-button-rtic",
"interface": "jtag", "interface": "jtag",
"runToEntryPoint": "main", "runToEntryPoint": "main",
"rttConfig": {
"enabled": true,
"address": "0x10000000",
"decoders": [
{
"port": 0,
"timestamp": true,
"type": "console"
}
]
}
}, },
{ {
"type": "cortex-debug", "type": "cortex-debug",
"request": "launch", "request": "launch",
"name": "Debug PWM", "name": "PWM Example",
"servertype": "jlink", "servertype": "jlink",
"cwd": "${workspaceRoot}", "cwd": "${workspaceRoot}",
"device": "Cortex-M0", "device": "Cortex-M0",
@ -135,11 +234,22 @@
"executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/pwm", "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/pwm",
"interface": "jtag", "interface": "jtag",
"runToEntryPoint": "main", "runToEntryPoint": "main",
"rttConfig": {
"enabled": true,
"address": "0x10000000",
"decoders": [
{
"port": 0,
"timestamp": true,
"type": "console"
}
]
}
}, },
{ {
"type": "cortex-debug", "type": "cortex-debug",
"request": "launch", "request": "launch",
"name": "Debug Cascade", "name": "Cascade Example",
"servertype": "jlink", "servertype": "jlink",
"cwd": "${workspaceRoot}", "cwd": "${workspaceRoot}",
"device": "Cortex-M0", "device": "Cortex-M0",
@ -148,11 +258,22 @@
"executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/cascade", "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/cascade",
"interface": "jtag", "interface": "jtag",
"runToEntryPoint": "main", "runToEntryPoint": "main",
"rttConfig": {
"enabled": true,
"address": "0x10000000",
"decoders": [
{
"port": 0,
"timestamp": true,
"type": "console"
}
]
}
}, },
{ {
"type": "cortex-debug", "type": "cortex-debug",
"request": "launch", "request": "launch",
"name": "Debug Accelerometer", "name": "Accelerometer Example",
"servertype": "jlink", "servertype": "jlink",
"cwd": "${workspaceRoot}", "cwd": "${workspaceRoot}",
"device": "Cortex-M0", "device": "Cortex-M0",
@ -161,6 +282,17 @@
"executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/adxl343-accelerometer", "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/adxl343-accelerometer",
"interface": "jtag", "interface": "jtag",
"runToEntryPoint": "main", "runToEntryPoint": "main",
"rttConfig": {
"enabled": true,
"address": "0x10000000",
"decoders": [
{
"port": 0,
"timestamp": true,
"type": "console"
}
]
}
}, },
{ {
"type": "cortex-debug", "type": "cortex-debug",
@ -178,7 +310,7 @@
{ {
"type": "cortex-debug", "type": "cortex-debug",
"request": "launch", "request": "launch",
"name": "Debug ADC", "name": "ADC Example",
"servertype": "jlink", "servertype": "jlink",
"cwd": "${workspaceRoot}", "cwd": "${workspaceRoot}",
"device": "Cortex-M0", "device": "Cortex-M0",
@ -187,11 +319,22 @@
"executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/max11619-adc", "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/max11619-adc",
"interface": "jtag", "interface": "jtag",
"runToEntryPoint": "main", "runToEntryPoint": "main",
"rttConfig": {
"enabled": true,
"address": "0x10000000",
"decoders": [
{
"port": 0,
"timestamp": true,
"type": "console"
}
]
}
}, },
{ {
"type": "cortex-debug", "type": "cortex-debug",
"request": "launch", "request": "launch",
"name": "Debug UART IRQ", "name": "UART IRQ Example",
"servertype": "jlink", "servertype": "jlink",
"cwd": "${workspaceRoot}", "cwd": "${workspaceRoot}",
"device": "Cortex-M0", "device": "Cortex-M0",
@ -200,6 +343,17 @@
"executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/uart-irq-rtic", "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/uart-irq-rtic",
"interface": "jtag", "interface": "jtag",
"runToEntryPoint": "main", "runToEntryPoint": "main",
"rttConfig": {
"enabled": true,
"address": "0x10000000",
"decoders": [
{
"port": 0,
"timestamp": true,
"type": "console"
}
]
}
}, },
] ]
} }

View File

@ -21,10 +21,8 @@
"command": "~/.cargo/bin/cargo", // note: full path to the cargo "command": "~/.cargo/bin/cargo", // note: full path to the cargo
"args": [ "args": [
"build", "build",
"-p",
"va108xx-hal",
"--bin", "--bin",
"tests", "board-tests",
"--features", "--features",
"rt" "rt"
], ],
@ -39,8 +37,6 @@
"command": "~/.cargo/bin/cargo", // note: full path to the cargo "command": "~/.cargo/bin/cargo", // note: full path to the cargo
"args": [ "args": [
"build", "build",
"-p",
"va108xx-hal",
"--example", "--example",
"rtt-log", "rtt-log",
], ],
@ -55,8 +51,6 @@
"command": "~/.cargo/bin/cargo", // note: full path to the cargo "command": "~/.cargo/bin/cargo", // note: full path to the cargo
"args": [ "args": [
"build", "build",
"-p",
"va108xx-hal",
"--example", "--example",
"timer-ticks", "timer-ticks",
"--features", "--features",
@ -89,8 +83,6 @@
"command": "~/.cargo/bin/cargo", // note: full path to the cargo "command": "~/.cargo/bin/cargo", // note: full path to the cargo
"args": [ "args": [
"build", "build",
"-p",
"va108xx-hal",
"--example", "--example",
"spi", "spi",
], ],
@ -105,8 +97,6 @@
"command": "~/.cargo/bin/cargo", // note: full path to the cargo "command": "~/.cargo/bin/cargo", // note: full path to the cargo
"args": [ "args": [
"build", "build",
"-p",
"va108xx-hal",
"--example", "--example",
"pwm", "pwm",
"--features", "--features",
@ -123,8 +113,6 @@
"command": "~/.cargo/bin/cargo", // note: full path to the cargo "command": "~/.cargo/bin/cargo", // note: full path to the cargo
"args": [ "args": [
"build", "build",
"-p",
"va108xx-hal",
"--example", "--example",
"cascade", "cascade",
"--features", "--features",
@ -141,8 +129,6 @@
"command": "~/.cargo/bin/cargo", // note: full path to the cargo "command": "~/.cargo/bin/cargo", // note: full path to the cargo
"args": [ "args": [
"build", "build",
"-p",
"va108xx-hal",
"--example", "--example",
"uart-irq-rtic", "uart-irq-rtic",
"--features", "--features",