blob: 7d372dec16de0a3d040e521e9e3afbf76523a942 [file] [log] [blame]
Maurus Cuelenaere95167e02008-04-24 20:08:28 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2007 by Karl Kurbjun
11 *
Daniel Stenberg2acc0ac2008-06-28 18:10:04 +000012 * 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.
Maurus Cuelenaere95167e02008-04-24 20:08:28 +000016 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "system.h"
22#include "kernel.h"
23#include "logf.h"
24#include "audio.h"
25#include "sound.h"
26#include "file.h"
Maurus Cuelenaere65a0de32008-05-03 13:52:39 +000027#include "dm320.h"
28#include "audiohw.h"
29#include "dsp-target.h"
30
31void pcm_play_dma_init(void)
32{
33 IO_CLK_O1DIV = 3;
34 /* Set GIO25 to CLKOUT1A */
35 IO_GIO_FSEL2 |= 3;
36 sleep(5);
37
38 audiohw_init();
39
40 audiohw_set_frequency(1);
41
42 /* init DSP */
43 dsp_init();
44}
Maurus Cuelenaere95167e02008-04-24 20:08:28 +000045
46void pcm_postinit(void)
47{
Maurus Cuelenaere65a0de32008-05-03 13:52:39 +000048 audiohw_postinit();
49 /* wake DSP */
50 dsp_wake();
Maurus Cuelenaere95167e02008-04-24 20:08:28 +000051}
52
Maurus Cuelenaere65a0de32008-05-03 13:52:39 +000053/* set frequency used by the audio hardware */
54void pcm_set_frequency(unsigned int frequency)
55{
56 int index;
57
58 switch(frequency)
59 {
60 case SAMPR_11:
61 case SAMPR_22:
62 index = 0;
63 break;
64 default:
65 case SAMPR_44:
66 index = 1;
67 break;
68 case SAMPR_88:
69 index = 2;
70 break;
71 }
72
73 audiohw_set_frequency(index);
74} /* pcm_set_frequency */
75
Maurus Cuelenaere95167e02008-04-24 20:08:28 +000076const void * pcm_play_dma_get_peak_buffer(int *count)
77{
78 (void) count;
79 return 0;
80}
81
Maurus Cuelenaere95167e02008-04-24 20:08:28 +000082void pcm_apply_settings(void)
83{
84
85}
86
Maurus Cuelenaere95167e02008-04-24 20:08:28 +000087void pcm_play_dma_start(const void *addr, size_t size)
88{
Maurus Cuelenaere65a0de32008-05-03 13:52:39 +000089 (void)addr;
90 (void)size;
91 DEBUGF("pcm_play_dma_start(0x%x, %d)", addr, size);
Maurus Cuelenaere95167e02008-04-24 20:08:28 +000092}
93
94void pcm_play_dma_stop(void)
95{
96
97}
98
99void pcm_play_lock(void)
100{
101
102}
103
104void pcm_play_unlock(void)
105{
106
107}
108
109void pcm_play_dma_pause(bool pause)
110{
111 (void) pause;
112}
113
114size_t pcm_get_bytes_waiting(void)
115{
116 return 0;
117}