Big dependency updates (#7)
Co-authored-by: Zachary Sunforge <zachary.sunforge@bfpower.io> Reviewed-on: #7
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
#![feature(type_alias_impl_trait, async_fn_in_trait)]
|
||||
|
||||
use core::cell::Cell;
|
||||
use cortex_m::prelude::_embedded_hal_blocking_delay_DelayUs;
|
||||
@ -26,8 +25,8 @@ use uom::si::electric_potential::volt;
|
||||
use uom::si::f32;
|
||||
|
||||
use defmt::{debug, error, info, trace, unwrap};
|
||||
use embassy_executor::_export::StaticCell;
|
||||
use embassy_stm32::peripherals::{PF6, PF7, SPI3};
|
||||
use static_cell::StaticCell;
|
||||
use embassy_stm32::peripherals::{PA1, PA3, SPI1};
|
||||
use embassy_sync::blocking_mutex::raw::NoopRawMutex;
|
||||
use embassy_sync::pubsub::PubSubChannel;
|
||||
use physical_node::transducer::{Publish, StatefulPublisher};
|
||||
@ -61,8 +60,8 @@ struct Inputs {
|
||||
|
||||
// Inputs
|
||||
static ANALOG_INPUTS: StaticCell<Inputs> = StaticCell::new();
|
||||
static ADS_1256: StaticCell<Ads1256<Ads1256Delay, Output<PF7>, ExtiInput<PF6>>> = StaticCell::new();
|
||||
static SPI: StaticCell<Spi<SPI3, NoDma, NoDma>> = StaticCell::new();
|
||||
static ADS_1256: StaticCell<Ads1256<Ads1256Delay, Output<PA1>, ExtiInput<PA3>>> = StaticCell::new();
|
||||
static SPI: StaticCell<Spi<SPI1, NoDma, NoDma>> = StaticCell::new();
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(spawner: Spawner) {
|
||||
@ -79,18 +78,18 @@ async fn main(spawner: Spawner) {
|
||||
let mut spi_conf = spi::Config::default();
|
||||
spi_conf.mode = spi::MODE_1;
|
||||
spi_conf.bit_order = spi::BitOrder::MsbFirst;
|
||||
spi_conf.frequency = Hertz(ads1256::defaults::SPI_CLK_HZ);
|
||||
|
||||
let ads1256_data_ready = ExtiInput::new(Input::new(p.PF6, Pull::Up), p.EXTI6);
|
||||
let select_ads1256 = Output::new(p.PF7, Level::High, Speed::VeryHigh);
|
||||
let ads1256_data_ready = ExtiInput::new(Input::new(p.PA3, Pull::Up), p.EXTI3);
|
||||
let select_ads1256 = Output::new(p.PA1, Level::High, Speed::VeryHigh);
|
||||
|
||||
let spi = SPI.init(Spi::new(
|
||||
p.SPI3,
|
||||
p.PC10,
|
||||
p.PC12,
|
||||
p.PC11,
|
||||
p.SPI1,
|
||||
p.PA5,
|
||||
p.PA7,
|
||||
p.PA6,
|
||||
NoDma,
|
||||
NoDma,
|
||||
Hertz(ads1256::defaults::SPI_CLK_HZ),
|
||||
spi_conf,
|
||||
));
|
||||
|
||||
@ -120,8 +119,8 @@ async fn main(spawner: Spawner) {
|
||||
|
||||
#[embassy_executor::task]
|
||||
async fn drive_inputs_task(
|
||||
ads_1256: &'static mut Ads1256<Ads1256Delay, Output<'static, PF7>, ExtiInput<'static, PF6>>,
|
||||
spi: &'static mut Spi<'static, SPI3, NoDma, NoDma>,
|
||||
ads_1256: &'static mut Ads1256<Ads1256Delay, Output<'static, PA1>, ExtiInput<'static, PA3>>,
|
||||
spi: &'static mut Spi<'static, SPI1, NoDma, NoDma>,
|
||||
inputs: &'static Inputs,
|
||||
) {
|
||||
let Inputs { ai0, ai1, ai2 } = inputs;
|
||||
|
Reference in New Issue
Block a user