tests/stm32: add L1 DAC/ADC test.
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
// required-features: dac-adc-pin
|
||||
// required-features: dac
|
||||
|
||||
#[path = "../common.rs"]
|
||||
mod common;
|
||||
@ -22,12 +22,13 @@ async fn main(_spawner: Spawner) {
|
||||
// Initialize the board and obtain a Peripherals instance
|
||||
let p: embassy_stm32::Peripherals = embassy_stm32::init(config());
|
||||
|
||||
let adc = peri!(p, ADC);
|
||||
let dac = peri!(p, DAC);
|
||||
let dac_pin = peri!(p, DAC_PIN);
|
||||
let mut adc_pin = unsafe { core::ptr::read(&dac_pin) };
|
||||
|
||||
let mut dac = DacCh1::new(dac, NoDma, dac_pin);
|
||||
let mut adc = Adc::new(p.ADC1, &mut Delay);
|
||||
let mut adc = Adc::new(adc, &mut Delay);
|
||||
|
||||
#[cfg(feature = "stm32h755zi")]
|
||||
let normalization_factor = 256;
|
||||
|
Reference in New Issue
Block a user