1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/sh4/dmac.h Fri Dec 29 00:21:46 2006 +0000
1.5 + * $Id: dmac.h,v 1.1 2006-01-02 14:48:29 nkeynes Exp $
1.7 + * SH4 onboard DMA controller (DMAC) definitions.
1.9 + * Copyright (c) 2005 Nathan Keynes.
1.11 + * This program is free software; you can redistribute it and/or modify
1.12 + * it under the terms of the GNU General Public License as published by
1.13 + * the Free Software Foundation; either version 2 of the License, or
1.14 + * (at your option) any later version.
1.16 + * This program is distributed in the hope that it will be useful,
1.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.19 + * GNU General Public License for more details.
1.22 +#ifndef dream_sh4dmac_H
1.23 +#define dream_sh4dmac_H 1
1.25 +#include <stdint.h>
1.31 +/* External DREQ. Note only used for DMA memory-to-memory - for single
1.32 + * address transfers the device uses DMAC_get_buffer/DMAC_put_buffer.
1.34 +#define DMAC_EXTERNAL 0
1.35 +#define DMAC_SCI_TDE 1 /* SCI Transmit data empty */
1.36 +#define DMAC_SCI_RDF 2 /* SCI Receive data full */
1.37 +#define DMAC_SCIF_TDE 3 /* SCIF Transmit data empty */
1.38 +#define DMAC_SCIF_RDF 4 /* SCIF Receive data full */
1.39 +#define DMAC_TMU_ICI 5 /* TMU Input capture interrupt (not used?) */
1.42 + * Trigger a DMAC transfer by asserting one of the above DMA request lines
1.43 + * (from the onboard peripherals). Actual transfer is dependent on the
1.44 + * relevant channel configuration.
1.46 +void DMAC_trigger( int dmac_trigger );
1.49 + * Execute a memory-to-external-device transfer. Copies data into the supplied
1.50 + * buffer up to a maximum of bytecount bytes.
1.51 + * @return Actual number of bytes copied.
1.53 +uint32_t DMAC_get_buffer( int channel, char *buf, uint32_t bytecount );
1.56 + * execute an external-device-to-memory transfer. Copies data from the
1.57 + * supplied buffer into memory up to a maximum of bytecount bytes.
1.58 + * @return Actual number of bytes copied.
1.60 +uint32_t DMAC_put_buffer( int channel, char *buf, uint32_t bytecount );