I found some "discontinuous field" when I make timer_v2.
eg.
MMS of TIMx_CR2 from Page1567 of Section38 AdvTim of H573 RM0481;
TS of TIMx_SMCR from the same page.
#[doc = "Output compare y mode"]
#[inline(always)]
pub const fn ocm(&self, n: usize) -> super::vals::Ocm {
assert!(n < 1usize);
let mut val = 0;
let offs = 4usize + n * 8usize;
val += (((self.0 >> offs) & 0x07) << 0usize);
let offs = 16usize + n * 8usize;
val += (((self.0 >> offs) & 0x01) << 3usize);
super::vals::Ocm::from_bits(val as u8)
}
#[doc = "Output compare y mode"]
#[inline(always)]
pub fn set_ocm(&mut self, n: usize, val: super::vals::Ocm) {
assert!(n < 1usize);
let offs = 4usize + n * 8usize;
self.0 = (self.0 & !(0x07 << offs)) | (((val.to_bits() as u32 >> 0usize) & 0x07) << offs);
let offs = 16usize + n * 8usize;
self.0 = (self.0 & !(0x01 << offs)) | (((val.to_bits() as u32 >> 3usize) & 0x01) << offs);
}
I didn't touch the output of regular bit_offset (though regluar bit_offset can also be write as 1-range bit_offset), I think we should keep as simple as possible, since access registers can be "hot paths".
I found some "discontinuous field" when I make timer_v2. eg.
MMS
ofTIMx_CR2
from Page1567 of Section38 AdvTim of H573 RM0481;TS
ofTIMx_SMCR
from the same page.I try add support for this situation.
yaml file will support
new syntax, and chiptool do properly check when parse source file.
It will generate PAC like this:
And for fields array:
it will generate:
I didn't touch the output of regular bit_offset (though regluar bit_offset can also be write as 1-range bit_offset), I think we should keep as simple as possible, since access registers can be "hot paths".