4 * SH4 onboard DMA controller (DMAC) definitions.
6 * Copyright (c) 2005 Nathan Keynes.
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.
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.
19 #ifndef lxdream_dmac_H
20 #define lxdream_dmac_H 1
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.
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?) */
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.
43 void DMAC_trigger( int dmac_trigger );
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.
50 uint32_t DMAC_get_buffer( int channel, unsigned char *buf, uint32_t bytecount );
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.
57 uint32_t DMAC_put_buffer( int channel, unsigned char *buf, uint32_t bytecount );
63 #endif /* !lxdream_dmac_H */
.