There is some type-level trickery in Rust HALs that capture this sort of thing, but it still requires a lot of work by the HAL designer. Someone is going to have to encode the rules. It would be great if the hardware designers could do that formally instead of datasheet prose.