00001 #ifndef _STM32F1_DMA_H_ 00002 #define _STM32F1_DMA_H_ 00003 /* 00004 * Copyright (C) 2010 by Ulrich Prinz (uprinz2@netscape.net) 00005 * 00006 * Redistribution and use in source and binary forms, with or without 00007 * modification, are permitted provided that the following conditions 00008 * are met: 00009 * 00010 * 1. Redistributions of source code must retain the above copyright 00011 * notice, this list of conditions and the following disclaimer. 00012 * 2. Redistributions in binary form must reproduce the above copyright 00013 * notice, this list of conditions and the following disclaimer in the 00014 * documentation and/or other materials provided with the distribution. 00015 * 3. Neither the name of the copyright holders nor the names of 00016 * contributors may be used to endorse or promote products derived 00017 * from this software without specific prior written permission. 00018 * 00019 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00020 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00021 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00022 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 00023 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00024 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00025 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 00026 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 00027 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00028 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 00029 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00030 * SUCH DAMAGE. 00031 * 00032 * For additional information see http://www.ethernut.de/ 00033 * 00034 */ 00035 00048 #define DMA1_C1 0 00049 #define DMA1_C2 1 00050 #define DMA1_C3 2 00051 #define DMA1_C4 3 00052 #define DMA1_C5 4 00053 #define DMA1_C6 5 00054 #define DMA1_C7 6 00055 #define STM_HAS_DMA1 7 00056 00057 #if defined(STM32F10X_HD) || defined(STM32F10X_XL) 00058 #define DMA2_C1 7 00059 #define DMA2_C2 8 00060 #define DMA2_C3 9 00061 #define DMA2_C45 10 00062 #define STM_HAS_DMA2 4 00063 #elif defined(STM32F10X_CL) 00064 #define DMA2_C1 7 00065 #define DMA2_C2 8 00066 #define DMA2_C3 9 00067 #define DMA2_C4 10 00068 #define DMA2_C5 11 00069 #define STM_HAS_DMA2 5 00070 #endif 00071 00072 #define DMA_MINC DMA_CCR1_MINC 00073 00074 /* Internally used struct and table to align 00075 * DMA channels and interrupts. */ 00076 typedef struct { 00077 uint32_t dma; /*< DMA Controller Register Base Address */ 00078 uint32_t fofs; /*< DMA Channel Flags Offset */ 00079 DMA_Channel_TypeDef* dma_ch; /*< DMA Channel Register Base Address */ 00080 } DMATAB; 00081 00082 extern const DMATAB DmaTab[]; 00083 00084 #endif /* _STM32F1_DMA_H_ */