Open MabezDev opened 5 months ago
Maybe we could even avoid those functions and use something like https://crates.io/crates/tock-registers
But I think such code originates from 1:1 translation of esp-idf code - but once such code is known working, we could improve it
Maybe I'm missing something, but why are we going to all this effort instead of just fixing the PACs?
Maybe I'm missing something, but why are we going to all this effort instead of just fixing the PACs?
That would certainly be the best solution for registers! I somehow thought of I2C_BBPLL which we also deal with in those places
Good idea! Let's do that instead, I've updated the title.
I don't think I will be able to do this any time soon unfortunately, but if somebody else wants to tackle it I can at least explain what needs to be done to them, so just lemme know. If nobody has tackled this in a month or two when I wrap up my currently projects then I will take care of it at that point.
Just to have some part of an investigation here:
Most of the cases of manipulations with raw register addresses are related to regi2c_*
functions, which has a tracking issue here https://github.com/esp-rs/esp-hal/issues/1740. Which means that this issue highly depends on it. At this point, I think, I will temporarily switch to analyzing regi2c_*
functions.
We currently have duplicates of these reg functions where the svd's don't have enough info, and we have to resort back to raw register writes. E.g: https://github.com/search?q=repo%3Aesp-rs%2Fesp-hal%20reg_set&type=code.
We should cleanup and modularise their usage/definitions across our chip line-up.
cc: @playfulFence who initially noticed the issue.
Edit by @playfulFence: Steps to resolve that issue (might be updated later):
clocks_ll
for multiple targets, usingregi2c_*
functionstrng
for multiple targets, usingregi2c_*
functions