Skip to content

Commit e9a10d7

Browse files
authored
Merge pull request #530 from stm32-rs/adcc
ADC pac ext, unmacro Adc
2 parents f8944d1 + 83cfd21 commit e9a10d7

File tree

15 files changed

+742
-389
lines changed

15 files changed

+742
-389
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2222

2323
### Changed
2424

25+
- `Adc::new` instead of `Adc::adcX` and `AdcExt` trait
2526
- Update `bxcan`, `heapless`, `mfrc522`, reenable `mpu9250` example [#513]
2627
- PWM timer auto reload value is now preloaded/buffered [#453]
2728
- Move from bors/manual merge to GH merge queue [#467]

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ features = ["stm32f103", "rtic", "high"]
2121
default-target = "x86_64-unknown-linux-gnu"
2222

2323
[dependencies]
24-
defmt = { version = "0.3.8", optional = true }
24+
defmt = { version = "1.0", optional = true }
2525
cortex-m = { version = "0.7.7", features = ["critical-section-single-core"] }
2626
cortex-m-rt = "0.7.3"
2727
nb = "1.1"
@@ -36,7 +36,7 @@ vcell = "0.1.3"
3636

3737
[dependencies.stm32f1]
3838
package = "stm32f1-staging"
39-
version = "0.19.0"
39+
version = "0.20.0"
4040
features = ["atomics"]
4141

4242
[dependencies.embedded-hal-02]
@@ -58,7 +58,7 @@ version = "0.7.0"
5858
optional = true
5959

6060
[dev-dependencies]
61-
panic-halt = "0.2.0"
61+
panic-halt = "1.0.0"
6262
panic-semihosting = "0.6.0"
6363
panic-itm = "0.4.2"
6464
cortex-m-rtic = "1.1.3"

examples/adc-dma-circ.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fn main() -> ! {
2828
let dma_ch1 = p.DMA1.split().1;
2929

3030
// Setup ADC
31-
let adc1 = adc::Adc::adc1(p.ADC1, &clocks);
31+
let adc1 = adc::Adc::new(p.ADC1, &clocks);
3232

3333
// Setup GPIOA
3434
let mut gpioa = p.GPIOA.split();

examples/adc-dma-rx.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fn main() -> ! {
2828
let dma_ch1 = p.DMA1.split().1;
2929

3030
// Setup ADC
31-
let adc1 = adc::Adc::adc1(p.ADC1, &clocks);
31+
let adc1 = adc::Adc::new(p.ADC1, &clocks);
3232

3333
// Setup GPIOA
3434
let mut gpioa = p.GPIOA.split();

examples/adc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ fn main() -> ! {
2525
hprintln!("adc freq: {}", clocks.adcclk());
2626

2727
// Setup ADC
28-
let mut adc1 = adc::Adc::adc1(p.ADC1, &clocks);
28+
let mut adc1 = adc::Adc::new(p.ADC1, &clocks);
2929

3030
#[cfg(any(feature = "stm32f103", feature = "connectivity"))]
31-
let mut adc2 = adc::Adc::adc2(p.ADC2, &clocks);
31+
let mut adc2 = adc::Adc::new(p.ADC2, &clocks);
3232

3333
// Setup GPIOB
3434
let mut gpiob = p.GPIOB.split();

examples/adc_temperature.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use panic_semihosting as _;
66

77
use cortex_m_rt::entry;
8-
use stm32f1xx_hal::{adc, pac, prelude::*};
8+
use stm32f1xx_hal::{pac, prelude::*};
99

1010
use cortex_m_semihosting::hprintln;
1111

@@ -38,7 +38,7 @@ fn main() -> ! {
3838
hprintln!("adc freq: {}", clocks.adcclk());
3939

4040
// Setup ADC
41-
let mut adc = adc::Adc::adc1(p.ADC1, &clocks);
41+
let mut adc = p.ADC1.adc(&clocks);
4242

4343
// Read temperature sensor
4444
loop {

0 commit comments

Comments
 (0)