Skip to content

ADC pac ext, unmacro Adc #530

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Changed

- `Adc::new` instead of `Adc::adcX` and `AdcExt` trait
- Update `bxcan`, `heapless`, `mfrc522`, reenable `mpu9250` example [#513]
- PWM timer auto reload value is now preloaded/buffered [#453]
- Move from bors/manual merge to GH merge queue [#467]
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ features = ["stm32f103", "rtic", "high"]
default-target = "x86_64-unknown-linux-gnu"

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

[dependencies.stm32f1]
package = "stm32f1-staging"
version = "0.19.0"
version = "0.20.0"
features = ["atomics"]

[dependencies.embedded-hal-02]
Expand All @@ -58,7 +58,7 @@ version = "0.7.0"
optional = true

[dev-dependencies]
panic-halt = "0.2.0"
panic-halt = "1.0.0"
panic-semihosting = "0.6.0"
panic-itm = "0.4.2"
cortex-m-rtic = "1.1.3"
Expand Down
2 changes: 1 addition & 1 deletion examples/adc-dma-circ.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn main() -> ! {
let dma_ch1 = p.DMA1.split().1;

// Setup ADC
let adc1 = adc::Adc::adc1(p.ADC1, &clocks);
let adc1 = adc::Adc::new(p.ADC1, &clocks);

// Setup GPIOA
let mut gpioa = p.GPIOA.split();
Expand Down
2 changes: 1 addition & 1 deletion examples/adc-dma-rx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn main() -> ! {
let dma_ch1 = p.DMA1.split().1;

// Setup ADC
let adc1 = adc::Adc::adc1(p.ADC1, &clocks);
let adc1 = adc::Adc::new(p.ADC1, &clocks);

// Setup GPIOA
let mut gpioa = p.GPIOA.split();
Expand Down
4 changes: 2 additions & 2 deletions examples/adc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ fn main() -> ! {
hprintln!("adc freq: {}", clocks.adcclk());

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

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

// Setup GPIOB
let mut gpiob = p.GPIOB.split();
Expand Down
4 changes: 2 additions & 2 deletions examples/adc_temperature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use panic_semihosting as _;

use cortex_m_rt::entry;
use stm32f1xx_hal::{adc, pac, prelude::*};
use stm32f1xx_hal::{pac, prelude::*};

use cortex_m_semihosting::hprintln;

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

// Setup ADC
let mut adc = adc::Adc::adc1(p.ADC1, &clocks);
let mut adc = p.ADC1.adc(&clocks);

// Read temperature sensor
loop {
Expand Down
Loading
Loading