2 * Copyright (c) 2007 Antoine Kaufmann
4 * This program is free software. It comes without any warranty, to
5 * the extent permitted by applicable law. You can redistribute it
6 * and/or modify it under the terms of the Do What The Fuck You Want
7 * To Public License, Version 2, as published by Sam Hocevar. See
8 * http://sam.zoy.org/projects/COPYING.WTFPL for more details.
11 #ifndef CDI_DMA_H_INCLUDED
12 #define CDI_DMA_H_INCLUDED
30 #define CDI_DMA_MODE_READ (1 << 2)
32 #define CDI_DMA_MODE_WRITE (2 << 2)
33 #define CDI_DMA_MODE_ON_DEMAND (0 << 6)
34 #define CDI_DMA_MODE_SINGLE (1 << 6)
35 #define CDI_DMA_MODE_BLOCK (2 << 6)
39 * Initialisiert einen Transport per DMA
41 * @return 0 bei Erfolg, -1 im Fehlerfall
43 int cdi_dma_open(struct cdi_dma_handle
* handle
, uint8_t channel
, uint8_t mode
,
44 size_t length
, void* buffer
);
47 * Liest Daten per DMA ein
49 * @return 0 bei Erfolg, -1 im Fehlerfall
51 int cdi_dma_read(struct cdi_dma_handle
* handle
);
54 * Schreibt Daten per DMA
56 * @return 0 bei Erfolg, -1 im Fehlerfall
58 int cdi_dma_write(struct cdi_dma_handle
* handle
);
61 * Schliesst das DMA-Handle wieder
63 * @return 0 bei Erfolg, -1 im Fehlerfall
65 int cdi_dma_close(struct cdi_dma_handle
* handle
);