Paparazzi UAS  v6.2_unstable
Paparazzi is a free software Unmanned Aircraft System.
ram_arch.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Gautier Hattenberger and Alexandre Bustico
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, see
18  * <http://www.gnu.org/licenses/>.
19  */
20 
43 #ifndef RAM_ARCH_H
44 #define RAM_ARCH_H
45 
46 #if defined(STM32F1XX)
47 #define STD_SECTION ".ram0"
48 #define FAST_SECTION ".ram0"
49 #define DMA_SECTION ".ram0"
50 #define DMA_ALIGN 8
51 #elif defined(STM32F3XX)
52 #define STD_SECTION ".ram0"
53 #define FAST_SECTION ".ram4"
54 #define DMA_SECTION ".ram0"
55 #define DMA_ALIGN 8
56 #elif defined(STM32F4XX)
57 #define STD_SECTION ".ram0"
58 #define FAST_SECTION ".ram4"
59 #define DMA_SECTION ".ram0"
60 #define DMA_ALIGN 8
61 #elif defined(STM32F7XX)
62 #define STD_SECTION ".ram0"
63 #define FAST_SECTION ".ram0"
64 #define DMA_SECTION ".ram3"
65 #define DMA_ALIGN 8
66 #elif defined(STM32H7XX)
67 #define STD_SECTION ".ram1"
68 #define FAST_SECTION ".ram5"
69 #define DMA_SECTION ".ram0"
70 #define DMA_ALIGN 32
71 #else
72 #error "section defined only for STM32F1, STM32F3, STM32F4, STM32F7 and STM32H7"
73 #endif
74 
75 #define IN_STD_SECTION_NOINIT(var) var __attribute__ ((section(STD_SECTION), aligned(8)))
76 #define IN_STD_SECTION_CLEAR(var) var __attribute__ ((section(STD_SECTION "_clear"), aligned(8)))
77 #define IN_STD_SECTION(var) var __attribute__ ((section(STD_SECTION "_init"), aligned(8)))
78 
79 #define IN_FAST_SECTION_NOINIT(var) var __attribute__ ((section(FAST_SECTION), aligned(8)))
80 #define IN_FAST_SECTION_CLEAR(var) var __attribute__ ((section(FAST_SECTION "_clear"), aligned(8)))
81 #define IN_FAST_SECTION(var) var __attribute__ ((section(FAST_SECTION "_init"), aligned(8)))
82 
83 #define IN_DMA_SECTION_NOINIT(var) var __attribute__ ((section(DMA_SECTION), aligned(DMA_ALIGN)))
84 #define IN_DMA_SECTION_CLEAR(var) var __attribute__ ((section(DMA_SECTION "_clear"), aligned(DMA_ALIGN)))
85 #define IN_DMA_SECTION(var) var __attribute__ ((section(DMA_SECTION "_init"), aligned(DMA_ALIGN)))
86 
87 #endif
88