diff options
author | Dominik Wenger <domonoky@googlemail.com> | 2009-10-26 18:16:58 +0000 |
---|---|---|
committer | Dominik Wenger <domonoky@googlemail.com> | 2009-10-26 18:16:58 +0000 |
commit | 90b576f55ea6854a70c8ed77095b42e57b744723 (patch) | |
tree | 33b5a4d1b76b435ef6ec5138e7160d9d32c955c1 /firmware/export/uda1341.h | |
parent | 6d20102a9c468135770f820a896dad3518c2093f (diff) | |
download | rockbox-90b576f55ea6854a70c8ed77095b42e57b744723.tar.gz rockbox-90b576f55ea6854a70c8ed77095b42e57b744723.zip |
Many more drivers for mini2440. Now the main binary compiles and runs.
Flyspray: FS#10725
Author: Bob Cousins
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23362 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/uda1341.h')
-rw-r--r-- | firmware/export/uda1341.h | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/firmware/export/uda1341.h b/firmware/export/uda1341.h new file mode 100644 index 0000000000..dcbbeef8e5 --- /dev/null +++ b/firmware/export/uda1341.h | |||
@@ -0,0 +1,102 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 by Bob Cousins | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #ifndef _UDA1341_H | ||
23 | #define _UDA1341_H | ||
24 | |||
25 | /* volume/balance/treble/bass interdependency */ | ||
26 | #define VOLUME_MIN -840 | ||
27 | #define VOLUME_MAX 0 | ||
28 | |||
29 | #define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | PRESCALER_CAP) | ||
30 | |||
31 | extern int tenthdb2master(int db); | ||
32 | extern int tenthdb2mixer(int db); | ||
33 | |||
34 | extern void audiohw_set_master_vol(int vol_l, int vol_r); | ||
35 | extern void audiohw_set_mixer_vol(int channel1, int channel2); | ||
36 | |||
37 | /* Address byte */ | ||
38 | #define UDA1341_ADDR 0x14 | ||
39 | #define UDA_REG_DATA0 0x00 | ||
40 | #define UDA_REG_DATA1 0x01 | ||
41 | #define UDA_REG_STATUS 0x02 | ||
42 | |||
43 | /* STATUS */ | ||
44 | #define UDA_STATUS_0 (0 << 7) | ||
45 | #define UDA_STATUS_1 (1 << 7) | ||
46 | |||
47 | #define UDA_RESET (1 << 6) | ||
48 | #define UDA_SYSCLK_512FS (0 << 4) | ||
49 | #define UDA_SYSCLK_384FS (1 << 4) | ||
50 | #define UDA_SYSCLK_256FS (2 << 4) | ||
51 | #define I2S_IFMT_IIS (0 << 1) | ||
52 | #define I2S_IFMT_LSB16 (1 << 1) | ||
53 | #define I2S_IFMT_LSB18 (2 << 1) | ||
54 | #define I2S_IFMT_LSB20 (3 << 1) | ||
55 | #define I2S_IFMT_MSB (4 << 1) | ||
56 | #define I2S_IFMT_LSB16_OFMT_MSB (5 << 1) | ||
57 | #define I2S_IFMT_LSB18_OFMT_MSB (6 << 1) | ||
58 | #define I2S_IFMT_LSB20_OFMT_MSB (7 << 1) | ||
59 | #define UDA_DC_FILTER (1 << 0) | ||
60 | |||
61 | #define UDA_OUTPUT_GAIN (1 << 6) | ||
62 | #define UDA_INPUT_GAIN (1 << 5) | ||
63 | #define UDA_ADC_INVERT (1 << 4) | ||
64 | #define UDA_DAC_INVERT (1 << 3) | ||
65 | #define UDA_DOUBLE_SPEED (1 << 2) | ||
66 | #define UDA_POWER_ADC_ON (1 << 1) | ||
67 | #define UDA_POWER_DAC_ON (1 << 0) | ||
68 | |||
69 | /* DATA0 */ | ||
70 | #define UDA_DATA_CTRL0 (0 << 6) | ||
71 | #define UDA_DATA_CTRL1 (1 << 6) | ||
72 | #define UDA_DATA_CTRL2 (2 << 6) | ||
73 | #define UDA_DATA_EXT_ADDR (6 << 5) | ||
74 | #define UDA_DATA_EXT_DATA (7 << 5) | ||
75 | |||
76 | #define UDA_VOLUME(x) ((x) << 8) /* 1=0dB, 61=-60dB */ | ||
77 | |||
78 | #define UDA_BASS_BOOST(x) ((x) << 2) /* see datasheet */ | ||
79 | #define UDA_TREBLE(x) ((x) << 0) /* see datasheet */ | ||
80 | |||
81 | #define UDA_PEAK_DETECT_POS (1 << 5) | ||
82 | #define UDA_DE_EMPHASIS_NONE (0 << 3) | ||
83 | #define UDA_DE_EMPHASIS_32 (1 << 3) | ||
84 | #define UDA_DE_EMPHASIS_44_1 (2 << 3) | ||
85 | #define UDA_DE_EMPHASIS_48 (3 << 3) | ||
86 | #define UDA_MUTE (1 << 2) | ||
87 | #define UDA_MODE_SWITCH_FLAT (0 << 0) | ||
88 | #define UDA_MODE_SWITCH_MIN (1 << 0) | ||
89 | #define UDA_MODE_SWITCH_MAX (3 << 0) | ||
90 | |||
91 | #define UDA_EXT_0 (0 << 5) /* Mixer Gain Chan 1 */ | ||
92 | #define UDA_EXT_1 (1 << 5) /* Mixer Gain Chan 2 */ | ||
93 | #define UDA_EXT_2 (2 << 5) /* Mic sens and mixer mode */ | ||
94 | #define UDA_EXT_4 (4 << 5) /* AGC, Input amp gain */ | ||
95 | #define UDA_EXT_5 (5 << 5) /* Input amp gain */ | ||
96 | #define UDA_EXT_6 (6 << 5) /* AGC settings */ | ||
97 | |||
98 | /* TODO: DATA0 extended registers */ | ||
99 | |||
100 | /* DATA1: see datasheet */ | ||
101 | |||
102 | #endif /* _UDA_1341_H */ | ||