diff options
Diffstat (limited to 'firmware/export')
-rw-r--r-- | firmware/export/audiohw.h | 2 | ||||
-rw-r--r-- | firmware/export/config-mini2440.h | 17 | ||||
-rw-r--r-- | firmware/export/s3c2440.h | 33 | ||||
-rw-r--r-- | firmware/export/uda1341.h | 102 |
4 files changed, 149 insertions, 5 deletions
diff --git a/firmware/export/audiohw.h b/firmware/export/audiohw.h index 66fc19f923..91df2dd8b9 100644 --- a/firmware/export/audiohw.h +++ b/firmware/export/audiohw.h | |||
@@ -36,6 +36,8 @@ | |||
36 | 36 | ||
37 | #ifdef HAVE_UDA1380 | 37 | #ifdef HAVE_UDA1380 |
38 | #include "uda1380.h" | 38 | #include "uda1380.h" |
39 | #elif defined(HAVE_UDA1341) | ||
40 | #include "uda1341.h" | ||
39 | #elif defined(HAVE_WM8751) | 41 | #elif defined(HAVE_WM8751) |
40 | #include "wm8751.h" | 42 | #include "wm8751.h" |
41 | #elif defined(HAVE_WM8978) | 43 | #elif defined(HAVE_WM8978) |
diff --git a/firmware/export/config-mini2440.h b/firmware/export/config-mini2440.h index 0db027c7a0..b9d5dadf9c 100644 --- a/firmware/export/config-mini2440.h +++ b/firmware/export/config-mini2440.h | |||
@@ -39,9 +39,11 @@ | |||
39 | /* define the storage type */ | 39 | /* define the storage type */ |
40 | #define CONFIG_STORAGE STORAGE_SD | 40 | #define CONFIG_STORAGE STORAGE_SD |
41 | 41 | ||
42 | /* | ||
42 | #define HAVE_MULTIDRIVE | 43 | #define HAVE_MULTIDRIVE |
43 | #define NUM_DRIVES 2 | 44 | #define NUM_DRIVES 2 |
44 | #define HAVE_HOTSWAP | 45 | #define HAVE_HOTSWAP |
46 | */ | ||
45 | 47 | ||
46 | /* Disk storage */ | 48 | /* Disk storage */ |
47 | /* define this if you have a disk storage, i.e. something | 49 | /* define this if you have a disk storage, i.e. something |
@@ -62,7 +64,7 @@ | |||
62 | #define LCD_DEPTH 16 /* 65536 colours */ | 64 | #define LCD_DEPTH 16 /* 65536 colours */ |
63 | #define LCD_PIXELFORMAT RGB565 /* rgb565 */ | 65 | #define LCD_PIXELFORMAT RGB565 /* rgb565 */ |
64 | /* Define this for LCD backlight available */ | 66 | /* Define this for LCD backlight available */ |
65 | /* The Mini2440 supports backight brightness depending on LCD type */ | 67 | /* The Mini2440 supports backlight brightness depending on LCD type */ |
66 | /* But the 3.5" LCD touch screen does not support brightness*/ | 68 | /* But the 3.5" LCD touch screen does not support brightness*/ |
67 | #define HAVE_BACKLIGHT | 69 | #define HAVE_BACKLIGHT |
68 | #define HAVE_BACKLIGHT_BRIGHTNESS | 70 | #define HAVE_BACKLIGHT_BRIGHTNESS |
@@ -71,15 +73,17 @@ | |||
71 | #define CONFIG_KEYPAD MINI2440_PAD | 73 | #define CONFIG_KEYPAD MINI2440_PAD |
72 | 74 | ||
73 | /* I2C */ | 75 | /* I2C */ |
74 | /* Do not use I2C */ | 76 | /* We do not use currently use hardware I2C, but does not build without */ |
75 | #define CONFIG_I2C I2C_NONE | 77 | #define CONFIG_I2C I2C_S3C2440 |
76 | 78 | ||
77 | /* Define DAC/Codec */ | 79 | /* Define DAC/Codec */ |
78 | /*#define HAVE_UDA1341*/ | 80 | #define HAVE_UDA1341 |
79 | #define HAVE_TLV320 | ||
80 | /* ... tone controls, use the software ones */ | 81 | /* ... tone controls, use the software ones */ |
81 | #define HAVE_SW_TONE_CONTROLS | 82 | #define HAVE_SW_TONE_CONTROLS |
82 | 83 | ||
84 | #define HW_SAMPR_CAPS (SAMPR_CAP_64 | SAMPR_CAP_44 | SAMPR_CAP_22 | \ | ||
85 | SAMPR_CAP_11) | ||
86 | |||
83 | /* Battery */ | 87 | /* Battery */ |
84 | #define BATTERY_CAPACITY_DEFAULT 1100 /* default battery capacity */ | 88 | #define BATTERY_CAPACITY_DEFAULT 1100 /* default battery capacity */ |
85 | #define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */ | 89 | #define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */ |
@@ -89,6 +93,9 @@ | |||
89 | 93 | ||
90 | /* USB */ | 94 | /* USB */ |
91 | /* TODO:#define HAVE_USBSTACK */ | 95 | /* TODO:#define HAVE_USBSTACK */ |
96 | #define USB_NONE | ||
97 | |||
98 | #define HAVE_SERIAL | ||
92 | 99 | ||
93 | /***************************************************************************/ | 100 | /***************************************************************************/ |
94 | /* Application Config */ | 101 | /* Application Config */ |
diff --git a/firmware/export/s3c2440.h b/firmware/export/s3c2440.h index c783b37f29..b6ba79a34e 100644 --- a/firmware/export/s3c2440.h +++ b/firmware/export/s3c2440.h | |||
@@ -462,6 +462,39 @@ | |||
462 | #define IISFCON (*(volatile unsigned long *)0x5500000C) /* IIS FIFO control */ | 462 | #define IISFCON (*(volatile unsigned long *)0x5500000C) /* IIS FIFO control */ |
463 | #define IISFIFO (*(volatile unsigned short *)0x55000010) /* IIS FIFO entry */ | 463 | #define IISFIFO (*(volatile unsigned short *)0x55000010) /* IIS FIFO entry */ |
464 | 464 | ||
465 | #define IISCON_RIGHT_CHANNEL (1 << 8) | ||
466 | #define IISCON_TX_FIFO_NOT_EMPTY (1 << 7) | ||
467 | #define IISCON_RX_FIFO_NOT_FULL (1 << 6) | ||
468 | #define IISCON_TX_DMA_REQUEST (1 << 5) | ||
469 | #define IISCON_RX_DMA_REQUEST (1 << 4) | ||
470 | #define IISCON_TX_IDLE (1 << 3) | ||
471 | #define IISCON_RX_IDLE (1 << 2) | ||
472 | #define IISCON_IIS_PRESCALER_ENABLE (1 << 1) | ||
473 | #define IISCON_IIS_INTERFACE_ENABLE (1 << 0) | ||
474 | |||
475 | #define IISMOD_MASTER_CLOCK_PCLK (0 << 9) | ||
476 | #define IISMOD_MASTER_CLOCK_MPLLIN (1 << 9) | ||
477 | #define IISMOD_MASTER_MODE (0 << 8) | ||
478 | #define IISMOD_SLAVE_MODE (1 << 8) | ||
479 | #define IISMOD_NO_TRANSFER (0 << 6) | ||
480 | #define IISMOD_RECEIVE_MODE (1 << 6) | ||
481 | #define IISMOD_TRANSMIT_MODE (2 << 6) | ||
482 | #define IISMOD_TRANSMIT_RECEIVE_MODE (3 << 6) | ||
483 | #define IISMOD_LOW_LEFT (0 << 5) | ||
484 | #define IISMOD_HIGH_LEFT (1 << 5) | ||
485 | #define IISMOD_IIS (0 << 4) | ||
486 | #define IISMOD_MSB (1 << 4) | ||
487 | #define IISMOD_8_BIT (0 << 3) | ||
488 | #define IISMOD_16_BIT (1 << 3) | ||
489 | #define IISMOD_MASTER_CLOCK_256FS (0 << 2) | ||
490 | #define IISMOD_MASTER_CLOCK_384FS (1 << 2) | ||
491 | #define IISMOD_BIT_CLOCK_16FS (0 << 0) | ||
492 | #define IISMOD_BIT_CLOCK_32FS (1 << 0) | ||
493 | #define IISMOD_BIT_CLOCK_48FS (2 << 0) | ||
494 | |||
495 | #define IISPSR_PRESCALER_A (1 << 5) | ||
496 | #define IISPSR_PRESCALER_B (1 << 0) | ||
497 | |||
465 | /* I/O port */ | 498 | /* I/O port */ |
466 | 499 | ||
467 | #define GPACON (*(volatile unsigned long *)0x56000000) /* Port A control */ | 500 | #define GPACON (*(volatile unsigned long *)0x56000000) /* Port A control */ |
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 */ | ||