Comments (8)
Interesting idea about having InputSignal
/ OutputSignal
in the SVD - haven't thought about that. Mid-term / long-term it would be definitely good to have that. I think we also need to be able to handle those things in svd-tools (especially svd-patch) - haven't seen that supported there but I might be wrong.
Do you already have a plan for the InputSignal/OutputSignal issue which I guess will affect many peripherals?
For now, my simple solution for that is to move them into the common-hal and include them conditionally based on the selected chip.
Should be a good first step since things won't change that much if we get them from the PAC in future. Also, this way we can prepare the next steps (defining them in the SVD and having them in the PAC) without the need to rush that
from esp-hal.
I started experimenting with a shared I2C implementation: https://github.com/ducktec/esp-hal/tree/feature/i2c.
For the ESP32-C3, the implemented example (driving a SSD1306 I2C display) works already. For the ESP32 the example at least builds, but does not work yet. I suspect that is because I'm relying on the I2C DATA
register in the SVD that does not really exist (espressif/svd#19). S2 and S3 probably don't even build (but are already considered in the shared implementation).
An aspect that I found a bit annoying was that the peripheral's InputSignal
and OutputSignal
definitions are not part of the PACs, but only available in the individual HAL crates and thus cannot be used with #[cfg]
attributes in esp-hal-common
. In order to avoid duplicate code in the chip-specific crates, so far I tried working around this with macros. These are then used in the chip-specific HAL crates, but that is taking it's toll on simplicity and readability (and does not yet work for > 1 I2C instance). So, not happy with that solution yet.
I will continue with the implementation, but I'm a bit time-restricted to work on this, thus it might take a while. So, if anybody wants to fast-track this, maybe some pieces of my work can help. 🙂
from esp-hal.
Glad to hear you're interested in the project, thanks for working on this!
I had previously taken a stab at the I2C
driver (based heavily on yours from esp32c3-hal
) however did not get it to the point of working, so I'm happy to hear you've made it at least a bit further. I also ran into the InputSignal
/OutputSignal
issue during my attempt; not entirely sure how to address this, but we need to do something. As we implement additional peripheral drivers this problem is only going to compound.
There is no rush at all, so please take your time!
from esp-hal.
@ducktec Thanks for your efforts! I can continue to work on it based on your work - I already cherry-picked your commit and can continue to work on it - I'm sure there will be enough to do once you have more time again or you can pick up my changes if I make progress but don't finish it until you get to it again
from esp-hal.
Alright, then I'll look into another peripheral once I have some more time (mostly weekends). Just let me know if I can be of help with the I2C peripheral.
Do you already have a plan for the InputSignal
/OutputSignal
issue which I guess will affect many peripherals?
I already looked into ways to get this information into the SVDs and thus PACs:
- For the
OutputSignal
this would be pretty easy: the values could be added asenumeratedValue
to theOUT_SEL
field in theFUNC%s_OUT_SEL_CFG
register. Providing them there would yield in a nice enumgpio::func_out_sel_cfg::OUT_SEL_A
with the mapping. - For the
InputSignal
the situation is more complicated as the signals map to registers instead of field values. There is an element in the SVD specification > 1.3.1 that seems like a perfect fit:dimArrayIndex
. But issue here, this element seems to be completely ignored bysvd2rust
so far. I can look into the necessary changes forsvd2rust
if there's no better idea though.
from esp-hal.
I'm generally the one responsible for SVD-related things, and I think I should be able to add these enumerated values. If @bjoernQ doesn't have a different idea then I can take care of the required SVD updates, although as you stated we would likely need to update svd2rust
.
from esp-hal.
I2C
support for all devices was added in #23.
from esp-hal.
Actually I'm just going to close this issue in favour of #19.
from esp-hal.
Related Issues (20)
- Bugs in FlashSafeDma<SpiDma> HOT 3
- Question about trait `CreateErasedPin` being `#[doc(hidden)]` HOT 2
- Explore using cargo semver checks HOT 1
- Example wifi_embassy_dhcp not working HOT 5
- release `esp-backtrace` HOT 3
- Flash is not erased when HIL tests fail
- `usb_serial_jtag` example freezes when pressing a key HOT 5
- esp-wifi 0.7 does not compile with embedded-svc feature HOT 7
- Pretty printing panic messages on nightly broken
- ESP32 PSRAM duplicate branch HOT 1
- Expose SPI sio() setting HOT 2
- Expose interrupt state of Pin when wrapped in Input<> HOT 2
- There is currently no way to configure WDT to do anything but a system reset
- I2S write broken HOT 4
- Explore Rustls and create an example
- Caught in I2C busy loop HOT 1
- Async PARL_IO is using the wrong DMA future
- Ensure espflash is installed on all runners HOT 1
- Improving the logging performance of `esp-println` with async TX HOT 1
- Halting both cores makes `espflash` fail to reset the board with the USB-Serial-JTAG HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp-hal.