rp2040: Fix DMA not respecting transfer_size_bytes (#176)

wch-ch32v003
Grazfather 7 months ago committed by GitHub
parent 5742d0e4b3
commit a7ff8ed32b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -107,7 +107,12 @@ pub const Channel = enum(u4) {
regs.ctrl_trig.modify(.{ regs.ctrl_trig.modify(.{
.EN = @intFromBool(config.enable), .EN = @intFromBool(config.enable),
.DATA_SIZE = .{ .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_READ = @intFromBool(config.read_increment),
.INCR_WRITE = @intFromBool(config.write_increment), .INCR_WRITE = @intFromBool(config.write_increment),

Loading…
Cancel
Save