aboutsummaryrefslogtreecommitdiff
path: root/tests/rp
diff options
context:
space:
mode:
authorkalkyl <[email protected]>2024-06-05 09:42:08 +0200
committerkalkyl <[email protected]>2024-06-05 09:42:08 +0200
commitbf36bec9bb85caea613687ab9e0c1652f414b95c (patch)
tree80a8f818648742dabff97fd2c27053e7211e1077 /tests/rp
parent5f9bc6def7ea8698a6ce45d8e12e1d1bd8cce876 (diff)
rp: Add multichannel ADC
Diffstat (limited to 'tests/rp')
-rw-r--r--tests/rp/src/bin/adc.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/rp/src/bin/adc.rs b/tests/rp/src/bin/adc.rs
index 29eda95bf..0f13e626f 100644
--- a/tests/rp/src/bin/adc.rs
+++ b/tests/rp/src/bin/adc.rs
@@ -130,6 +130,19 @@ async fn main(_spawner: Spawner) {
130 defmt::assert!(temp.iter().all(|t| *t > 0.0)); 130 defmt::assert!(temp.iter().all(|t| *t > 0.0));
131 defmt::assert!(temp.iter().all(|t| *t < 60.0)); 131 defmt::assert!(temp.iter().all(|t| *t < 60.0));
132 } 132 }
133 {
134 let mut multi = [0u16; 2];
135 let mut channels = [
136 Channel::new_pin(&mut p.PIN_29, Pull::Up),
137 Channel::new_temp_sensor(&mut p.ADC_TEMP_SENSOR),
138 ];
139 adc.read_many_multichannel(&mut channels, &mut multi, 1, &mut p.DMA_CH0)
140 .await
141 .unwrap();
142 defmt::assert!(multi[0] > 3_000);
143 let temp = convert_to_celsius(multi[1]);
144 defmt::assert!(temp > 0.0 && temp < 60.0);
145 }
133 146
134 info!("Test OK"); 147 info!("Test OK");
135 cortex_m::asm::bkpt(); 148 cortex_m::asm::bkpt();