cyanobyte
cyanobyte copied to clipboard
startBit, endBit, and bits
This issue is for the discussion on startBit, endBit, and bits as it keeps coming up. The key questions to answer are:
- Should the ordering of startBit and endBit matter? Should we enforce that
startBit > endBitor the other way around? Should we support both options? https://github.com/google/cyanobyte/pull/38/files#r271088948 - If
startBit == endBit, should we add the option to usebit? #56
Using the phrase "start" and "end" could be conflated in some environments, so it may be a good idea to see if it's possible to handle either direction. Additionally, we don't have a good way to enforce this at the specification level through a schema file.
I do like the simplification of bit to indicate a single-bit field.
On https://arm-software.github.io/CMSIS_5/SVD/html/elem_registers.html, under the topic /device/peripherals/peripheral/registers/.../fields/field element, CMSIS has several styles:
-
bitOffset(LSB) andbitWidth -
lsbandmsb -
bitRange- A string in the format "[: ]"