1.1 --- a/pkg/devices/lib/cpm/include/cpm-common.h Wed Apr 24 00:47:34 2024 +0200
1.2 +++ b/pkg/devices/lib/cpm/include/cpm-common.h Sat Apr 27 23:46:28 2024 +0200
1.3 @@ -64,6 +64,7 @@
1.4 uint8_t bit;
1.5 bool defined;
1.6 uint32_t adjustment;
1.7 + const int *table = NULL;
1.8 uint32_t _asserted = 0, _deasserted = 0;
1.9
1.10 public:
1.11 @@ -72,6 +73,16 @@
1.12 {
1.13 }
1.14
1.15 + // Field with table describing the encoded value.
1.16 +
1.17 + explicit Field(uint32_t reg, uint32_t mask, uint32_t bit, const int *table)
1.18 + : reg(reg), mask(mask), bit(bit), defined(true), table(table)
1.19 + {
1.20 + _asserted = mask;
1.21 + }
1.22 +
1.23 + // Field with possible inversion and encoded value adjustment.
1.24 +
1.25 explicit Field(uint32_t reg, uint32_t mask, uint32_t bit,
1.26 bool inverted = false, uint32_t adjustment = 0)
1.27 : reg(reg), mask(mask), bit(bit), defined(true), adjustment(adjustment)