Colour targets: Revert an optimisation from almost 18 months ago that actually turned...
[Rockbox.git] / firmware / export / as3514.h
blobaa9847c6a1e71a7e9907089b2803a7b1cbe0bb4a
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2007 by Daniel Ankers
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.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #ifndef _AS3514_H
23 #define _AS3514_H
25 #include <stdbool.h>
27 extern int tenthdb2master(int db);
29 extern void audiohw_set_master_vol(int vol_l, int vol_r);
30 extern void audiohw_set_lineout_vol(int vol_l, int vol_r);
31 extern void audiohw_set_sample_rate(int sampling_control);
33 /* Register Descriptions */
34 #define AS3514_LINE_OUT_R 0x00
35 #define AS3514_LINE_OUT_L 0x01
36 #define AS3514_HPH_OUT_R 0x02
37 #define AS3514_HPH_OUT_L 0x03
38 #define AS3514_LSP_OUT_R 0x04
39 #define AS3514_LSP_OUT_L 0x05
40 #define AS3514_MIC1_R 0x06
41 #define AS3514_MIC1_L 0x07
42 #define AS3514_MIC2_R 0x08
43 #define AS3514_MIC2_L 0x09
44 #define AS3514_LINE_IN1_R 0x0a
45 #define AS3514_LINE_IN1_L 0x0b
46 #define AS3514_LINE_IN2_R 0x0c
47 #define AS3514_LINE_IN2_L 0x0d
48 #define AS3514_DAC_R 0x0e
49 #define AS3514_DAC_L 0x0f
50 #define AS3514_ADC_R 0x10
51 #define AS3514_ADC_L 0x11
52 #define AS3514_AUDIOSET1 0x14
53 #define AS3514_AUDIOSET2 0x15
54 #define AS3514_AUDIOSET3 0x16
55 #define AS3514_PLLMODE 0x1d
57 #define AS3514_SYSTEM 0x20
58 #define AS3514_CVDD_DCDC3 0x21
59 #define AS3514_CHARGER 0x22
60 #define AS3514_DCDC15 0x23
61 #define AS3514_SUPERVISOR 0x24
63 #define AS3514_IRQ_ENRD0 0x25
64 #define AS3514_IRQ_ENRD1 0x26
65 #define AS3514_IRQ_ENRD2 0x27
67 #define AS3514_RTCV 0x28
68 #define AS3514_RTCT 0x29
69 #define AS3514_RTC_0 0x2a
70 #define AS3514_RTC_1 0x2b
71 #define AS3514_RTC_2 0x2c
72 #define AS3514_RTC_3 0x2d
73 #define AS3514_ADC_0 0x2e
74 #define AS3514_ADC_1 0x2f
76 #define AS3514_UID_0 0x30
78 /* Headphone volume goes from -73.5 ... +6dB */
79 #define VOLUME_MIN -735
80 #define VOLUME_MAX 60
82 #if defined(SANSA_E200) || defined(SANSA_C200) || defined(PHILIPS_SA9200)
83 #define AS3514_I2C_ADDR 0x46
84 #endif
86 #endif /* _AS3514_H */