Skip to content

Add initial ADC/GPIO implementation for ESP32-H2 #494

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 2 commits into from
Apr 27, 2023

Conversation

jessebraham
Copy link
Member

@jessebraham jessebraham commented Apr 26, 2023

@SergioGasquez was able to test and verify the example on hardware for me. Still need the AF signals and what not, but gives us a base to build off of at least.

(A passing CI run can be found here)

Copy link
Contributor

@bjoernQ bjoernQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me! Cannot verify it on hardware currently

@bjoernQ
Copy link
Contributor

bjoernQ commented Apr 26, 2023

#[cfg_attr(not(any(esp32, riscv)), path = "adc/xtensa.rs")] made me think twice about what's happening here ... while it's certainly correct the previous version was easier to understand (given there won't be more Xtensas in future)

This adds ADC but not the adc-example? Not a problem - just curious

@JurajSadel
Copy link
Contributor

JurajSadel commented Apr 26, 2023

I'll verify on real HW tomorrow (I don't have H2 with me at the moment :D )

@jessebraham jessebraham force-pushed the feature/esp32h2-gpio branch from 9311f58 to 9dab674 Compare April 26, 2023 16:34
@jessebraham
Copy link
Member Author

@bjoernQ fair enough, that's been reverted. Not sure why I changed it in the first place TBH 🤷🏻‍♂️

ADC stuff is just sort of intermingled with the GPIO stuff, so I included those bits. Didn't test or anything, guess I could remove it but I think it's fine to include for now.

Copy link
Contributor

@JurajSadel JurajSadel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, both examples (hello_world and blinky) work on real H2 chip correctly.
We have some warnings

warning: unused variable: `system`
   --> /home/ubuntu/esp-hal/esp-hal-common/src/system.rs:502:13
    |
502 |         let system = unsafe { &*SystemPeripheral::PTR };
    |             ^^^^^^ help: if this is intentional, prefix it with an underscore: `_system`
    |
    = note: `#[warn(unused_variables)]` on by default

warning: unused variable: `peripheral`
   --> /home/ubuntu/esp-hal/esp-hal-common/src/system.rs:501:30
    |
501 |     pub fn enable(&mut self, peripheral: Peripheral) {
    |                              ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_peripheral`

warning: `esp-hal-common` (lib) generated 2 warnings (run `cargo fix --lib -p esp-hal-common` to apply 2 suggestions)
warning: unused variable: `clocks`
  --> examples/hello_world.rs:17:9
   |
17 |     let clocks = ClockControl::configure(system.clock_control, CpuClock::Clock96MHz).freeze();
   |         ^^^^^^ help: if this is intentional, prefix it with an underscore: `_clocks`

but I guess we will clear them along the way.

Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Can't test, but the code looks fine to me.

@jessebraham jessebraham merged commit e2323de into esp-rs:feature/esp32h2 Apr 27, 2023
@jessebraham jessebraham deleted the feature/esp32h2-gpio branch April 27, 2023 12:17
playfulFence pushed a commit to playfulFence/esp-hal that referenced this pull request May 3, 2023
* Add `esp32h2-hal` package to the VS Code workspace and CI workflow

* Add initial (not quite complete) implementation of GPIO/ADC for ESP32-H2
jessebraham added a commit to jessebraham/esp-hal that referenced this pull request May 5, 2023
* Add `esp32h2-hal` package to the VS Code workspace and CI workflow

* Add initial (not quite complete) implementation of GPIO/ADC for ESP32-H2
jessebraham added a commit to jessebraham/esp-hal that referenced this pull request May 8, 2023
* Add `esp32h2-hal` package to the VS Code workspace and CI workflow

* Add initial (not quite complete) implementation of GPIO/ADC for ESP32-H2
i404788 pushed a commit to i404788/esp-hal that referenced this pull request Jul 22, 2023
* Add `esp32h2-hal` package to the VS Code workspace and CI workflow

* Add initial (not quite complete) implementation of GPIO/ADC for ESP32-H2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants