diff --git a/firmware/drivers/audio/df1704.c b/firmware/drivers/audio/df1704.c index b0b9d7b1d3..ec8d56b955 100644 --- a/firmware/drivers/audio/df1704.c +++ b/firmware/drivers/audio/df1704.c @@ -113,3 +113,17 @@ void audiohw_set_volume(int vol_l, int vol_r) df1704_write_reg(DF1704_MODE(0), DF1704_LDL_ON|vol_tenthdb2hw(vol_l)); df1704_write_reg(DF1704_MODE(1), DF1704_LDR_ON|vol_tenthdb2hw(vol_r)); } + +void audiohw_set_filter_roll_off(int value) +{ + int mode3_val = DF1704_CKO_HALF | + DF1704_LRP_H | + DF1704_I2S_ON; + + if (value == 0) { + mode3_val |= DF1704_SRO_SHARP; + } else { + mode3_val |= DF1704_SRO_SLOW; + } + df1704_write_reg(DF1704_MODE(3), mode3_val); +} diff --git a/firmware/export/df1704.h b/firmware/export/df1704.h index 59d1372477..4a0bdfd8ba 100644 --- a/firmware/export/df1704.h +++ b/firmware/export/df1704.h @@ -26,7 +26,9 @@ #define DF1704_VOLUME_MIN -1270 #define DF1704_VOLUME_MAX 0 +#define AUDIOHW_CAPS (FILTER_ROLL_OFF_CAP) AUDIOHW_SETTING(VOLUME, "dB", 0, 1, DF1704_VOLUME_MIN/10, DF1704_VOLUME_MAX/10, 0) +AUDIOHW_SETTING(FILTER_ROLL_OFF, "", 0, 1, 0, 1, 0) #define DF1704_MODE(x) (((x)&0x03)<<9)