diff --git a/board-support/raspberrypi-rp2040/src/hal/dma.zig b/board-support/raspberrypi-rp2040/src/hal/dma.zig index fcbc3d8..b7f9629 100644 --- a/board-support/raspberrypi-rp2040/src/hal/dma.zig +++ b/board-support/raspberrypi-rp2040/src/hal/dma.zig @@ -107,7 +107,12 @@ pub const Channel = enum(u4) { regs.ctrl_trig.modify(.{ .EN = @intFromBool(config.enable), .DATA_SIZE = .{ - .value = .SIZE_BYTE, + .value = switch (config.transfer_size_bytes) { + 1 => @TypeOf(regs.ctrl_trig.read().DATA_SIZE.value).SIZE_BYTE, + 2 => .SIZE_HALFWORD, + 4 => .SIZE_WORD, + else => unreachable, + }, }, .INCR_READ = @intFromBool(config.read_increment), .INCR_WRITE = @intFromBool(config.write_increment),