diff options
Diffstat (limited to 'firmware/target/arm/tms320dm320/creative-zvm/pcm-creativezvm.c')
-rw-r--r-- | firmware/target/arm/tms320dm320/creative-zvm/pcm-creativezvm.c | 226 |
1 files changed, 113 insertions, 113 deletions
diff --git a/firmware/target/arm/tms320dm320/creative-zvm/pcm-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/pcm-creativezvm.c index 7d372dec16..34425fa63d 100644 --- a/firmware/target/arm/tms320dm320/creative-zvm/pcm-creativezvm.c +++ b/firmware/target/arm/tms320dm320/creative-zvm/pcm-creativezvm.c | |||
@@ -1,117 +1,117 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * __________ __ ___. | 2 | * __________ __ ___. |
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id$ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * Copyright (C) 2007 by Karl Kurbjun | 10 | * Copyright (C) 2007 by Karl Kurbjun |
11 | * | 11 | * |
12 | * This program is free software; you can redistribute it and/or | 12 | * This program is free software; you can redistribute it and/or |
13 | * modify it under the terms of the GNU General Public License | 13 | * modify it under the terms of the GNU General Public License |
14 | * as published by the Free Software Foundation; either version 2 | 14 | * as published by the Free Software Foundation; either version 2 |
15 | * of the License, or (at your option) any later version. | 15 | * of the License, or (at your option) any later version. |
16 | * | 16 | * |
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | 17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
18 | * KIND, either express or implied. | 18 | * KIND, either express or implied. |
19 | * | 19 | * |
20 | ****************************************************************************/ | 20 | ****************************************************************************/ |
21 | #include "system.h" | 21 | #include "system.h" |
22 | #include "kernel.h" | 22 | #include "kernel.h" |
23 | #include "logf.h" | 23 | #include "logf.h" |
24 | #include "audio.h" | 24 | #include "audio.h" |
25 | #include "sound.h" | 25 | #include "sound.h" |
26 | #include "file.h" | 26 | #include "file.h" |
27 | #include "dm320.h" | 27 | #include "dm320.h" |
28 | #include "audiohw.h" | 28 | #include "audiohw.h" |
29 | #include "dsp-target.h" | 29 | #include "dsp-target.h" |
30 | 30 | ||
31 | void pcm_play_dma_init(void) | 31 | void pcm_play_dma_init(void) |
32 | { | 32 | { |
33 | IO_CLK_O1DIV = 3; | 33 | IO_CLK_O1DIV = 3; |
34 | /* Set GIO25 to CLKOUT1A */ | 34 | /* Set GIO25 to CLKOUT1A */ |
35 | IO_GIO_FSEL2 |= 3; | 35 | IO_GIO_FSEL2 |= 3; |
36 | sleep(5); | 36 | sleep(5); |
37 | 37 | ||
38 | audiohw_init(); | 38 | audiohw_init(); |
39 | 39 | ||
40 | audiohw_set_frequency(1); | 40 | audiohw_set_frequency(1); |
41 | 41 | ||
42 | /* init DSP */ | 42 | /* init DSP */ |
43 | dsp_init(); | 43 | dsp_init(); |
44 | } | 44 | } |
45 | 45 | ||
46 | void pcm_postinit(void) | 46 | void pcm_postinit(void) |
47 | { | 47 | { |
48 | audiohw_postinit(); | 48 | audiohw_postinit(); |
49 | /* wake DSP */ | 49 | /* wake DSP */ |
50 | dsp_wake(); | 50 | dsp_wake(); |
51 | } | 51 | } |
52 | 52 | ||
53 | /* set frequency used by the audio hardware */ | 53 | /* set frequency used by the audio hardware */ |
54 | void pcm_set_frequency(unsigned int frequency) | 54 | void pcm_set_frequency(unsigned int frequency) |
55 | { | 55 | { |
56 | int index; | 56 | int index; |
57 | 57 | ||
58 | switch(frequency) | 58 | switch(frequency) |
59 | { | 59 | { |
60 | case SAMPR_11: | 60 | case SAMPR_11: |
61 | case SAMPR_22: | 61 | case SAMPR_22: |
62 | index = 0; | 62 | index = 0; |
63 | break; | 63 | break; |
64 | default: | 64 | default: |
65 | case SAMPR_44: | 65 | case SAMPR_44: |
66 | index = 1; | 66 | index = 1; |
67 | break; | 67 | break; |
68 | case SAMPR_88: | 68 | case SAMPR_88: |
69 | index = 2; | 69 | index = 2; |
70 | break; | 70 | break; |
71 | } | 71 | } |
72 | 72 | ||
73 | audiohw_set_frequency(index); | 73 | audiohw_set_frequency(index); |
74 | } /* pcm_set_frequency */ | 74 | } /* pcm_set_frequency */ |
75 | 75 | ||
76 | const void * pcm_play_dma_get_peak_buffer(int *count) | 76 | const void * pcm_play_dma_get_peak_buffer(int *count) |
77 | { | 77 | { |
78 | (void) count; | 78 | (void) count; |
79 | return 0; | 79 | return 0; |
80 | } | 80 | } |
81 | 81 | ||
82 | void pcm_apply_settings(void) | 82 | void pcm_apply_settings(void) |
83 | { | 83 | { |
84 | 84 | ||
85 | } | 85 | } |
86 | 86 | ||
87 | void pcm_play_dma_start(const void *addr, size_t size) | 87 | void pcm_play_dma_start(const void *addr, size_t size) |
88 | { | 88 | { |
89 | (void)addr; | 89 | (void)addr; |
90 | (void)size; | 90 | (void)size; |
91 | DEBUGF("pcm_play_dma_start(0x%x, %d)", addr, size); | 91 | DEBUGF("pcm_play_dma_start(0x%x, %d)", addr, size); |
92 | } | 92 | } |
93 | 93 | ||
94 | void pcm_play_dma_stop(void) | 94 | void pcm_play_dma_stop(void) |
95 | { | 95 | { |
96 | 96 | ||
97 | } | 97 | } |
98 | 98 | ||
99 | void pcm_play_lock(void) | 99 | void pcm_play_lock(void) |
100 | { | 100 | { |
101 | 101 | ||
102 | } | 102 | } |
103 | 103 | ||
104 | void pcm_play_unlock(void) | 104 | void pcm_play_unlock(void) |
105 | { | 105 | { |
106 | 106 | ||
107 | } | 107 | } |
108 | 108 | ||
109 | void pcm_play_dma_pause(bool pause) | 109 | void pcm_play_dma_pause(bool pause) |
110 | { | 110 | { |
111 | (void) pause; | 111 | (void) pause; |
112 | } | 112 | } |
113 | 113 | ||
114 | size_t pcm_get_bytes_waiting(void) | 114 | size_t pcm_get_bytes_waiting(void) |
115 | { | 115 | { |
116 | return 0; | 116 | return 0; |
117 | } | 117 | } |