I wrote this out in matrix a week ago. I've updated it to remove some inaccuracy, and am recording it here so we don't forget to fix it.
I've tested out using the Rust svdtools generated PAC - looks like we might need some changes around some registers.
Specifically, the SVD describes some fields as modifiedWriteValues: clear
from the SVD reference:
an example of one of these fields from the rp2040 reference manual
we were previously using .set_bit() on these fields, but in svd2rust this is removed for modifiedWriteValues: clear (since as far as it's concerned, any operation will clear the bit)
the accessor still has a .bit(value:bool) associated function, so we could change all of our calls on these frields from .set_bit() to .bit(true) and it should work for both old and new versions of the PAC
I feel like the SVD has probably got it wrong - at least in the case above. the write doesn't clear the bitfield. it sets the bit, and then you have to poll it until it's clear before moving on - it's a later hardware event that clears the bitfield.
I wrote this out in matrix a week ago. I've updated it to remove some inaccuracy, and am recording it here so we don't forget to fix it.
I've tested out using the Rust svdtools generated PAC - looks like we might need some changes around some registers. Specifically, the SVD describes some fields as modifiedWriteValues: clear from the SVD reference: an example of one of these fields from the rp2040 reference manual
we were previously using .set_bit() on these fields, but in svd2rust this is removed for modifiedWriteValues: clear (since as far as it's concerned, any operation will clear the bit)
the accessor still has a .bit(value:bool) associated function, so we could change all of our calls on these frields from .set_bit() to .bit(true) and it should work for both old and new versions of the PAC
I feel like the SVD has probably got it wrong - at least in the case above. the write doesn't clear the bitfield. it sets the bit, and then you have to poll it until it's clear before moving on - it's a later hardware event that clears the bitfield.