Maurus Cuelenaere | 95167e0 | 2008-04-24 20:08:28 +0000 | [diff] [blame] | 1 | /***************************************************************************
|
| 2 | * __________ __ ___.
|
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
| 7 | * \/ \/ \/ \/ \/
|
| 8 | * $Id$
|
| 9 | *
|
| 10 | * Copyright (C) 2007 by Karl Kurbjun
|
| 11 | *
|
Daniel Stenberg | 2acc0ac | 2008-06-28 18:10:04 +0000 | [diff] [blame^] | 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. |
Maurus Cuelenaere | 95167e0 | 2008-04-24 20:08:28 +0000 | [diff] [blame] | 16 | *
|
| 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 Cuelenaere | 65a0de3 | 2008-05-03 13:52:39 +0000 | [diff] [blame] | 27 | #include "dm320.h"
|
| 28 | #include "audiohw.h"
|
| 29 | #include "dsp-target.h"
|
| 30 |
|
| 31 | void 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 Cuelenaere | 95167e0 | 2008-04-24 20:08:28 +0000 | [diff] [blame] | 45 |
|
| 46 | void pcm_postinit(void)
|
| 47 | {
|
Maurus Cuelenaere | 65a0de3 | 2008-05-03 13:52:39 +0000 | [diff] [blame] | 48 | audiohw_postinit();
|
| 49 | /* wake DSP */
|
| 50 | dsp_wake();
|
Maurus Cuelenaere | 95167e0 | 2008-04-24 20:08:28 +0000 | [diff] [blame] | 51 | }
|
| 52 |
|
Maurus Cuelenaere | 65a0de3 | 2008-05-03 13:52:39 +0000 | [diff] [blame] | 53 | /* set frequency used by the audio hardware */
|
| 54 | void 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 Cuelenaere | 95167e0 | 2008-04-24 20:08:28 +0000 | [diff] [blame] | 76 | const void * pcm_play_dma_get_peak_buffer(int *count)
|
| 77 | {
|
| 78 | (void) count;
|
| 79 | return 0;
|
| 80 | }
|
| 81 |
|
Maurus Cuelenaere | 95167e0 | 2008-04-24 20:08:28 +0000 | [diff] [blame] | 82 | void pcm_apply_settings(void)
|
| 83 | {
|
| 84 |
|
| 85 | }
|
| 86 |
|
Maurus Cuelenaere | 95167e0 | 2008-04-24 20:08:28 +0000 | [diff] [blame] | 87 | void pcm_play_dma_start(const void *addr, size_t size)
|
| 88 | {
|
Maurus Cuelenaere | 65a0de3 | 2008-05-03 13:52:39 +0000 | [diff] [blame] | 89 | (void)addr;
|
| 90 | (void)size;
|
| 91 | DEBUGF("pcm_play_dma_start(0x%x, %d)", addr, size);
|
Maurus Cuelenaere | 95167e0 | 2008-04-24 20:08:28 +0000 | [diff] [blame] | 92 | }
|
| 93 |
|
| 94 | void pcm_play_dma_stop(void)
|
| 95 | {
|
| 96 |
|
| 97 | }
|
| 98 |
|
| 99 | void pcm_play_lock(void)
|
| 100 | {
|
| 101 |
|
| 102 | }
|
| 103 |
|
| 104 | void pcm_play_unlock(void)
|
| 105 | {
|
| 106 |
|
| 107 | }
|
| 108 |
|
| 109 | void pcm_play_dma_pause(bool pause)
|
| 110 | {
|
| 111 | (void) pause;
|
| 112 | }
|
| 113 |
|
| 114 | size_t pcm_get_bytes_waiting(void)
|
| 115 | {
|
| 116 | return 0;
|
| 117 | }
|