From 73626deeef7ce96d6651c4507914f7144ecdc23f Mon Sep 17 00:00:00 2001 From: Sebastian Holzapfel Date: Thu, 7 Dec 2023 09:47:18 +0100 Subject: [PATCH] led: add manual override switch --- gateware/eurorack_pmod.sv | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/gateware/eurorack_pmod.sv b/gateware/eurorack_pmod.sv index a7157e3..84737b0 100644 --- a/gateware/eurorack_pmod.sv +++ b/gateware/eurorack_pmod.sv @@ -62,6 +62,17 @@ module eurorack_pmod #( output [7:0] touch6, output [7:0] touch7, + // LED color values. + input [7:0] led_mode, // 1 == audio sample passthrough, 0 == manual set + input signed [7:0] led0, + input signed [7:0] led1, + input signed [7:0] led2, + input signed [7:0] led3, + input signed [7:0] led4, + input signed [7:0] led5, + input signed [7:0] led6, + input signed [7:0] led7, + // Signals used for bringup / debug / calibration. // // Raw samples from the CODEC ADCs @@ -148,14 +159,14 @@ pmod_i2c_master #( .sda_oe(i2c_sda_oe), .sda_i(i2c_sda_i), - .led0(cal_in0[W-1:W-8]), - .led1(cal_in1[W-1:W-8]), - .led2(cal_in2[W-1:W-8]), - .led3(cal_in3[W-1:W-8]), - .led4(cal_out0[W-1:W-8]), - .led5(cal_out1[W-1:W-8]), - .led6(cal_out2[W-1:W-8]), - .led7(cal_out3[W-1:W-8]), + .led0(led_mode[0] ? cal_in0[W-1:W-8] : led0), + .led1(led_mode[1] ? cal_in1[W-1:W-8] : led1), + .led2(led_mode[2] ? cal_in2[W-1:W-8] : led2), + .led3(led_mode[3] ? cal_in3[W-1:W-8] : led3), + .led4(led_mode[4] ? cal_out0[W-1:W-8] : led4), + .led5(led_mode[5] ? cal_out1[W-1:W-8] : led5), + .led6(led_mode[6] ? cal_out2[W-1:W-8] : led6), + .led7(led_mode[7] ? cal_out3[W-1:W-8] : led7), .touch0(touch0), .touch1(touch1),