summaryrefslogtreecommitdiff
path: root/util/hda-decoder/decoder/lib.go
diff options
context:
space:
mode:
Diffstat (limited to 'util/hda-decoder/decoder/lib.go')
-rw-r--r--util/hda-decoder/decoder/lib.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/util/hda-decoder/decoder/lib.go b/util/hda-decoder/decoder/lib.go
index 834e83044c..445b8616f2 100644
--- a/util/hda-decoder/decoder/lib.go
+++ b/util/hda-decoder/decoder/lib.go
@@ -177,3 +177,12 @@ func ToHumanReadable(fields Fields[uint32]) Fields[string] {
Sequence: fmt.Sprintf("%d", fields.Sequence),
}
}
+
+func ConfigToVerbs(address uint32, nodeId uint32, config uint32) [4]uint32 {
+ return [4]uint32{
+ (address << 28) | (nodeId << 20) | (0x71c << 8) | ((config >> 0) & 0xff),
+ (address << 28) | (nodeId << 20) | (0x71d << 8) | ((config >> 8) & 0xff),
+ (address << 28) | (nodeId << 20) | (0x71e << 8) | ((config >> 16) & 0xff),
+ (address << 28) | (nodeId << 20) | (0x71f << 8) | ((config >> 24) & 0xff),
+ }
+}