Satellite Observers Workbench. NOT yet complete, just published for forum posters to \"cherry pick\" pieces of code as requiered as an example.

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers dma.h Source File

dma.h

00001 /****************************************************************************
00002  *    Copyright 2010 Andy Kirkham, Stellar Technologies Ltd
00003  *    
00004  *    This file is part of the Satellite Observers Workbench (SOWB).
00005  *
00006  *    SOWB is free software: you can redistribute it and/or modify
00007  *    it under the terms of the GNU General Public License as published by
00008  *    the Free Software Foundation, either version 3 of the License, or
00009  *    (at your option) any later version.
00010  *
00011  *    SOWB is distributed in the hope that it will be useful,
00012  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *    GNU General Public License for more details.
00015  *
00016  *    You should have received a copy of the GNU General Public License
00017  *    along with SOWB.  If not, see <http://www.gnu.org/licenses/>.
00018  *
00019  *    $Id: main.cpp 5 2010-07-12 20:51:11Z ajk $
00020  *    
00021  ***************************************************************************/
00022 
00023 #ifndef DMA_H
00024 #define DMA_H
00025 
00026 #define DMA_CHANNEL_0   (1UL << 0)
00027 #define DMA_CHANNEL_1   (1UL << 1)
00028 #define DMA_CHANNEL_2   (1UL << 2)
00029 #define DMA_CHANNEL_3   (1UL << 3)
00030 #define DMA_CHANNEL_4   (1UL << 4)
00031 #define DMA_CHANNEL_5   (1UL << 5)
00032 #define DMA_CHANNEL_6   (1UL << 6)
00033 #define DMA_CHANNEL_7   (1UL << 7)
00034 
00035 typedef int (*DMA_callback)(int channel);
00036 
00037 typedef struct _dma_callbacks {
00038     DMA_callback    TcCallback;
00039     DMA_callback    ErrCallback; 
00040 } DMA_CALLBACKS;
00041 
00042 void DMA_init(void);
00043 void DMA_process(void);
00044 bool DMA_request_channel(int channel);
00045 void DMA_release_channel(int channel);
00046 
00047 #endif