From dfad406aa14a735b2cd071d8d399c79be0f98e43 Mon Sep 17 00:00:00 2001 From: Daniel Ankers Date: Sun, 11 Mar 2007 17:38:08 +0000 Subject: Sound for Sansa E200 - based on work by myself, Rene Peinthor, Barry Wardell and Christian Gmeiner from the AS3514 datasheet. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12727 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/as3514.h | 78 +++++++++++++++++++++++++++++++++++++++++++ firmware/export/config-e200.h | 7 ++-- 2 files changed, 82 insertions(+), 3 deletions(-) create mode 100644 firmware/export/as3514.h (limited to 'firmware/export') diff --git a/firmware/export/as3514.h b/firmware/export/as3514.h new file mode 100644 index 0000000000..0bf87dbc46 --- /dev/null +++ b/firmware/export/as3514.h @@ -0,0 +1,78 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2007 by Daniel Ankers + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#ifndef _AS3514_H +#define _AS3514_H + +extern int tenthdb2master(int db); +extern int tenthdb2mixer(int db); + +extern void audiohw_reset(void); +extern int audiohw_init(void); +extern void audiohw_enable_output(bool enable); +extern int audiohw_set_master_vol(int vol_l, int vol_r); +extern int audiohw_set_lineout_vol(int vol_l, int vol_r); +extern int audiohw_set_mixer_vol(int channel1, int channel2); +extern void audiohw_set_bass(int value); +extern void audiohw_set_treble(int value); +extern int audiohw_mute(int mute); +extern void audiohw_close(void); +extern void audiohw_set_nsorder(int order); +extern void audiohw_set_sample_rate(int sampling_control); + +extern void audiohw_enable_recording(bool source_mic); +extern void audiohw_disable_recording(void); +extern void audiohw_set_recvol(int left, int right, int type); +extern void audiohw_set_monitor(int enable); + +extern void audiohw_set_equalizer_band(int band, int freq, int bw, int gain); + +/* Register Descriptions */ +#define LINE_OUT_R 0x00 +#define LINE_OUT_L 0x01 +#define HPH_OUT_R 0x02 +#define HPH_OUT_L 0x03 +#define LSP_OUT_R 0x04 +#define LSP_OUT_L 0x05 +#define MIC1_R 0x06 +#define MIC1_L 0x07 +#define MIC2_R 0x08 +#define MIC2_L 0x09 +#define LINE_IN1_R 0x0a +#define LINE_IN1_L 0x0b +#define LINE_IN2_R 0x0c +#define LINE_IN2_L 0x0d +#define DAC_R 0x0e +#define DAC_L 0x0f +#define ADC_R 0x10 +#define ADC_L 0x11 +#define AUDIOSET1 0x14 +#define AUDIOSET2 0x15 +#define AUDIOSET3 0x16 +#define PLLMODE 0x1d + +/* Headphone volume goes from -45.43 - 1.07dB */ +#define VOLUME_MIN -454 +#define VOLUME_MAX 10 + +#ifdef SANSA_E200 +#define AS3514_I2C_ADDR 0x46 +#endif + +#endif /* _AS3514_H */ diff --git a/firmware/export/config-e200.h b/firmware/export/config-e200.h index afe2ebec89..1b3404a148 100644 --- a/firmware/export/config-e200.h +++ b/firmware/export/config-e200.h @@ -40,6 +40,10 @@ /* Define this if you do software codec */ #define CONFIG_CODEC SWCODEC +/* There is no hardware tone control */ +#define HAVE_SW_TONE_CONTROLS +/* The PP5024 has a built-in AustriaMicrosystems AS3514 */ +#define HAVE_AS3514 /* define this if you have a real-time clock */ #ifndef BOOTLOADER @@ -58,9 +62,6 @@ /* The number of bytes reserved for loadable plugins */ #define PLUGIN_BUFFER_SIZE 0x80000 -/* Use the built-in DAC on the PP5024 */ -#define HAVE_PP5024_CODEC - #define AB_REPEAT_ENABLE 1 /* FM Tuner */ -- cgit v1.2.3