filename | src/sh4/dmac.h |
changeset | 58:ce3657a81a26 |
next | 430:467519b050f4 |
author | nkeynes |
date | Wed Mar 22 14:29:02 2006 +0000 (18 years ago) |
permissions | -rw-r--r-- |
last change | Rename IDE DMA registers appropriately Remove forced irq hack Add correct irq handling for IDE Miscellaneous WIP for the GD-rom drive |
view | annotate | diff | log | raw |
1 /**
2 * $Id: dmac.h,v 1.1 2006-01-02 14:48:29 nkeynes Exp $
3 *
4 * SH4 onboard DMA controller (DMAC) definitions.
5 *
6 * Copyright (c) 2005 Nathan Keynes.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 */
19 #ifndef dream_sh4dmac_H
20 #define dream_sh4dmac_H 1
22 #include <stdint.h>
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
28 /* External DREQ. Note only used for DMA memory-to-memory - for single
29 * address transfers the device uses DMAC_get_buffer/DMAC_put_buffer.
30 */
31 #define DMAC_EXTERNAL 0
32 #define DMAC_SCI_TDE 1 /* SCI Transmit data empty */
33 #define DMAC_SCI_RDF 2 /* SCI Receive data full */
34 #define DMAC_SCIF_TDE 3 /* SCIF Transmit data empty */
35 #define DMAC_SCIF_RDF 4 /* SCIF Receive data full */
36 #define DMAC_TMU_ICI 5 /* TMU Input capture interrupt (not used?) */
38 /**
39 * Trigger a DMAC transfer by asserting one of the above DMA request lines
40 * (from the onboard peripherals). Actual transfer is dependent on the
41 * relevant channel configuration.
42 */
43 void DMAC_trigger( int dmac_trigger );
45 /**
46 * Execute a memory-to-external-device transfer. Copies data into the supplied
47 * buffer up to a maximum of bytecount bytes.
48 * @return Actual number of bytes copied.
49 */
50 uint32_t DMAC_get_buffer( int channel, char *buf, uint32_t bytecount );
52 /**
53 * execute an external-device-to-memory transfer. Copies data from the
54 * supplied buffer into memory up to a maximum of bytecount bytes.
55 * @return Actual number of bytes copied.
56 */
57 uint32_t DMAC_put_buffer( int channel, char *buf, uint32_t bytecount );
59 #ifdef __cplusplus
60 }
61 #endif
62 #endif
.