-
Notifications
You must be signed in to change notification settings - Fork 208
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
Add I2S Camera mode driver #1646
Conversation
Part of #1475 |
8032725
to
fe47795
Compare
Anyone using this driver will almost certainly want to setup a separate clock signal with the LEDC driver. Should this be included in the example in the doc of the driver? @MabezDev are you able to run the example? |
@Dominaezzz Thanks for the PR! I'm trying to run the example on the TTGO-Camera board I have here, but without success so far. I've changed the required pins for this board, and I can communicate with camera, but the read back data is garbage.
Any suggestions on debugging this? |
What are the first 10 bytes that come out? I'm hoping the stream at least starts as a valid JPEG.
Sadly I don't have a good answer (besides pulling out a logic analyser). In my experience with I2S camera mode, it tends to return garbage for the first image (or sometimes it's several images). I will just change the example to skip the first 10 images. i.e. Wait for the vsync pin to toggle 10 times. |
@MabezDev I've updated the example to skip the first 10 images. You should be able to reliably get an image every time you run the example now. Also I've use the experimental coroutines feature for the example, I hope this is okay. Side note: |
I don't know why this PR failed. I need to capture raw data via I2S camera mode of ESP32-S2, and now I have to do it in ESP-IDF. However, this code helps me understand how to drive it (ESP32-S2 I2S registers differ from that of ESP32, though), because I'm not using any camera supported by |
Was tired of rebasing at the time, I was juggling 4 to 5 PRs at a time and closed this to reduce my workload. I also wasn't 100% happy with how the API came out tbh. Wasn't a big fan of the "different mode in a separate driver" idea here. Feel free to resurrect the PR with my commits if you like, I currently don't have the motivation not personal need to drive this to the finish line. The DMA APIs themselves need a bit of improving before this driver can shine imo and that's where I'm at. Btw I strongly recommend using the ESP32-S3 for cameras. Much better hardware than the S2 and base ESP32.
Are you actually using Rust? And what devkit are you playing around with? |
Thank you for your contribution!
We appreciate the time and effort you've put into this pull request.
To help us review it efficiently, please ensure you've gone through the following checklist:
Submission Checklist 📝
cargo xtask fmt-packages
command to ensure that all changed code is formatted correctly.CHANGELOG.md
in the proper section.Extra:
Pull Request Details 📖
Description
Adds a driver for I2S Camera mode on the ESP32 only. (ESP32-S2 to come in a future PR)
Testing
Ran the example on a MaTouch_ESP32 3.2" TFT Touch with Camera.