bump HAL and PAC
This commit is contained in:
@@ -13,6 +13,6 @@ crc = "3"
|
|||||||
static_assertions = "1"
|
static_assertions = "1"
|
||||||
|
|
||||||
[dependencies.va416xx-hal]
|
[dependencies.va416xx-hal]
|
||||||
version = "0.5"
|
version = "0.6"
|
||||||
features = ["va41630", "defmt"]
|
features = ["va41630", "defmt"]
|
||||||
path = "../va416xx-hal"
|
path = "../va416xx-hal"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ embedded-io = "0.6"
|
|||||||
embedded-hal-async = "1"
|
embedded-hal-async = "1"
|
||||||
embedded-io-async = "0.6"
|
embedded-io-async = "0.6"
|
||||||
|
|
||||||
heapless = "0.8"
|
heapless = "0.9"
|
||||||
defmt-rtt = "1"
|
defmt-rtt = "1"
|
||||||
defmt = "1"
|
defmt = "1"
|
||||||
panic-probe = { version = "1", features = ["print-defmt"] }
|
panic-probe = { version = "1", features = ["print-defmt"] }
|
||||||
@@ -21,14 +21,14 @@ ringbuf = { version = "0.4", default-features = false }
|
|||||||
|
|
||||||
nb = "1"
|
nb = "1"
|
||||||
embassy-sync = "0.7"
|
embassy-sync = "0.7"
|
||||||
embassy-time = "0.4"
|
embassy-time = "0.5"
|
||||||
embassy-executor = { version = "0.7", features = [
|
embassy-executor = { version = "0.9", features = [
|
||||||
"arch-cortex-m",
|
"arch-cortex-m",
|
||||||
"executor-thread",
|
"executor-thread",
|
||||||
"executor-interrupt"
|
"executor-interrupt"
|
||||||
]}
|
]}
|
||||||
|
|
||||||
va416xx-hal = { version = "0.5", path = "../../va416xx-hal", features = ["defmt"] }
|
va416xx-hal = { version = "0.6", path = "../../va416xx-hal", features = ["defmt"] }
|
||||||
va416xx-embassy = { version = "0.1", path = "../../va416xx-embassy", default-features = false }
|
va416xx-embassy = { version = "0.1", path = "../../va416xx-embassy", default-features = false }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ use va416xx_hal::{
|
|||||||
|
|
||||||
static QUEUE_UART_A: static_cell::ConstStaticCell<Queue<u8, 256>> =
|
static QUEUE_UART_A: static_cell::ConstStaticCell<Queue<u8, 256>> =
|
||||||
static_cell::ConstStaticCell::new(Queue::new());
|
static_cell::ConstStaticCell::new(Queue::new());
|
||||||
static PRODUCER_UART_A: Mutex<RefCell<Option<Producer<u8, 256>>>> = Mutex::new(RefCell::new(None));
|
static PRODUCER_UART_A: Mutex<RefCell<Option<Producer<u8>>>> = Mutex::new(RefCell::new(None));
|
||||||
|
|
||||||
#[embassy_executor::main]
|
#[embassy_executor::main]
|
||||||
async fn main(_spawner: Spawner) {
|
async fn main(_spawner: Spawner) {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ defmt-rtt = "1"
|
|||||||
defmt = "1"
|
defmt = "1"
|
||||||
panic-probe = { version = "1", features = ["defmt"] }
|
panic-probe = { version = "1", features = ["defmt"] }
|
||||||
|
|
||||||
va416xx-hal = { version = "0.5", path = "../../va416xx-hal", features = ["va41630"] }
|
va416xx-hal = { version = "0.6", path = "../../va416xx-hal", features = ["va41630"] }
|
||||||
|
|
||||||
[dependencies.rtic]
|
[dependencies.rtic]
|
||||||
version = "2"
|
version = "2"
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ embedded-io = "0.6"
|
|||||||
panic-halt = "1"
|
panic-halt = "1"
|
||||||
accelerometer = "0.12"
|
accelerometer = "0.12"
|
||||||
|
|
||||||
va416xx-hal = { version = "0.5", path = "../../va416xx-hal", features = ["va41630", "defmt"] }
|
va416xx-hal = { version = "0.6", path = "../../va416xx-hal", features = ["va41630", "defmt"] }
|
||||||
|
|
||||||
[dependencies.vorago-peb1]
|
[dependencies.vorago-peb1]
|
||||||
path = "../../vorago-peb1"
|
path = "../../vorago-peb1"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ use cortex_m_rt::entry;
|
|||||||
use embedded_hal::spi::{Mode, SpiBus, MODE_0};
|
use embedded_hal::spi::{Mode, SpiBus, MODE_0};
|
||||||
use simple_examples::peb1;
|
use simple_examples::peb1;
|
||||||
use va416xx_hal::clock::ClockConfigurator;
|
use va416xx_hal::clock::ClockConfigurator;
|
||||||
use va416xx_hal::spi::{Spi, SpiClkConfig};
|
use va416xx_hal::spi::{Spi, SpiClockConfig};
|
||||||
use va416xx_hal::timer::CountdownTimer;
|
use va416xx_hal::timer::CountdownTimer;
|
||||||
use va416xx_hal::{
|
use va416xx_hal::{
|
||||||
pac,
|
pac,
|
||||||
@@ -52,7 +52,7 @@ fn main() -> ! {
|
|||||||
|
|
||||||
let mut spi_cfg = SpiConfig::default()
|
let mut spi_cfg = SpiConfig::default()
|
||||||
.clk_cfg(
|
.clk_cfg(
|
||||||
SpiClkConfig::from_clks(&clocks, Hertz::from_raw(SPI_SPEED_KHZ))
|
SpiClockConfig::from_clks(&clocks, Hertz::from_raw(SPI_SPEED_KHZ))
|
||||||
.expect("invalid target clock"),
|
.expect("invalid target clock"),
|
||||||
)
|
)
|
||||||
.mode(SPI_MODE)
|
.mode(SPI_MODE)
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ once_cell = { version = "1", default-features = false, features = ["critical-sec
|
|||||||
spacepackets = { version = "0.15", default-features = false, features = ["defmt"] }
|
spacepackets = { version = "0.15", default-features = false, features = ["defmt"] }
|
||||||
cobs = { version = "0.4", default-features = false }
|
cobs = { version = "0.4", default-features = false }
|
||||||
|
|
||||||
va416xx-hal = { version = "0.5", features = ["va41630", "defmt"], path = "../va416xx-hal" }
|
va416xx-hal = { version = "0.6", features = ["va41630", "defmt"], path = "../va416xx-hal" }
|
||||||
|
|
||||||
rtic = { version = "2", features = ["thumbv7-backend"] }
|
rtic = { version = "2", features = ["thumbv7-backend"] }
|
||||||
rtic-monotonics = { version = "2", features = ["cortex-m-systick"] }
|
rtic-monotonics = { version = "2", features = ["cortex-m-systick"] }
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ edition = "2021"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cortex-m-rt = "0.7"
|
cortex-m-rt = "0.7"
|
||||||
panic-rtt-target = { version = "0.1.3" }
|
panic-rtt-target = { version = "0.2" }
|
||||||
rtt-target = { version = "0.5" }
|
rtt-target = { version = "0.6" }
|
||||||
cortex-m = { version = "0.7", features = ["critical-section-single-core"] }
|
cortex-m = { version = "0.7", features = ["critical-section-single-core"] }
|
||||||
embedded-hal = "1"
|
embedded-hal = "1"
|
||||||
va416xx-hal = { path = "0.4", features = ["va41630"] }
|
va416xx-hal = { path = "0.4", features = ["va41630"] }
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ edition = "2021"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cortex-m-rt = "0.7"
|
cortex-m-rt = "0.7"
|
||||||
panic-rtt-target = { version = "0.1.3" }
|
panic-rtt-target = { version = "0.2" }
|
||||||
rtt-target = { version = "0.5" }
|
rtt-target = { version = "0.6" }
|
||||||
cortex-m = { version = "0.7", features = ["critical-section-single-core"] }
|
cortex-m = { version = "0.7", features = ["critical-section-single-core"] }
|
||||||
embedded-hal = "1"
|
embedded-hal = "1"
|
||||||
va416xx-hal = { path = "0.4", features = ["va41630"] }
|
va416xx-hal = { path = "0.4", features = ["va41630"] }
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ mod app {
|
|||||||
};
|
};
|
||||||
use va416xx_hal::clock::ClockConfigurator;
|
use va416xx_hal::clock::ClockConfigurator;
|
||||||
use va416xx_hal::irq_router::enable_and_init_irq_router;
|
use va416xx_hal::irq_router::enable_and_init_irq_router;
|
||||||
use va416xx_hal::uart::IrqContextTimeoutOrMaxSize;
|
use va416xx_hal::uart::InterruptContextTimeoutOrMaxSize;
|
||||||
use va416xx_hal::{
|
use va416xx_hal::{
|
||||||
edac,
|
edac,
|
||||||
nvm::Nvm,
|
nvm::Nvm,
|
||||||
@@ -131,7 +131,7 @@ mod app {
|
|||||||
struct Local {
|
struct Local {
|
||||||
uart_rx: uart::RxWithInterrupt,
|
uart_rx: uart::RxWithInterrupt,
|
||||||
uart_tx: uart::Tx,
|
uart_tx: uart::Tx,
|
||||||
rx_context: IrqContextTimeoutOrMaxSize,
|
rx_context: InterruptContextTimeoutOrMaxSize,
|
||||||
rom_spi: Option<pac::Spi3>,
|
rom_spi: Option<pac::Spi3>,
|
||||||
// We handle all TM in one task.
|
// We handle all TM in one task.
|
||||||
tm_cons: DataConsumer<BUF_RB_SIZE_TM, SIZES_RB_SIZE_TM>,
|
tm_cons: DataConsumer<BUF_RB_SIZE_TM, SIZES_RB_SIZE_TM>,
|
||||||
@@ -195,7 +195,7 @@ mod app {
|
|||||||
CLOCKS.set(clocks).unwrap();
|
CLOCKS.set(clocks).unwrap();
|
||||||
|
|
||||||
let mut rx = rx.into_rx_with_irq();
|
let mut rx = rx.into_rx_with_irq();
|
||||||
let mut rx_context = IrqContextTimeoutOrMaxSize::new(MAX_TC_FRAME_SIZE);
|
let mut rx_context = InterruptContextTimeoutOrMaxSize::new(MAX_TC_FRAME_SIZE);
|
||||||
rx.read_fixed_len_or_timeout_based_using_irq(&mut rx_context)
|
rx.read_fixed_len_or_timeout_based_using_irq(&mut rx_context)
|
||||||
.expect("initiating UART RX failed");
|
.expect("initiating UART RX failed");
|
||||||
pus_tc_handler::spawn().unwrap();
|
pus_tc_handler::spawn().unwrap();
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ keywords = ["no-std", "hal", "cortex-m", "vorago", "va416xx"]
|
|||||||
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", rev = "c8e475cbba820a4b235b46f3d284e23d72396855", features = ["vor4x"] }
|
vorago-shared-hal = { git = "https://egit.irs.uni-stuttgart.de/rust/vorago-shared-hal.git", features = ["vor4x"] }
|
||||||
va416xx-hal = { path = "../va416xx-hal" }
|
va416xx-hal = { path = "../va416xx-hal" }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
|||||||
@@ -42,9 +42,9 @@ use va416xx_hal::{
|
|||||||
clock::Clocks,
|
clock::Clocks,
|
||||||
irq_router::enable_and_init_irq_router,
|
irq_router::enable_and_init_irq_router,
|
||||||
pac::{self, interrupt},
|
pac::{self, interrupt},
|
||||||
timer::{TimMarker, TIM_IRQ_OFFSET},
|
timer::{TimInstance, TIM_IRQ_OFFSET},
|
||||||
};
|
};
|
||||||
use vorago_shared_periphs::embassy::time_driver;
|
use vorago_shared_hal::embassy::time_driver;
|
||||||
|
|
||||||
/// Macro to define the IRQ handlers for the time driver.
|
/// Macro to define the IRQ handlers for the time driver.
|
||||||
///
|
///
|
||||||
@@ -95,7 +95,7 @@ embassy_time_driver_irqs!(timekeeper_irq = TIM23, alarm_irq = TIM22);
|
|||||||
/// used TIM peripherals has to match the ID of the passed timer peripherals. Currently, this
|
/// used TIM peripherals has to match the ID of the passed timer peripherals. Currently, this
|
||||||
/// can only be checked at run-time, and a run-time assertion will panic on the embassy
|
/// can only be checked at run-time, and a run-time assertion will panic on the embassy
|
||||||
/// initialization in case of a missmatch.
|
/// initialization in case of a missmatch.
|
||||||
pub fn init<TimekeeperTim: TimMarker, AlarmTim: TimMarker>(
|
pub fn init<TimekeeperTim: TimInstance, AlarmTim: TimInstance>(
|
||||||
timekeeper: TimekeeperTim,
|
timekeeper: TimekeeperTim,
|
||||||
alarm: AlarmTim,
|
alarm: AlarmTim,
|
||||||
clocks: &Clocks,
|
clocks: &Clocks,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "va416xx-hal"
|
name = "va416xx-hal"
|
||||||
version = "0.5.1"
|
version = "0.6.0"
|
||||||
authors = ["Robin Mueller <muellerr@irs.uni-stuttgart.de>"]
|
authors = ["Robin Mueller <muellerr@irs.uni-stuttgart.de>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "HAL for the Vorago VA416xx family of MCUs"
|
description = "HAL for the Vorago VA416xx family of MCUs"
|
||||||
@@ -12,10 +12,10 @@ categories = ["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"] }
|
||||||
va416xx = { version = "0.4", features = ["critical-section"], default-features = false }
|
va416xx = { version = "0.5", features = ["critical-section"], default-features = false }
|
||||||
derive-mmio = { git = "https://github.com/knurling-rs/derive-mmio.git", version = "0.6"}
|
derive-mmio = { git = "https://github.com/knurling-rs/derive-mmio.git", version = "0.6"}
|
||||||
static_assertions = "1.1"
|
static_assertions = "1.1"
|
||||||
vorago-shared-periphs = { git = "https://egit.irs.uni-stuttgart.de/rust/vorago-shared-periphs.git", rev = "c8e475cbba820a4b235b46f3d284e23d72396855", features = ["vor4x"] }
|
vorago-shared-hal = { git = "https://egit.irs.uni-stuttgart.de/rust/vorago-shared-hal.git", features = ["vor4x"] }
|
||||||
|
|
||||||
libm = "0.2"
|
libm = "0.2"
|
||||||
nb = "1"
|
nb = "1"
|
||||||
@@ -23,7 +23,7 @@ embedded-hal = "1"
|
|||||||
num_enum = { version = "0.7", default-features = false }
|
num_enum = { version = "0.7", default-features = false }
|
||||||
bitflags = "2"
|
bitflags = "2"
|
||||||
bitbybit = "1.3"
|
bitbybit = "1.3"
|
||||||
arbitrary-int = "1.3"
|
arbitrary-int = "2"
|
||||||
fugit = "0.3"
|
fugit = "0.3"
|
||||||
embedded-can = "0.4"
|
embedded-can = "0.4"
|
||||||
embassy-sync = "0.7"
|
embassy-sync = "0.7"
|
||||||
@@ -35,13 +35,13 @@ defmt = { version = "1", optional = true }
|
|||||||
default = ["rt", "revb"]
|
default = ["rt", "revb"]
|
||||||
rt = ["va416xx/rt"]
|
rt = ["va416xx/rt"]
|
||||||
alloc = []
|
alloc = []
|
||||||
defmt = ["dep:defmt", "fugit/defmt", "vorago-shared-periphs/defmt"]
|
defmt = ["dep:defmt", "fugit/defmt", "vorago-shared-hal/defmt"]
|
||||||
|
|
||||||
va41630 = ["device-selected"]
|
va41630 = ["device-selected"]
|
||||||
va41620 = ["device-selected"]
|
va41620 = ["device-selected"]
|
||||||
|
|
||||||
va41629 = ["device-selected"]
|
va41629 = ["device-selected"]
|
||||||
va41628 = ["device-selected", "vorago-shared-periphs/va41628"]
|
va41628 = ["device-selected", "vorago-shared-hal/va41628"]
|
||||||
|
|
||||||
device-selected = []
|
device-selected = []
|
||||||
revb = []
|
revb = []
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ use crate::clock::Clocks;
|
|||||||
use crate::pac;
|
use crate::pac;
|
||||||
use crate::time::Hertz;
|
use crate::time::Hertz;
|
||||||
use num_enum::{IntoPrimitive, TryFromPrimitive};
|
use num_enum::{IntoPrimitive, TryFromPrimitive};
|
||||||
use vorago_shared_periphs::{enable_peripheral_clock, PeripheralSelect};
|
use vorago_shared_hal::{enable_peripheral_clock, PeripheralSelect};
|
||||||
|
|
||||||
pub const ADC_MIN_CLK: Hertz = Hertz::from_raw(2_000_000);
|
pub const ADC_MIN_CLK: Hertz = Hertz::from_raw(2_000_000);
|
||||||
pub const ADC_MAX_CLK: Hertz = Hertz::from_raw(12_500_000);
|
pub const ADC_MAX_CLK: Hertz = Hertz::from_raw(12_500_000);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use arbitrary_int::{u11, u15, u3, u4, Number};
|
use arbitrary_int::{prelude::*, u11, u15, u3, u4};
|
||||||
use embedded_can::Frame;
|
use embedded_can::Frame;
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
|
|||||||
@@ -19,11 +19,11 @@
|
|||||||
//! - [CAN example](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/examples/embassy/src/bin/can.rs)
|
//! - [CAN example](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/examples/embassy/src/bin/can.rs)
|
||||||
use core::sync::atomic::AtomicBool;
|
use core::sync::atomic::AtomicBool;
|
||||||
|
|
||||||
use arbitrary_int::{u11, u15, u2, u3, u4, u7, Number};
|
use arbitrary_int::{prelude::*, u11, u15, u2, u3, u4, u7};
|
||||||
use embedded_can::Frame;
|
use embedded_can::Frame;
|
||||||
use ll::CanChannelLowLevel;
|
use ll::CanChannelLowLevel;
|
||||||
use regs::{BaseId, BufferState, Control, MmioCan, TimingConfig};
|
use regs::{BaseId, BufferState, Control, MmioCan, TimingConfig};
|
||||||
use vorago_shared_periphs::enable_nvic_interrupt;
|
use vorago_shared_hal::enable_nvic_interrupt;
|
||||||
|
|
||||||
use crate::{clock::Clocks, enable_peripheral_clock, time::Hertz, PeripheralSelect};
|
use crate::{clock::Clocks, enable_peripheral_clock, time::Hertz, PeripheralSelect};
|
||||||
use libm::roundf;
|
use libm::roundf;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
//! Custom register definitions for the CAN register block to circumvent PAC API / SVD
|
//! Custom register definitions for the CAN register block to circumvent PAC API / SVD
|
||||||
//! shortcomings.
|
//! shortcomings.
|
||||||
|
|
||||||
use arbitrary_int::{u11, u15, u2, u3, u4, u6, u7, Number};
|
use arbitrary_int::{prelude::*, u11, u15, u2, u3, u4, u6, u7};
|
||||||
|
|
||||||
pub const CAN_0_BASE: usize = 0x4001_4000;
|
pub const CAN_0_BASE: usize = 0x4001_4000;
|
||||||
pub const CAN_1_BASE: usize = 0x4001_4400;
|
pub const CAN_1_BASE: usize = 0x4001_4400;
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ use crate::adc::ADC_MAX_CLK;
|
|||||||
use crate::pac;
|
use crate::pac;
|
||||||
|
|
||||||
use crate::time::Hertz;
|
use crate::time::Hertz;
|
||||||
pub use vorago_shared_periphs::clock::{Clocks, HBO_FREQ};
|
pub use vorago_shared_hal::clock::{Clocks, HBO_FREQ};
|
||||||
use vorago_shared_periphs::{enable_peripheral_clock, PeripheralSelect};
|
use vorago_shared_hal::{enable_peripheral_clock, PeripheralSelect};
|
||||||
|
|
||||||
pub const XTAL_OSC_TSTART_MS: u32 = 15;
|
pub const XTAL_OSC_TSTART_MS: u32 = 15;
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
//! - [ADC and DAC example](https://github.com/us-irs/va416xx-rs/blob/main/examples/simple/examples/dac-adc.rs)
|
//! - [ADC and DAC example](https://github.com/us-irs/va416xx-rs/blob/main/examples/simple/examples/dac-adc.rs)
|
||||||
use core::ops::Deref;
|
use core::ops::Deref;
|
||||||
|
|
||||||
use vorago_shared_periphs::{
|
use vorago_shared_hal::{
|
||||||
disable_peripheral_clock, enable_peripheral_clock, reset_peripheral_for_cycles,
|
disable_peripheral_clock, enable_peripheral_clock, reset_peripheral_for_cycles,
|
||||||
PeripheralSelect,
|
PeripheralSelect,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,9 +4,7 @@
|
|||||||
//!
|
//!
|
||||||
//! - [Simple DMA example](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/examples/simple/examples/dma.rs)
|
//! - [Simple DMA example](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/examples/simple/examples/dma.rs)
|
||||||
use arbitrary_int::{u10, u3};
|
use arbitrary_int::{u10, u3};
|
||||||
use vorago_shared_periphs::{
|
use vorago_shared_hal::{enable_peripheral_clock, reset_peripheral_for_cycles, PeripheralSelect};
|
||||||
enable_peripheral_clock, reset_peripheral_for_cycles, PeripheralSelect,
|
|
||||||
};
|
|
||||||
|
|
||||||
use crate::{enable_nvic_interrupt, pac};
|
use crate::{enable_nvic_interrupt, pac};
|
||||||
|
|
||||||
|
|||||||
@@ -17,4 +17,4 @@
|
|||||||
//!
|
//!
|
||||||
//! - [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)
|
||||||
//! - [Async GPIO example](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/examples/embassy/src/bin/async-gpio.rs)
|
//! - [Async GPIO example](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/examples/embassy/src/bin/async-gpio.rs)
|
||||||
pub use vorago_shared_periphs::gpio::*;
|
pub use vorago_shared_hal::gpio::*;
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
//! ## Examples
|
//! ## Examples
|
||||||
//!
|
//!
|
||||||
//! - [PEB1 accelerometer example](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/examples/simple/examples/peb1-accelerometer.rs)
|
//! - [PEB1 accelerometer example](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/examples/simple/examples/peb1-accelerometer.rs)
|
||||||
pub use vorago_shared_periphs::i2c::*;
|
pub use vorago_shared_hal::i2c::*;
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
//! IRQ Router peripheral support.
|
//! IRQ Router peripheral support.
|
||||||
use vorago_shared_periphs::{
|
use vorago_shared_hal::{enable_peripheral_clock, reset_peripheral_for_cycles, PeripheralSelect};
|
||||||
enable_peripheral_clock, reset_peripheral_for_cycles, PeripheralSelect,
|
|
||||||
};
|
|
||||||
|
|
||||||
use crate::pac;
|
use crate::pac;
|
||||||
|
|
||||||
|
|||||||
@@ -59,10 +59,10 @@ pub mod adc;
|
|||||||
#[cfg(not(feature = "va41628"))]
|
#[cfg(not(feature = "va41628"))]
|
||||||
pub mod dac;
|
pub mod dac;
|
||||||
|
|
||||||
pub use vorago_shared_periphs::{
|
pub use vorago_shared_hal::{
|
||||||
assert_peripheral_reset, deassert_peripheral_reset, disable_nvic_interrupt,
|
assert_peripheral_reset, deassert_peripheral_reset, disable_nvic_interrupt,
|
||||||
disable_peripheral_clock, enable_nvic_interrupt, enable_peripheral_clock,
|
disable_peripheral_clock, enable_nvic_interrupt, enable_peripheral_clock,
|
||||||
reset_peripheral_for_cycles, FunSel, PeripheralSelect,
|
reset_peripheral_for_cycles, FunctionSelect, PeripheralSelect,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Eq, thiserror::Error)]
|
#[derive(Debug, PartialEq, Eq, thiserror::Error)]
|
||||||
@@ -80,19 +80,19 @@ pub fn port_function_select(
|
|||||||
ioconfig: &mut pac::Ioconfig,
|
ioconfig: &mut pac::Ioconfig,
|
||||||
port: Port,
|
port: Port,
|
||||||
pin: u8,
|
pin: u8,
|
||||||
funsel: FunSel,
|
funsel: FunctionSelect,
|
||||||
) -> Result<(), InvalidPinError> {
|
) -> Result<(), InvalidPinError> {
|
||||||
if (port == Port::G && pin >= 8) || pin >= 16 {
|
if (port == Port::G && pin >= 8) || pin >= 16 {
|
||||||
return Err(InvalidPinError(pin));
|
return Err(InvalidPinError(pin));
|
||||||
}
|
}
|
||||||
let reg_block = match port {
|
let reg_block = match port {
|
||||||
Port::A => ioconfig.porta(pin as usize),
|
Port::A => ioconfig.porta(pin as usize),
|
||||||
Port::B => ioconfig.portb0(pin as usize),
|
Port::B => ioconfig.portb(pin as usize),
|
||||||
Port::C => ioconfig.portc0(pin as usize),
|
Port::C => ioconfig.portc(pin as usize),
|
||||||
Port::D => ioconfig.portd0(pin as usize),
|
Port::D => ioconfig.portd(pin as usize),
|
||||||
Port::E => ioconfig.porte0(pin as usize),
|
Port::E => ioconfig.porte(pin as usize),
|
||||||
Port::F => ioconfig.portf0(pin as usize),
|
Port::F => ioconfig.portf(pin as usize),
|
||||||
Port::G => ioconfig.portg0(pin as usize),
|
Port::G => ioconfig.portg(pin as usize),
|
||||||
};
|
};
|
||||||
|
|
||||||
reg_block.modify(|_, w| unsafe { w.funsel().bits(funsel as u8) });
|
reg_block.modify(|_, w| unsafe { w.funsel().bits(funsel as u8) });
|
||||||
|
|||||||
@@ -6,14 +6,14 @@
|
|||||||
//!
|
//!
|
||||||
//! - [Flashloader application](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/flashloader)
|
//! - [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 vorago_shared_periphs::{
|
use vorago_shared_hal::{
|
||||||
disable_peripheral_clock, enable_peripheral_clock, reset_peripheral_for_cycles,
|
disable_peripheral_clock, enable_peripheral_clock, reset_peripheral_for_cycles,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::clock::Clocks;
|
use crate::clock::Clocks;
|
||||||
use crate::pac;
|
use crate::pac;
|
||||||
use crate::spi::{
|
use crate::spi::{
|
||||||
mode_to_cpo_cph_bit, spi_clk_config_from_div, SpiMarker, WordProvider, BMSTART_BMSTOP_MASK,
|
mode_to_cpo_cph_bit, spi_clk_config_from_div, SpiInstance, SpiWord, BMSTART_BMSTOP_MASK,
|
||||||
};
|
};
|
||||||
|
|
||||||
const NVM_CLOCK_DIV: u16 = 2;
|
const NVM_CLOCK_DIV: u16 = 2;
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
//! This module contains the pin singletons. It allows creating those singletons
|
//! This module contains the pin singletons. It allows creating those singletons
|
||||||
//! to access the [Pin] structures of individual ports in a safe way with checked ownership
|
//! to access the [Pin] structures of individual ports in a safe way with checked ownership
|
||||||
//! rules.
|
//! rules.
|
||||||
pub use vorago_shared_periphs::pins::*;
|
pub use vorago_shared_hal::pins::*;
|
||||||
|
|||||||
@@ -5,4 +5,4 @@
|
|||||||
//! ## Examples
|
//! ## Examples
|
||||||
//!
|
//!
|
||||||
//! - [PWM example](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/examples/simple/examples/pwm.rs)
|
//! - [PWM example](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/examples/simple/examples/pwm.rs)
|
||||||
pub use vorago_shared_periphs::pwm::*;
|
pub use vorago_shared_hal::pwm::*;
|
||||||
|
|||||||
@@ -8,4 +8,4 @@
|
|||||||
//!
|
//!
|
||||||
//! - [Blocking SPI example](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/examples/simple/examples/spi.rs)
|
//! - [Blocking SPI example](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/examples/simple/examples/spi.rs)
|
||||||
//! - [NVM library][crate::nvm]
|
//! - [NVM library][crate::nvm]
|
||||||
pub use vorago_shared_periphs::spi::*;
|
pub use vorago_shared_hal::spi::*;
|
||||||
|
|||||||
@@ -4,6 +4,6 @@
|
|||||||
//!
|
//!
|
||||||
//! - [MS and second tick implementation](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/examples/simple/examples/timer-ticks.rs)
|
//! - [MS and second tick implementation](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/examples/simple/examples/timer-ticks.rs)
|
||||||
//! - [Cascade feature example](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/examples/simple/examples/cascade.rs)
|
//! - [Cascade feature example](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/examples/simple/examples/cascade.rs)
|
||||||
pub use vorago_shared_periphs::timer::*;
|
pub use vorago_shared_hal::timer::*;
|
||||||
|
|
||||||
pub const TIM_IRQ_OFFSET: usize = 48;
|
pub const TIM_IRQ_OFFSET: usize = 48;
|
||||||
|
|||||||
@@ -14,4 +14,4 @@
|
|||||||
//! - [Flashloader exposing a CCSDS interface via UART](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/flashloader)
|
//! - [Flashloader exposing a CCSDS interface via UART](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/flashloader)
|
||||||
//! - [Async UART RX example](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/examples/embassy/src/bin/async-uart-rx.rs)
|
//! - [Async UART RX example](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/examples/embassy/src/bin/async-uart-rx.rs)
|
||||||
//! - [Async UART TX example](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/examples/embassy/src/bin/async-uart-tx.rs)
|
//! - [Async UART TX example](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/examples/embassy/src/bin/async-uart-tx.rs)
|
||||||
pub use vorago_shared_periphs::uart::*;
|
pub use vorago_shared_hal::uart::*;
|
||||||
|
|||||||
@@ -3,9 +3,7 @@
|
|||||||
//! ## Examples
|
//! ## Examples
|
||||||
//!
|
//!
|
||||||
//! - [Watchdog simple example](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/examples/simple/examples/wdt.rs)
|
//! - [Watchdog simple example](https://egit.irs.uni-stuttgart.de/rust/va416xx-rs/src/branch/main/examples/simple/examples/wdt.rs)
|
||||||
use vorago_shared_periphs::{
|
use vorago_shared_hal::{enable_peripheral_clock, reset_peripheral_for_cycles, PeripheralSelect};
|
||||||
enable_peripheral_clock, reset_peripheral_for_cycles, PeripheralSelect,
|
|
||||||
};
|
|
||||||
|
|
||||||
use crate::time::Hertz;
|
use crate::time::Hertz;
|
||||||
use crate::{clock::Clocks, pac};
|
use crate::{clock::Clocks, pac};
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ keywords = ["no-std", "peb1", "cortex-m", "vorago", "va416xx"]
|
|||||||
categories = ["embedded", "no-std", "hardware-support"]
|
categories = ["embedded", "no-std", "hardware-support"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
va416xx-hal = { version = ">=0.3, <=0.5", path = "../va416xx-hal", features = ["va41630"] }
|
va416xx-hal = { version = "0.6", path = "../va416xx-hal", features = ["va41630"] }
|
||||||
lis2dh12 = { version = "0.7", features = ["out_f32"] }
|
lis2dh12 = { version = "0.7", features = ["out_f32"] }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
|||||||
Reference in New Issue
Block a user