Search
lxdream.org :: lxdream/src/sh4/dmac.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/dmac.h
changeset 58:ce3657a81a26
next430:467519b050f4
author nkeynes
date Mon Jan 02 14:48:29 2006 +0000 (14 years ago)
permissions -rw-r--r--
last change Commit in dmac.h (oops)
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/sh4/dmac.h Mon Jan 02 14:48:29 2006 +0000
1.3 @@ -0,0 +1,62 @@
1.4 +/**
1.5 + * $Id: dmac.h,v 1.1 2006-01-02 14:48:29 nkeynes Exp $
1.6 + *
1.7 + * SH4 onboard DMA controller (DMAC) definitions.
1.8 + *
1.9 + * Copyright (c) 2005 Nathan Keynes.
1.10 + *
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.15 + *
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.20 + */
1.21 +
1.22 +#ifndef dream_sh4dmac_H
1.23 +#define dream_sh4dmac_H 1
1.24 +
1.25 +#include <stdint.h>
1.26 +
1.27 +#ifdef __cplusplus
1.28 +extern "C" {
1.29 +#endif
1.30 +
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.33 + */
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.40 +
1.41 +/**
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.45 + */
1.46 +void DMAC_trigger( int dmac_trigger );
1.47 +
1.48 +/**
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.52 + */
1.53 +uint32_t DMAC_get_buffer( int channel, char *buf, uint32_t bytecount );
1.54 +
1.55 +/**
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.59 + */
1.60 +uint32_t DMAC_put_buffer( int channel, char *buf, uint32_t bytecount );
1.61 +
1.62 +#ifdef __cplusplus
1.63 +}
1.64 +#endif
1.65 +#endif
.