rp: add single-channel dma from adc
with uniform treatment of adc inputs it's easy enough to add a new sampling method. dma sampling only supports one channel at the moment, though round-robin sampling would be a simple extension (probably a new trait that's implemented for Channel and &[Channel]). continuous dma as proposed in #1608 also isn't done here, we'd expect that to be a compound dma::Channel that internally splits a buffer in half and dispatches callbacks or something like that.
This commit is contained in:
@ -25,7 +25,7 @@ async fn main(_spawner: Spawner) {
|
||||
let mut p26 = Channel::new_pin(p.PIN_26, Pull::None);
|
||||
let mut p27 = Channel::new_pin(p.PIN_27, Pull::None);
|
||||
let mut p28 = Channel::new_pin(p.PIN_28, Pull::None);
|
||||
let mut ts = Channel::new_sensor(p.ADC_TEMP_SENSOR);
|
||||
let mut ts = Channel::new_temp_sensor(p.ADC_TEMP_SENSOR);
|
||||
|
||||
loop {
|
||||
let level = adc.read(&mut p26).await.unwrap();
|
||||
|
Reference in New Issue
Block a user