访问ESP32的寄存器和ESP-IDF-SYS
我正在尝试将 OV2640 相机与 ESP32(TTGo 模块)和 Rust 一起使用。不幸的是,目前还没有司机。所以,我开始创建一个。经过一番挖掘,在我看来,可用于读取相机图像的 I2S 模块没有来自 esp-idf 库的针对此用例的匹配功能支持。为了配置外设,我需要手动写入一些寄存器值。对于 C,您可以轻松找到相关示例,例如在 espressive 的 esp32-camera 库中(请参阅 ll_cam.c,第 256ff 行。)
不幸的是,在查看 esp-idf-sys 和-hal 文档和示例,我找不到任何示例或提示如何做到这一点。到目前为止,在互联网上搜索也没有找到任何有用的信息。
也许是太明显了... 有人可以给我提示在哪里查看或如何执行此操作吗?
I am trying to use a OV2640 camera together with ESP32 (TTGo module) and rust. Unfortunately, there is no driver, yet. So, I started to create one. After some digging it seems to me that the I2S module that can be used for camera image read out, has no matching function support from the esp-idf library for this use case. To configure the peripheral, I need to write some register values by hand. For C you can easily find examples for this, e.g. in the esp32-camera library from espressive (see ll_cam.c, line 256ff.)
Unfortunately, after looking at the esp-idf-sys and -hal documentation and examples, I could not find any examples or hints how to do that. Also searching on the interwebs didn't bring up anything useful until now.
Maybe it is too obvious...
Can someone give me a hint where to look at or how to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这并不容易,但是您可以使用
asm!
在Rust 1.59+中访问寄存器。您将需要弄清每个值都绑定到哪个特定寄存器。我不熟悉RISCV32,因此这可能是或可能不是实际登记册。老实说,我不确定它是否真的在更改任何CPU寄存器。似乎基于此标题我发现它可能只是为SPI(或类似)接口配置了一些数据。
It won't be easy, but you can access registers in Rust 1.59+ using
asm!
. You will need to figure out which specific registers each value is bound to. I'm not familiar with Riscv32 so this may or may not be an actual register.Though to be honest, I'm not sure if it is actually changing any CPU registers. It seems likely based on this header I found that it may just be configuring some data for an SPI (or similar) interface.