esp32
esp32 copied to clipboard
Remove duplicate peripherals
Many of the generated (in particular the indexed ones) need to be manually derived.
This is achieved in svdpatch here
When the peripherals are copied it leaves behind the base peripheral, we should remove these.
Example:
In https://docs.rs/esp32/0.2.1/esp32/#structs for example, there is I2C0, I2C1 and I2C, the latter being the base peripherals that we derive the other two from. In this instance we should remove I2C.
I was ultimately able to remove the peripherals in question, but ran into a bit of a snag with svdtools.
When processing it begins with _deletes which means we get errors about peripherals not being found when copying registers. Moving the _delete to the final step allows our SVD to be patched successfully, but results in errors when patching the stm32-rs repository.
I will see if I can do to get svdtools working for both repositories.
Hmm, maybe we could get way with copying however many we need, and then renaming that last one, instead of deleting it?
I think some for peripherals we can probably make that work.
Where I foresee issues are with peripherals such as I2C. I2C_EXT and I2C1_EXT are renamed to I2C0 and I2C1 respectively, whereas their registers are being copied from I2C.