Added some doxygen documentation for parts of the kernel functions.
[planlOS.git] / system / include / ke / dma.h
blob1da656a6606f3f437a4432e2b6f63414ee28c893
1 /*
2 Copyright (C) 2008 Mathias Gottschlag
4 Permission is hereby granted, free of charge, to any person obtaining a copy of
5 this software and associated documentation files (the "Software"), to deal in the
6 Software without restriction, including without limitation the rights to use,
7 copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8 Software, and to permit persons to whom the Software is furnished to do so,
9 subject to the following conditions:
11 The above copyright notice and this permission notice shall be included in all
12 copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16 PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 /**
22 * \file dma.h
23 * ISA direct memory access
26 #ifndef KE_DMA_H_INCLUDED
27 #define KE_DMA_H_INCLUDED
29 #include <stdint.h>
31 #define KE_DMA_MODE_READ (1 << 2)
32 #define KE_DMA_MODE_WRITE (2 << 2)
33 #define KE_DMA_MODE_ON_DEMAND (0 << 6)
34 #define KE_DMA_MODE_SINGLE (1 << 6)
35 #define KE_DMA_MODE_BLOCK (2 << 6)
37 /**
38 * Opens an ISA DMA channel.
39 * \param channel Channel to open
40 * \param mode Mode for the channel
41 * \param buffer Buffer to read/write data to/from
42 * \param length Number of bytes to be transferred
44 int keOpenDMA(uint8_t channel, uint8_t mode, void *buffer, uint32_t length);
45 /**
46 * Closes a DMA channel.
48 int keCloseDMA(uint8_t channel);
50 /**
51 * Reads the data from the DMA buffer.
53 int keReadDMA(uint8_t channel);
54 /**
55 * Writes the data to the DMA buffer.
57 int keWriteDMA(uint8_t channel);
59 #endif