Initial commit

Dependencies:   FastPWM

Committer:
lypinator
Date:
Wed Sep 16 01:11:49 2020 +0000
Revision:
0:bb348c97df44
Added PWM

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lypinator 0:bb348c97df44 1 /**************************************************************************//**
lypinator 0:bb348c97df44 2 * @file cmsis_compiler.h
lypinator 0:bb348c97df44 3 * @brief CMSIS compiler generic header file
lypinator 0:bb348c97df44 4 * @version V5.0.4
lypinator 0:bb348c97df44 5 * @date 10. January 2018
lypinator 0:bb348c97df44 6 ******************************************************************************/
lypinator 0:bb348c97df44 7 /*
lypinator 0:bb348c97df44 8 * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
lypinator 0:bb348c97df44 9 *
lypinator 0:bb348c97df44 10 * SPDX-License-Identifier: Apache-2.0
lypinator 0:bb348c97df44 11 *
lypinator 0:bb348c97df44 12 * Licensed under the Apache License, Version 2.0 (the License); you may
lypinator 0:bb348c97df44 13 * not use this file except in compliance with the License.
lypinator 0:bb348c97df44 14 * You may obtain a copy of the License at
lypinator 0:bb348c97df44 15 *
lypinator 0:bb348c97df44 16 * www.apache.org/licenses/LICENSE-2.0
lypinator 0:bb348c97df44 17 *
lypinator 0:bb348c97df44 18 * Unless required by applicable law or agreed to in writing, software
lypinator 0:bb348c97df44 19 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
lypinator 0:bb348c97df44 20 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
lypinator 0:bb348c97df44 21 * See the License for the specific language governing permissions and
lypinator 0:bb348c97df44 22 * limitations under the License.
lypinator 0:bb348c97df44 23 */
lypinator 0:bb348c97df44 24
lypinator 0:bb348c97df44 25 #ifndef __CMSIS_COMPILER_H
lypinator 0:bb348c97df44 26 #define __CMSIS_COMPILER_H
lypinator 0:bb348c97df44 27
lypinator 0:bb348c97df44 28 #include <stdint.h>
lypinator 0:bb348c97df44 29
lypinator 0:bb348c97df44 30 /*
lypinator 0:bb348c97df44 31 * Arm Compiler 4/5
lypinator 0:bb348c97df44 32 */
lypinator 0:bb348c97df44 33 #if defined ( __CC_ARM )
lypinator 0:bb348c97df44 34 #include "cmsis_armcc.h"
lypinator 0:bb348c97df44 35
lypinator 0:bb348c97df44 36
lypinator 0:bb348c97df44 37 /*
lypinator 0:bb348c97df44 38 * Arm Compiler 6 (armclang)
lypinator 0:bb348c97df44 39 */
lypinator 0:bb348c97df44 40 #elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
lypinator 0:bb348c97df44 41 #include "cmsis_armclang.h"
lypinator 0:bb348c97df44 42
lypinator 0:bb348c97df44 43
lypinator 0:bb348c97df44 44 /*
lypinator 0:bb348c97df44 45 * GNU Compiler
lypinator 0:bb348c97df44 46 */
lypinator 0:bb348c97df44 47 #elif defined ( __GNUC__ )
lypinator 0:bb348c97df44 48 #include "cmsis_gcc.h"
lypinator 0:bb348c97df44 49
lypinator 0:bb348c97df44 50
lypinator 0:bb348c97df44 51 /*
lypinator 0:bb348c97df44 52 * IAR Compiler
lypinator 0:bb348c97df44 53 */
lypinator 0:bb348c97df44 54 #elif defined ( __ICCARM__ )
lypinator 0:bb348c97df44 55 #include <cmsis_iccarm.h>
lypinator 0:bb348c97df44 56
lypinator 0:bb348c97df44 57
lypinator 0:bb348c97df44 58 /*
lypinator 0:bb348c97df44 59 * TI Arm Compiler
lypinator 0:bb348c97df44 60 */
lypinator 0:bb348c97df44 61 #elif defined ( __TI_ARM__ )
lypinator 0:bb348c97df44 62 #include <cmsis_ccs.h>
lypinator 0:bb348c97df44 63
lypinator 0:bb348c97df44 64 #ifndef __ASM
lypinator 0:bb348c97df44 65 #define __ASM __asm
lypinator 0:bb348c97df44 66 #endif
lypinator 0:bb348c97df44 67 #ifndef __INLINE
lypinator 0:bb348c97df44 68 #define __INLINE inline
lypinator 0:bb348c97df44 69 #endif
lypinator 0:bb348c97df44 70 #ifndef __STATIC_INLINE
lypinator 0:bb348c97df44 71 #define __STATIC_INLINE static inline
lypinator 0:bb348c97df44 72 #endif
lypinator 0:bb348c97df44 73 #ifndef __STATIC_FORCEINLINE
lypinator 0:bb348c97df44 74 #define __STATIC_FORCEINLINE __STATIC_INLINE
lypinator 0:bb348c97df44 75 #endif
lypinator 0:bb348c97df44 76 #ifndef __NO_RETURN
lypinator 0:bb348c97df44 77 #define __NO_RETURN __attribute__((noreturn))
lypinator 0:bb348c97df44 78 #endif
lypinator 0:bb348c97df44 79 #ifndef __USED
lypinator 0:bb348c97df44 80 #define __USED __attribute__((used))
lypinator 0:bb348c97df44 81 #endif
lypinator 0:bb348c97df44 82 #ifndef __WEAK
lypinator 0:bb348c97df44 83 #define __WEAK __attribute__((weak))
lypinator 0:bb348c97df44 84 #endif
lypinator 0:bb348c97df44 85 #ifndef __PACKED
lypinator 0:bb348c97df44 86 #define __PACKED __attribute__((packed))
lypinator 0:bb348c97df44 87 #endif
lypinator 0:bb348c97df44 88 #ifndef __PACKED_STRUCT
lypinator 0:bb348c97df44 89 #define __PACKED_STRUCT struct __attribute__((packed))
lypinator 0:bb348c97df44 90 #endif
lypinator 0:bb348c97df44 91 #ifndef __PACKED_UNION
lypinator 0:bb348c97df44 92 #define __PACKED_UNION union __attribute__((packed))
lypinator 0:bb348c97df44 93 #endif
lypinator 0:bb348c97df44 94 #ifndef __UNALIGNED_UINT32 /* deprecated */
lypinator 0:bb348c97df44 95 struct __attribute__((packed)) T_UINT32 { uint32_t v; };
lypinator 0:bb348c97df44 96 #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v)
lypinator 0:bb348c97df44 97 #endif
lypinator 0:bb348c97df44 98 #ifndef __UNALIGNED_UINT16_WRITE
lypinator 0:bb348c97df44 99 __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };
lypinator 0:bb348c97df44 100 #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void*)(addr))->v) = (val))
lypinator 0:bb348c97df44 101 #endif
lypinator 0:bb348c97df44 102 #ifndef __UNALIGNED_UINT16_READ
lypinator 0:bb348c97df44 103 __PACKED_STRUCT T_UINT16_READ { uint16_t v; };
lypinator 0:bb348c97df44 104 #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v)
lypinator 0:bb348c97df44 105 #endif
lypinator 0:bb348c97df44 106 #ifndef __UNALIGNED_UINT32_WRITE
lypinator 0:bb348c97df44 107 __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; };
lypinator 0:bb348c97df44 108 #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))
lypinator 0:bb348c97df44 109 #endif
lypinator 0:bb348c97df44 110 #ifndef __UNALIGNED_UINT32_READ
lypinator 0:bb348c97df44 111 __PACKED_STRUCT T_UINT32_READ { uint32_t v; };
lypinator 0:bb348c97df44 112 #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v)
lypinator 0:bb348c97df44 113 #endif
lypinator 0:bb348c97df44 114 #ifndef __ALIGNED
lypinator 0:bb348c97df44 115 #define __ALIGNED(x) __attribute__((aligned(x)))
lypinator 0:bb348c97df44 116 #endif
lypinator 0:bb348c97df44 117 #ifndef __RESTRICT
lypinator 0:bb348c97df44 118 #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored.
lypinator 0:bb348c97df44 119 #define __RESTRICT
lypinator 0:bb348c97df44 120 #endif
lypinator 0:bb348c97df44 121
lypinator 0:bb348c97df44 122
lypinator 0:bb348c97df44 123 /*
lypinator 0:bb348c97df44 124 * TASKING Compiler
lypinator 0:bb348c97df44 125 */
lypinator 0:bb348c97df44 126 #elif defined ( __TASKING__ )
lypinator 0:bb348c97df44 127 /*
lypinator 0:bb348c97df44 128 * The CMSIS functions have been implemented as intrinsics in the compiler.
lypinator 0:bb348c97df44 129 * Please use "carm -?i" to get an up to date list of all intrinsics,
lypinator 0:bb348c97df44 130 * Including the CMSIS ones.
lypinator 0:bb348c97df44 131 */
lypinator 0:bb348c97df44 132
lypinator 0:bb348c97df44 133 #ifndef __ASM
lypinator 0:bb348c97df44 134 #define __ASM __asm
lypinator 0:bb348c97df44 135 #endif
lypinator 0:bb348c97df44 136 #ifndef __INLINE
lypinator 0:bb348c97df44 137 #define __INLINE inline
lypinator 0:bb348c97df44 138 #endif
lypinator 0:bb348c97df44 139 #ifndef __STATIC_INLINE
lypinator 0:bb348c97df44 140 #define __STATIC_INLINE static inline
lypinator 0:bb348c97df44 141 #endif
lypinator 0:bb348c97df44 142 #ifndef __STATIC_FORCEINLINE
lypinator 0:bb348c97df44 143 #define __STATIC_FORCEINLINE __STATIC_INLINE
lypinator 0:bb348c97df44 144 #endif
lypinator 0:bb348c97df44 145 #ifndef __NO_RETURN
lypinator 0:bb348c97df44 146 #define __NO_RETURN __attribute__((noreturn))
lypinator 0:bb348c97df44 147 #endif
lypinator 0:bb348c97df44 148 #ifndef __USED
lypinator 0:bb348c97df44 149 #define __USED __attribute__((used))
lypinator 0:bb348c97df44 150 #endif
lypinator 0:bb348c97df44 151 #ifndef __WEAK
lypinator 0:bb348c97df44 152 #define __WEAK __attribute__((weak))
lypinator 0:bb348c97df44 153 #endif
lypinator 0:bb348c97df44 154 #ifndef __PACKED
lypinator 0:bb348c97df44 155 #define __PACKED __packed__
lypinator 0:bb348c97df44 156 #endif
lypinator 0:bb348c97df44 157 #ifndef __PACKED_STRUCT
lypinator 0:bb348c97df44 158 #define __PACKED_STRUCT struct __packed__
lypinator 0:bb348c97df44 159 #endif
lypinator 0:bb348c97df44 160 #ifndef __PACKED_UNION
lypinator 0:bb348c97df44 161 #define __PACKED_UNION union __packed__
lypinator 0:bb348c97df44 162 #endif
lypinator 0:bb348c97df44 163 #ifndef __UNALIGNED_UINT32 /* deprecated */
lypinator 0:bb348c97df44 164 struct __packed__ T_UINT32 { uint32_t v; };
lypinator 0:bb348c97df44 165 #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v)
lypinator 0:bb348c97df44 166 #endif
lypinator 0:bb348c97df44 167 #ifndef __UNALIGNED_UINT16_WRITE
lypinator 0:bb348c97df44 168 __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };
lypinator 0:bb348c97df44 169 #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val))
lypinator 0:bb348c97df44 170 #endif
lypinator 0:bb348c97df44 171 #ifndef __UNALIGNED_UINT16_READ
lypinator 0:bb348c97df44 172 __PACKED_STRUCT T_UINT16_READ { uint16_t v; };
lypinator 0:bb348c97df44 173 #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v)
lypinator 0:bb348c97df44 174 #endif
lypinator 0:bb348c97df44 175 #ifndef __UNALIGNED_UINT32_WRITE
lypinator 0:bb348c97df44 176 __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; };
lypinator 0:bb348c97df44 177 #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))
lypinator 0:bb348c97df44 178 #endif
lypinator 0:bb348c97df44 179 #ifndef __UNALIGNED_UINT32_READ
lypinator 0:bb348c97df44 180 __PACKED_STRUCT T_UINT32_READ { uint32_t v; };
lypinator 0:bb348c97df44 181 #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v)
lypinator 0:bb348c97df44 182 #endif
lypinator 0:bb348c97df44 183 #ifndef __ALIGNED
lypinator 0:bb348c97df44 184 #define __ALIGNED(x) __align(x)
lypinator 0:bb348c97df44 185 #endif
lypinator 0:bb348c97df44 186 #ifndef __RESTRICT
lypinator 0:bb348c97df44 187 #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored.
lypinator 0:bb348c97df44 188 #define __RESTRICT
lypinator 0:bb348c97df44 189 #endif
lypinator 0:bb348c97df44 190
lypinator 0:bb348c97df44 191
lypinator 0:bb348c97df44 192 /*
lypinator 0:bb348c97df44 193 * COSMIC Compiler
lypinator 0:bb348c97df44 194 */
lypinator 0:bb348c97df44 195 #elif defined ( __CSMC__ )
lypinator 0:bb348c97df44 196 #include <cmsis_csm.h>
lypinator 0:bb348c97df44 197
lypinator 0:bb348c97df44 198 #ifndef __ASM
lypinator 0:bb348c97df44 199 #define __ASM _asm
lypinator 0:bb348c97df44 200 #endif
lypinator 0:bb348c97df44 201 #ifndef __INLINE
lypinator 0:bb348c97df44 202 #define __INLINE inline
lypinator 0:bb348c97df44 203 #endif
lypinator 0:bb348c97df44 204 #ifndef __STATIC_INLINE
lypinator 0:bb348c97df44 205 #define __STATIC_INLINE static inline
lypinator 0:bb348c97df44 206 #endif
lypinator 0:bb348c97df44 207 #ifndef __STATIC_FORCEINLINE
lypinator 0:bb348c97df44 208 #define __STATIC_FORCEINLINE __STATIC_INLINE
lypinator 0:bb348c97df44 209 #endif
lypinator 0:bb348c97df44 210 #ifndef __NO_RETURN
lypinator 0:bb348c97df44 211 // NO RETURN is automatically detected hence no warning here
lypinator 0:bb348c97df44 212 #define __NO_RETURN
lypinator 0:bb348c97df44 213 #endif
lypinator 0:bb348c97df44 214 #ifndef __USED
lypinator 0:bb348c97df44 215 #warning No compiler specific solution for __USED. __USED is ignored.
lypinator 0:bb348c97df44 216 #define __USED
lypinator 0:bb348c97df44 217 #endif
lypinator 0:bb348c97df44 218 #ifndef __WEAK
lypinator 0:bb348c97df44 219 #define __WEAK __weak
lypinator 0:bb348c97df44 220 #endif
lypinator 0:bb348c97df44 221 #ifndef __PACKED
lypinator 0:bb348c97df44 222 #define __PACKED @packed
lypinator 0:bb348c97df44 223 #endif
lypinator 0:bb348c97df44 224 #ifndef __PACKED_STRUCT
lypinator 0:bb348c97df44 225 #define __PACKED_STRUCT @packed struct
lypinator 0:bb348c97df44 226 #endif
lypinator 0:bb348c97df44 227 #ifndef __PACKED_UNION
lypinator 0:bb348c97df44 228 #define __PACKED_UNION @packed union
lypinator 0:bb348c97df44 229 #endif
lypinator 0:bb348c97df44 230 #ifndef __UNALIGNED_UINT32 /* deprecated */
lypinator 0:bb348c97df44 231 @packed struct T_UINT32 { uint32_t v; };
lypinator 0:bb348c97df44 232 #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v)
lypinator 0:bb348c97df44 233 #endif
lypinator 0:bb348c97df44 234 #ifndef __UNALIGNED_UINT16_WRITE
lypinator 0:bb348c97df44 235 __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };
lypinator 0:bb348c97df44 236 #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val))
lypinator 0:bb348c97df44 237 #endif
lypinator 0:bb348c97df44 238 #ifndef __UNALIGNED_UINT16_READ
lypinator 0:bb348c97df44 239 __PACKED_STRUCT T_UINT16_READ { uint16_t v; };
lypinator 0:bb348c97df44 240 #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v)
lypinator 0:bb348c97df44 241 #endif
lypinator 0:bb348c97df44 242 #ifndef __UNALIGNED_UINT32_WRITE
lypinator 0:bb348c97df44 243 __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; };
lypinator 0:bb348c97df44 244 #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))
lypinator 0:bb348c97df44 245 #endif
lypinator 0:bb348c97df44 246 #ifndef __UNALIGNED_UINT32_READ
lypinator 0:bb348c97df44 247 __PACKED_STRUCT T_UINT32_READ { uint32_t v; };
lypinator 0:bb348c97df44 248 #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v)
lypinator 0:bb348c97df44 249 #endif
lypinator 0:bb348c97df44 250 #ifndef __ALIGNED
lypinator 0:bb348c97df44 251 #warning No compiler specific solution for __ALIGNED. __ALIGNED is ignored.
lypinator 0:bb348c97df44 252 #define __ALIGNED(x)
lypinator 0:bb348c97df44 253 #endif
lypinator 0:bb348c97df44 254 #ifndef __RESTRICT
lypinator 0:bb348c97df44 255 #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored.
lypinator 0:bb348c97df44 256 #define __RESTRICT
lypinator 0:bb348c97df44 257 #endif
lypinator 0:bb348c97df44 258
lypinator 0:bb348c97df44 259
lypinator 0:bb348c97df44 260 #else
lypinator 0:bb348c97df44 261 #error Unknown compiler.
lypinator 0:bb348c97df44 262 #endif
lypinator 0:bb348c97df44 263
lypinator 0:bb348c97df44 264
lypinator 0:bb348c97df44 265 #endif /* __CMSIS_COMPILER_H */
lypinator 0:bb348c97df44 266