summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/audiohw.h35
-rw-r--r--firmware/export/mas35xx.h2
-rw-r--r--firmware/export/uda1380.h4
-rw-r--r--firmware/export/wm8758.h4
-rw-r--r--firmware/export/wm8975.h4
-rw-r--r--firmware/export/wm8985.h4
6 files changed, 45 insertions, 8 deletions
diff --git a/firmware/export/audiohw.h b/firmware/export/audiohw.h
index b3493b86d9..d450613aff 100644
--- a/firmware/export/audiohw.h
+++ b/firmware/export/audiohw.h
@@ -23,6 +23,10 @@
23#include "config.h" 23#include "config.h"
24#include <stdbool.h> 24#include <stdbool.h>
25 25
26/* define some audiohw caps */
27#define TREBLE_CAP (1 << 0)
28#define BASS_CAP (1 << 1)
29
26#ifdef HAVE_UDA1380 30#ifdef HAVE_UDA1380
27#include "uda1380.h" 31#include "uda1380.h"
28#elif defined(HAVE_WM8751) 32#elif defined(HAVE_WM8751)
@@ -49,6 +53,17 @@
49#include "tsc2100.h" 53#include "tsc2100.h"
50#endif 54#endif
51 55
56/* convert caps into defines */
57#ifdef AUDIOHW_CAPS
58#if (AUDIOHW_CAPS & TREBLE_CAP)
59#define AUDIOHW_HAVE_TREBLE
60#endif
61
62#if (AUDIOHW_CAPS & BASS_CAP)
63#define AUDIOHW_HAVE_BASS
64#endif
65#endif /* AUDIOHW_CAPS */
66
52enum { 67enum {
53 SOUND_VOLUME = 0, 68 SOUND_VOLUME = 0,
54 SOUND_BASS, 69 SOUND_BASS,
@@ -141,6 +156,26 @@ void audiohw_mute(bool mute);
141 */ 156 */
142void audiohw_enable_output(bool enable); 157void audiohw_enable_output(bool enable);
143 158
159#ifdef AUDIOHW_HAVE_TREBLE
160/**
161 * Set new treble value.
162 * @param val to set.
163 * NOTE: AUDIOHW_CAPS need to contain
164 * TREBLE_CAP
165 */
166void audiohw_set_treble(int val);
167#endif
168
169#ifdef AUDIOHW_HAVE_BASS
170/**
171 * Set new bass value.
172 * @param val to set.
173 * NOTE: AUDIOHW_CAPS need to contain
174 * BASS_CAP
175 */
176void audiohw_set_bass(int val);
177#endif
178
144#ifdef HAVE_RECORDING 179#ifdef HAVE_RECORDING
145 180
146/** 181/**
diff --git a/firmware/export/mas35xx.h b/firmware/export/mas35xx.h
index a4e2413344..dbe9d38a37 100644
--- a/firmware/export/mas35xx.h
+++ b/firmware/export/mas35xx.h
@@ -24,6 +24,8 @@
24 24
25#include "config.h" 25#include "config.h"
26 26
27#define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP)
28
27#if CONFIG_CODEC == MAS3507D 29#if CONFIG_CODEC == MAS3507D
28#define VOLUME_MIN -780 30#define VOLUME_MIN -780
29#define VOLUME_MAX 180 31#define VOLUME_MAX 180
diff --git a/firmware/export/uda1380.h b/firmware/export/uda1380.h
index cd27536e87..c23f95265b 100644
--- a/firmware/export/uda1380.h
+++ b/firmware/export/uda1380.h
@@ -24,13 +24,13 @@
24#define VOLUME_MIN -840 24#define VOLUME_MIN -840
25#define VOLUME_MAX 0 25#define VOLUME_MAX 0
26 26
27#define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP)
28
27extern int tenthdb2master(int db); 29extern int tenthdb2master(int db);
28extern int tenthdb2mixer(int db); 30extern int tenthdb2mixer(int db);
29 31
30extern void audiohw_set_master_vol(int vol_l, int vol_r); 32extern void audiohw_set_master_vol(int vol_l, int vol_r);
31extern void audiohw_set_mixer_vol(int channel1, int channel2); 33extern void audiohw_set_mixer_vol(int channel1, int channel2);
32extern void audiohw_set_bass(int value);
33extern void audiohw_set_treble(int value);
34 34
35/** 35/**
36 * Sets frequency settings for DAC and ADC relative to MCLK 36 * Sets frequency settings for DAC and ADC relative to MCLK
diff --git a/firmware/export/wm8758.h b/firmware/export/wm8758.h
index 61db094684..5e37e203d5 100644
--- a/firmware/export/wm8758.h
+++ b/firmware/export/wm8758.h
@@ -24,15 +24,15 @@
24#define VOLUME_MIN -570 24#define VOLUME_MIN -570
25#define VOLUME_MAX 60 25#define VOLUME_MAX 60
26 26
27#define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP)
28
27extern int tenthdb2master(int db); 29extern int tenthdb2master(int db);
28extern int tenthdb2mixer(int db); 30extern int tenthdb2mixer(int db);
29 31
30extern void audiohw_set_master_vol(int vol_l, int vol_r); 32extern void audiohw_set_master_vol(int vol_l, int vol_r);
31extern void audiohw_set_lineout_vol(int vol_l, int vol_r); 33extern void audiohw_set_lineout_vol(int vol_l, int vol_r);
32extern void audiohw_set_mixer_vol(int channel1, int channel2); 34extern void audiohw_set_mixer_vol(int channel1, int channel2);
33extern void audiohw_set_bass(int value);
34extern void audiohw_set_bass_cutoff(int value); 35extern void audiohw_set_bass_cutoff(int value);
35extern void audiohw_set_treble(int value);
36extern void audiohw_set_treble_cutoff(int value); 36extern void audiohw_set_treble_cutoff(int value);
37extern void audiohw_set_nsorder(int order); 37extern void audiohw_set_nsorder(int order);
38extern void audiohw_set_sample_rate(int sampling_control); 38extern void audiohw_set_sample_rate(int sampling_control);
diff --git a/firmware/export/wm8975.h b/firmware/export/wm8975.h
index 1ae82061ee..6457f255f6 100644
--- a/firmware/export/wm8975.h
+++ b/firmware/export/wm8975.h
@@ -24,12 +24,12 @@
24#define VOLUME_MIN -730 24#define VOLUME_MIN -730
25#define VOLUME_MAX 60 25#define VOLUME_MAX 60
26 26
27#define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP)
28
27extern int tenthdb2master(int db); 29extern int tenthdb2master(int db);
28 30
29extern void audiohw_set_master_vol(int vol_l, int vol_r); 31extern void audiohw_set_master_vol(int vol_l, int vol_r);
30extern void audiohw_set_lineout_vol(int vol_l, int vol_r); 32extern void audiohw_set_lineout_vol(int vol_l, int vol_r);
31extern void audiohw_set_bass(int value);
32extern void audiohw_set_treble(int value);
33extern void audiohw_set_nsorder(int order); 33extern void audiohw_set_nsorder(int order);
34extern void audiohw_set_sample_rate(int sampling_control); 34extern void audiohw_set_sample_rate(int sampling_control);
35 35
diff --git a/firmware/export/wm8985.h b/firmware/export/wm8985.h
index 8fa58425bf..8696e3dd6f 100644
--- a/firmware/export/wm8985.h
+++ b/firmware/export/wm8985.h
@@ -24,15 +24,15 @@
24#define VOLUME_MIN -570 24#define VOLUME_MIN -570
25#define VOLUME_MAX 60 25#define VOLUME_MAX 60
26 26
27#define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP)
28
27extern int tenthdb2master(int db); 29extern int tenthdb2master(int db);
28extern int tenthdb2mixer(int db); 30extern int tenthdb2mixer(int db);
29 31
30extern void audiohw_set_master_vol(int vol_l, int vol_r); 32extern void audiohw_set_master_vol(int vol_l, int vol_r);
31extern void audiohw_set_lineout_vol(int vol_l, int vol_r); 33extern void audiohw_set_lineout_vol(int vol_l, int vol_r);
32extern void audiohw_set_mixer_vol(int channel1, int channel2); 34extern void audiohw_set_mixer_vol(int channel1, int channel2);
33extern void audiohw_set_bass(int value);
34extern void audiohw_set_bass_cutoff(int value); 35extern void audiohw_set_bass_cutoff(int value);
35extern void audiohw_set_treble(int value);
36extern void audiohw_set_treble_cutoff(int value); 36extern void audiohw_set_treble_cutoff(int value);
37extern void audiohw_set_nsorder(int order); 37extern void audiohw_set_nsorder(int order);
38extern void audiohw_set_sample_rate(int sampling_control); 38extern void audiohw_set_sample_rate(int sampling_control);