This adds better type definitions for the register fields in the DW1000 register set. Currently, the Bits_xx types are used for the register fields which means the user code must use "magic numbers" to set the fields to the correct value for what the user wants to do. This is not ideal.
These new field types make the code using the DW1000 registers more readable.
For example, the previous code:
SYS_CFG_Reg.RXM110K := 1;
becomes:
SYS_CFG_Reg.RXM110K := SFD_110K;
Additionally, the System_Time types are now used directly in the relevant register types. This avoids needing to perform conversions from Bits_40 to Fine_System_Time or Coarse_System_Time and other time types. Representation clauses for these fixed-point types ('Small and 'Size) ensure that the underlying representation of these types matches the DW1000 register values.
This adds better type definitions for the register fields in the DW1000 register set. Currently, the
Bits_xx
types are used for the register fields which means the user code must use "magic numbers" to set the fields to the correct value for what the user wants to do. This is not ideal.These new field types make the code using the DW1000 registers more readable.
For example, the previous code:
becomes:
Additionally, the System_Time types are now used directly in the relevant register types. This avoids needing to perform conversions from
Bits_40
toFine_System_Time
orCoarse_System_Time
and other time types. Representation clauses for these fixed-point types ('Small and 'Size) ensure that the underlying representation of these types matches the DW1000 register values.