Closed kossnikita closed 8 months ago
Try to run svd2rust --const_generic
. It should generate ArrayProxy
so you can access with cdt[1]
.
Although this is low tested.
Yes, I already checked this flag. It didn't have any impact. Literally. It didn't change anything.
If I understand correctly, this only affects fields and clusters.
Oops. I found what this does. This adds struct ArrayProxy
in generics.rs
. But this still does not allow registers to be called as an array.
I think the problem is your indexes don't start from 0: https://github.com/rust-embedded/svd2rust/blob/460ea2ecbc5306085a019a3291f7aab38aeae74c/src/generate/peripheral.rs#L1116
Try to replace sequential_indexes_from0
with just sequential_indexes
to remove zero restriction.
It's about clusters. Should I convert my array to a cluster?
Same behavior
let sequential_indexes = array_info
.indexes_as_range()
.is_some();
Could you upload complete SVD somewhere?
660
Is it possible to add an unsafe method that returns a register from an array? For compatibility with similar syntax for continuous arrays.
In my case the registers are separated due to their size. And I can't use them with indexes anymore.
I'd like to see something like this