commited some changes and added README
[meinos.git] / apps / include / cdi / dma.h
blob75c27ef91db43676064851852cabac1ab9aeacc6
1 /*
2 * Copyright (c) 2009 Janosch Gräf
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.
9 */
11 #ifndef _CDI_DMA_H_
12 #define _CDI_DMA_H_
14 #include <sys/types.h>
15 #include <dma.h>
16 #include <string.h>
17 #include <stdint.h>
19 // Geraet => Speicher
20 #define CDI_DMA_MODE_READ DMA_MODE_READ
21 // Speicher => Geraet
22 #define CDI_DMA_MODE_WRITE DMA_MODE_WRITE
23 #define CDI_DMA_MODE_ON_DEMAND DMA_MODE_ON_DEMAND
24 #define CDI_DMA_MODE_SINGLE DMA_MODE_SINGLE
25 #define CDI_DMA_MODE_BLOCK DMA_MODE_BLOCK
27 struct cdi_dma_handle {
28 uint8_t channel;
29 size_t length;
30 uint8_t mode;
31 void *buffer;
32 void *dmabuf; ///< @note meinOS specific
35 int cdi_dma_read(struct cdi_dma_handle *handle);
36 int cdi_dma_write(struct cdi_dma_handle *handle);
37 int cdi_dma_close(struct cdi_dma_handle *handle);
39 int cdi_dma_open(struct cdi_dma_handle *handle,uint8_t channel,uint8_t mode,size_t length,void* buffer);
41 #endif