2008-11-25 13:38:32 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Copyright © 2008 Rafaël Carré
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2010-05-27 12:00:29 +00:00
|
|
|
#include "config.h" /* for INIT_ATTR */
|
2008-11-25 13:38:32 +00:00
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
/* DMA request lines (16 max): not specified in AS3525 datasheet, but common to
|
|
|
|
* all AS3525 based models (made by SanDisk) supported by rockbox. */
|
|
|
|
|
2010-02-08 08:13:52 +00:00
|
|
|
#define DMA_PERI_SSP 0
|
2008-11-25 13:38:32 +00:00
|
|
|
#define DMA_PERI_SD_SLOT 2
|
|
|
|
#define DMA_PERI_I2SOUT 3
|
|
|
|
#define DMA_PERI_I2SIN 4
|
|
|
|
#define DMA_PERI_SD 5 /* embedded storage */
|
|
|
|
#define DMA_PERI_DBOP 8
|
|
|
|
|
2010-05-27 12:00:29 +00:00
|
|
|
void dma_init(void) INIT_ATTR;
|
2008-11-25 13:38:32 +00:00
|
|
|
void dma_enable_channel(int channel, void *src, void *dst, int peri,
|
|
|
|
int flow_controller, bool src_inc, bool dst_inc,
|
2008-12-04 20:48:19 +00:00
|
|
|
size_t size, int nwords, void (*callback)(void));
|
2010-09-07 08:40:08 +00:00
|
|
|
void dma_disable_channel(int channel);
|
2011-01-19 09:15:23 +00:00
|
|
|
void dma_pause_channel(int channel);
|
|
|
|
void dma_resume_channel(int channel);
|
2008-12-04 22:54:06 +00:00
|
|
|
|
|
|
|
void dma_retain(void);
|
|
|
|
void dma_release(void);
|