From eaa1f73c6daf7e0c066a21b87384cb85cfa33538 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Wed, 29 Sep 2004 19:51:41 +0000 Subject: Added MAS3539F support (Ondio SP) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5129 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/config-ondiosp.h | 4 +-- firmware/export/mas.h | 77 ++++++++++++++++++++++++++++++++-------- firmware/export/mp3_playback.h | 4 +-- 3 files changed, 67 insertions(+), 18 deletions(-) (limited to 'firmware/export') diff --git a/firmware/export/config-ondiosp.h b/firmware/export/config-ondiosp.h index 0a270e8ae5..e3fe6c718f 100644 --- a/firmware/export/config-ondiosp.h +++ b/firmware/export/config-ondiosp.h @@ -1,5 +1,5 @@ /* define this if you have recording possibility */ -#define HAVE_RECORDING 1 +/* #define HAVE_RECORDING */ /* define this if you have a bitmap LCD display */ #define HAVE_LCD_BITMAP 1 @@ -17,7 +17,7 @@ #define CONFIG_CPU SH7034 /* Define this if you have a MAS3539F */ -#define CONFIG_HWCODEC MAS3587F /* will be MAS3539F once prepared */ +#define CONFIG_HWCODEC MAS3539F /* Define this if you have a LiIon battery */ /* #define HAVE_LIION */ diff --git a/firmware/export/mas.h b/firmware/export/mas.h index dac946ea63..f682fc676e 100644 --- a/firmware/export/mas.h +++ b/firmware/export/mas.h @@ -27,7 +27,7 @@ /* MAS I2C defs */ -#if CONFIG_HWCODEC == MAS3587F +#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #define MAS_ADR 0x3c #define MAS_DEV_WRITE (MAS_ADR | 0x00) #define MAS_DEV_READ (MAS_ADR | 0x01) @@ -38,18 +38,18 @@ #endif /* registers..*/ -#if CONFIG_HWCODEC == MAS3587F -#define MAS_DATA_WRITE 0x68 -#define MAS_DATA_READ 0x69 +#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) +#define MAS_DATA_WRITE 0x68 +#define MAS_DATA_READ 0x69 #define MAS_CODEC_WRITE 0x6c #define MAS_CODEC_READ 0x6d -#define MAS_CONTROL 0x6a -#define MAS_DCCF 0x76 -#define MAS_DCFR 0x77 +#define MAS_CONTROL 0x6a +#define MAS_DCCF 0x76 +#define MAS_DCFR 0x77 #else -#define MAS_DATA_WRITE 0x68 -#define MAS_DATA_READ 0x69 -#define MAS_CONTROL 0x6a +#define MAS_DATA_WRITE 0x68 +#define MAS_DATA_READ 0x69 +#define MAS_CONTROL 0x6a #endif /* @@ -62,15 +62,15 @@ #define MAS_REG_KPRESCALE 0xe7 #define MAS_REG_KBASS 0x6b #define MAS_REG_KTREBLE 0x6f -#if CONFIG_HWCODEC == MAS3587F +#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #define MAS_REG_KMDB_SWITCH 0x21 #define MAS_REG_KMDB_STR 0x22 #define MAS_REG_KMDB_HAR 0x23 #define MAS_REG_KMDB_FC 0x24 #define MAS_REG_KLOUDNESS 0x1e #define MAS_REG_QPEAK_L 0x0a -#define MAS_REG_QPEAK_R 0x0b -#define MAS_REG_DQPEAK_L 0x0c +#define MAS_REG_QPEAK_R 0x0b +#define MAS_REG_DQPEAK_L 0x0c #define MAS_REG_DQPEAK_R 0x0d #define MAS_REG_KAVC 0x12 #endif @@ -78,7 +78,7 @@ /* * MAS commands */ -#if CONFIG_HWCODEC == MAS3587F +#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #define MAS_CMD_READ_ANCILLARY 0x50 #define MAS_CMD_FAST_PRG_DL 0x60 #define MAS_CMD_READ_IC_VER 0x70 @@ -98,6 +98,55 @@ #define MAS_CMD_READ_D1_MEM 0xf0 #endif +/* + * MAS D0 memory cells (MAS3587F / MAS3539F) + */ +#if CONFIG_HWCODEC == MAS3587F +#define MAS_D0_APP_SELECT 0x7f6 +#define MAS_D0_APP_RUNNING 0x7f7 +#define MAS_D0_ENCODER_CONTROL 0x7f0 +#define MAS_D0_IO_CONTROL_MAIN 0x7f1 +#define MAS_D0_INTERFACE_CONTROL 0x7f2 +#define MAS_D0_OFREQ_CONTROL 0x7f3 +#define MAS_D0_OUT_CLK_CONFIG 0x7f4 +#define MAS_D0_SPD_OUT_BITS 0x7f8 +#define MAS_D0_SOFT_MUTE 0x7f9 +#define MAS_D0_OUT_LL 0x7fc +#define MAS_D0_OUT_LR 0x7fd +#define MAS_D0_OUT_RL 0x7fe +#define MAS_D0_OUT_RR 0x7ff +#define MAS_D0_MPEG_FRAME_COUNT 0xfd0 +#define MAS_D0_MPEG_STATUS_1 0xfd1 +#define MAS_D0_MPEG_STATUS_2 0xfd2 +#define MAS_D0_CRC_ERROR_COUNT 0xfd3 + +#elif CONFIG_HWCODEC == MAS3539F +#define MAS_D0_APP_SELECT 0x34b +#define MAS_D0_APP_RUNNING 0x34c +/* no encoder :( */ +#define MAS_D0_IO_CONTROL_MAIN 0x346 +#define MAS_D0_INTERFACE_CONTROL 0x347 +#define MAS_D0_OFREQ_CONTROL 0x348 +#define MAS_D0_OUT_CLK_CONFIG 0x349 +#define MAS_D0_SPD_OUT_BITS 0x351 +#define MAS_D0_SOFT_MUTE 0x350 +#define MAS_D0_OUT_LL 0x354 +#define MAS_D0_OUT_LR 0x355 +#define MAS_D0_OUT_RL 0x356 +#define MAS_D0_OUT_RR 0x357 +#define MAS_D0_MPEG_FRAME_COUNT 0xfd0 +#define MAS_D0_MPEG_STATUS_1 0xfd1 +#define MAS_D0_MPEG_STATUS_2 0xfd2 +#define MAS_D0_CRC_ERROR_COUNT 0xfd3 + +#else /* MAS3507D */ +#define MAS_D0_MPEG_FRAME_COUNT 0x300 +#define MAS_D0_MPEG_STATUS_1 0x301 +#define MAS_D0_MPEG_STATUS_2 0x302 +#define MAS_D0_CRC_ERROR_COUNT 0x303 + +#endif + int mas_default_read(unsigned short *buf); int mas_run(unsigned short address); int mas_readmem(int bank, int addr, unsigned long* dest, int len); diff --git a/firmware/export/mp3_playback.h b/firmware/export/mp3_playback.h index dd56940c37..456569342b 100644 --- a/firmware/export/mp3_playback.h +++ b/firmware/export/mp3_playback.h @@ -39,13 +39,13 @@ int mpeg_val2phys(int setting, int value); const char *mpeg_sound_unit(int setting); int mpeg_sound_numdecimals(int setting); int mpeg_sound_steps(int setting); -#if CONFIG_HWCODEC == MAS3587F || defined(SIMULATOR) +#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) || defined(SIMULATOR) void mpeg_set_pitch(int percent); #endif /* exported just for mpeg.c, to keep the recording there */ -#if CONFIG_HWCODEC == MAS3587F +#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) void demand_irq_enable(bool on); #endif -- cgit v1.2.3