The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
<>
Date:
Mon Jan 16 12:05:23 2017 +0000
Revision:
134:ad3be0349dc5
Parent:
119:aae6fcc7d9bb
Release 134 of the mbed library

Ports for Upcoming Targets


Fixes and Changes

3488: Dev stm i2c v2 unitary functions https://github.com/ARMmbed/mbed-os/pull/3488
3492: Fix #3463 CAN read() return value https://github.com/ARMmbed/mbed-os/pull/3492
3503: [LPC15xx] Ensure that PWM=1 is resolved correctly https://github.com/ARMmbed/mbed-os/pull/3503
3504: [LPC15xx] CAN implementation improvements https://github.com/ARMmbed/mbed-os/pull/3504
3539: NUCLEO_F412ZG - Add support of TRNG peripheral https://github.com/ARMmbed/mbed-os/pull/3539
3540: STM: SPI: Initialize Rx in spi_master_write https://github.com/ARMmbed/mbed-os/pull/3540
3438: K64F: Add support for SERIAL ASYNCH API https://github.com/ARMmbed/mbed-os/pull/3438
3519: MCUXpresso: Fix ENET driver to enable interrupts after interrupt handler is set https://github.com/ARMmbed/mbed-os/pull/3519
3544: STM32L4 deepsleep improvement https://github.com/ARMmbed/mbed-os/pull/3544
3546: NUCLEO-F412ZG - Add CAN peripheral https://github.com/ARMmbed/mbed-os/pull/3546
3551: Fix I2C driver for RZ/A1H https://github.com/ARMmbed/mbed-os/pull/3551
3558: K64F UART Asynch API: Fix synchronization issue https://github.com/ARMmbed/mbed-os/pull/3558
3563: LPC4088 - Fix vector checksum https://github.com/ARMmbed/mbed-os/pull/3563
3567: Dev stm32 F0 v1.7.0 https://github.com/ARMmbed/mbed-os/pull/3567
3577: Fixes linking errors when building with debug profile https://github.com/ARMmbed/mbed-os/pull/3577

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 119:aae6fcc7d9bb 1 /**************************************************************************//**
Kojto 119:aae6fcc7d9bb 2 * @file core_cmInstr.h
Kojto 119:aae6fcc7d9bb 3 * @brief CMSIS Cortex-M Core Instruction Access Header File
Kojto 119:aae6fcc7d9bb 4 * @version V4.10
Kojto 119:aae6fcc7d9bb 5 * @date 18. March 2015
Kojto 119:aae6fcc7d9bb 6 *
Kojto 119:aae6fcc7d9bb 7 * @note
Kojto 119:aae6fcc7d9bb 8 *
Kojto 119:aae6fcc7d9bb 9 ******************************************************************************/
Kojto 119:aae6fcc7d9bb 10 /* Copyright (c) 2009 - 2014 ARM LIMITED
Kojto 119:aae6fcc7d9bb 11
Kojto 119:aae6fcc7d9bb 12 All rights reserved.
Kojto 119:aae6fcc7d9bb 13 Redistribution and use in source and binary forms, with or without
Kojto 119:aae6fcc7d9bb 14 modification, are permitted provided that the following conditions are met:
Kojto 119:aae6fcc7d9bb 15 - Redistributions of source code must retain the above copyright
Kojto 119:aae6fcc7d9bb 16 notice, this list of conditions and the following disclaimer.
Kojto 119:aae6fcc7d9bb 17 - Redistributions in binary form must reproduce the above copyright
Kojto 119:aae6fcc7d9bb 18 notice, this list of conditions and the following disclaimer in the
Kojto 119:aae6fcc7d9bb 19 documentation and/or other materials provided with the distribution.
Kojto 119:aae6fcc7d9bb 20 - Neither the name of ARM nor the names of its contributors may be used
Kojto 119:aae6fcc7d9bb 21 to endorse or promote products derived from this software without
Kojto 119:aae6fcc7d9bb 22 specific prior written permission.
Kojto 119:aae6fcc7d9bb 23 *
Kojto 119:aae6fcc7d9bb 24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 119:aae6fcc7d9bb 25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 119:aae6fcc7d9bb 26 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Kojto 119:aae6fcc7d9bb 27 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
Kojto 119:aae6fcc7d9bb 28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
Kojto 119:aae6fcc7d9bb 29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
Kojto 119:aae6fcc7d9bb 30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
Kojto 119:aae6fcc7d9bb 31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
Kojto 119:aae6fcc7d9bb 32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
Kojto 119:aae6fcc7d9bb 33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
Kojto 119:aae6fcc7d9bb 34 POSSIBILITY OF SUCH DAMAGE.
Kojto 119:aae6fcc7d9bb 35 ---------------------------------------------------------------------------*/
Kojto 119:aae6fcc7d9bb 36
Kojto 119:aae6fcc7d9bb 37
Kojto 119:aae6fcc7d9bb 38 #ifndef __CORE_CMINSTR_H
Kojto 119:aae6fcc7d9bb 39 #define __CORE_CMINSTR_H
Kojto 119:aae6fcc7d9bb 40
Kojto 119:aae6fcc7d9bb 41
Kojto 119:aae6fcc7d9bb 42 /* ########################## Core Instruction Access ######################### */
Kojto 119:aae6fcc7d9bb 43 /** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface
Kojto 119:aae6fcc7d9bb 44 Access to dedicated instructions
Kojto 119:aae6fcc7d9bb 45 @{
Kojto 119:aae6fcc7d9bb 46 */
Kojto 119:aae6fcc7d9bb 47
Kojto 119:aae6fcc7d9bb 48 #if defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/
Kojto 119:aae6fcc7d9bb 49 /* ARM armcc specific functions */
Kojto 119:aae6fcc7d9bb 50
Kojto 119:aae6fcc7d9bb 51 #if (__ARMCC_VERSION < 400677)
Kojto 119:aae6fcc7d9bb 52 #error "Please use ARM Compiler Toolchain V4.0.677 or later!"
Kojto 119:aae6fcc7d9bb 53 #endif
Kojto 119:aae6fcc7d9bb 54
Kojto 119:aae6fcc7d9bb 55
Kojto 119:aae6fcc7d9bb 56 /** \brief No Operation
Kojto 119:aae6fcc7d9bb 57
Kojto 119:aae6fcc7d9bb 58 No Operation does nothing. This instruction can be used for code alignment purposes.
Kojto 119:aae6fcc7d9bb 59 */
Kojto 119:aae6fcc7d9bb 60 #define __NOP __nop
Kojto 119:aae6fcc7d9bb 61
Kojto 119:aae6fcc7d9bb 62
Kojto 119:aae6fcc7d9bb 63 /** \brief Wait For Interrupt
Kojto 119:aae6fcc7d9bb 64
Kojto 119:aae6fcc7d9bb 65 Wait For Interrupt is a hint instruction that suspends execution
Kojto 119:aae6fcc7d9bb 66 until one of a number of events occurs.
Kojto 119:aae6fcc7d9bb 67 */
Kojto 119:aae6fcc7d9bb 68 #define __WFI __wfi
Kojto 119:aae6fcc7d9bb 69
Kojto 119:aae6fcc7d9bb 70
Kojto 119:aae6fcc7d9bb 71 /** \brief Wait For Event
Kojto 119:aae6fcc7d9bb 72
Kojto 119:aae6fcc7d9bb 73 Wait For Event is a hint instruction that permits the processor to enter
Kojto 119:aae6fcc7d9bb 74 a low-power state until one of a number of events occurs.
Kojto 119:aae6fcc7d9bb 75 */
Kojto 119:aae6fcc7d9bb 76 #define __WFE __wfe
Kojto 119:aae6fcc7d9bb 77
Kojto 119:aae6fcc7d9bb 78
Kojto 119:aae6fcc7d9bb 79 /** \brief Send Event
Kojto 119:aae6fcc7d9bb 80
Kojto 119:aae6fcc7d9bb 81 Send Event is a hint instruction. It causes an event to be signaled to the CPU.
Kojto 119:aae6fcc7d9bb 82 */
Kojto 119:aae6fcc7d9bb 83 #define __SEV __sev
Kojto 119:aae6fcc7d9bb 84
Kojto 119:aae6fcc7d9bb 85
Kojto 119:aae6fcc7d9bb 86 /** \brief Instruction Synchronization Barrier
Kojto 119:aae6fcc7d9bb 87
Kojto 119:aae6fcc7d9bb 88 Instruction Synchronization Barrier flushes the pipeline in the processor,
Kojto 119:aae6fcc7d9bb 89 so that all instructions following the ISB are fetched from cache or
Kojto 119:aae6fcc7d9bb 90 memory, after the instruction has been completed.
Kojto 119:aae6fcc7d9bb 91 */
Kojto 119:aae6fcc7d9bb 92 #define __ISB() do {\
Kojto 119:aae6fcc7d9bb 93 __schedule_barrier();\
Kojto 119:aae6fcc7d9bb 94 __isb(0xF);\
Kojto 119:aae6fcc7d9bb 95 __schedule_barrier();\
Kojto 119:aae6fcc7d9bb 96 } while (0)
Kojto 119:aae6fcc7d9bb 97
Kojto 119:aae6fcc7d9bb 98 /** \brief Data Synchronization Barrier
Kojto 119:aae6fcc7d9bb 99
Kojto 119:aae6fcc7d9bb 100 This function acts as a special kind of Data Memory Barrier.
Kojto 119:aae6fcc7d9bb 101 It completes when all explicit memory accesses before this instruction complete.
Kojto 119:aae6fcc7d9bb 102 */
Kojto 119:aae6fcc7d9bb 103 #define __DSB() do {\
Kojto 119:aae6fcc7d9bb 104 __schedule_barrier();\
Kojto 119:aae6fcc7d9bb 105 __dsb(0xF);\
Kojto 119:aae6fcc7d9bb 106 __schedule_barrier();\
Kojto 119:aae6fcc7d9bb 107 } while (0)
Kojto 119:aae6fcc7d9bb 108
Kojto 119:aae6fcc7d9bb 109 /** \brief Data Memory Barrier
Kojto 119:aae6fcc7d9bb 110
Kojto 119:aae6fcc7d9bb 111 This function ensures the apparent order of the explicit memory operations before
Kojto 119:aae6fcc7d9bb 112 and after the instruction, without ensuring their completion.
Kojto 119:aae6fcc7d9bb 113 */
Kojto 119:aae6fcc7d9bb 114 #define __DMB() do {\
Kojto 119:aae6fcc7d9bb 115 __schedule_barrier();\
Kojto 119:aae6fcc7d9bb 116 __dmb(0xF);\
Kojto 119:aae6fcc7d9bb 117 __schedule_barrier();\
Kojto 119:aae6fcc7d9bb 118 } while (0)
Kojto 119:aae6fcc7d9bb 119
Kojto 119:aae6fcc7d9bb 120 /** \brief Reverse byte order (32 bit)
Kojto 119:aae6fcc7d9bb 121
Kojto 119:aae6fcc7d9bb 122 This function reverses the byte order in integer value.
Kojto 119:aae6fcc7d9bb 123
Kojto 119:aae6fcc7d9bb 124 \param [in] value Value to reverse
Kojto 119:aae6fcc7d9bb 125 \return Reversed value
Kojto 119:aae6fcc7d9bb 126 */
Kojto 119:aae6fcc7d9bb 127 #define __REV __rev
Kojto 119:aae6fcc7d9bb 128
Kojto 119:aae6fcc7d9bb 129
Kojto 119:aae6fcc7d9bb 130 /** \brief Reverse byte order (16 bit)
Kojto 119:aae6fcc7d9bb 131
Kojto 119:aae6fcc7d9bb 132 This function reverses the byte order in two unsigned short values.
Kojto 119:aae6fcc7d9bb 133
Kojto 119:aae6fcc7d9bb 134 \param [in] value Value to reverse
Kojto 119:aae6fcc7d9bb 135 \return Reversed value
Kojto 119:aae6fcc7d9bb 136 */
Kojto 119:aae6fcc7d9bb 137 #ifndef __NO_EMBEDDED_ASM
Kojto 119:aae6fcc7d9bb 138 __attribute__((section(".rev16_text"))) __STATIC_INLINE __ASM uint32_t __REV16(uint32_t value)
Kojto 119:aae6fcc7d9bb 139 {
Kojto 119:aae6fcc7d9bb 140 rev16 r0, r0
Kojto 119:aae6fcc7d9bb 141 bx lr
Kojto 119:aae6fcc7d9bb 142 }
Kojto 119:aae6fcc7d9bb 143 #endif
Kojto 119:aae6fcc7d9bb 144
Kojto 119:aae6fcc7d9bb 145 /** \brief Reverse byte order in signed short value
Kojto 119:aae6fcc7d9bb 146
Kojto 119:aae6fcc7d9bb 147 This function reverses the byte order in a signed short value with sign extension to integer.
Kojto 119:aae6fcc7d9bb 148
Kojto 119:aae6fcc7d9bb 149 \param [in] value Value to reverse
Kojto 119:aae6fcc7d9bb 150 \return Reversed value
Kojto 119:aae6fcc7d9bb 151 */
Kojto 119:aae6fcc7d9bb 152 #ifndef __NO_EMBEDDED_ASM
Kojto 119:aae6fcc7d9bb 153 __attribute__((section(".revsh_text"))) __STATIC_INLINE __ASM int32_t __REVSH(int32_t value)
Kojto 119:aae6fcc7d9bb 154 {
Kojto 119:aae6fcc7d9bb 155 revsh r0, r0
Kojto 119:aae6fcc7d9bb 156 bx lr
Kojto 119:aae6fcc7d9bb 157 }
Kojto 119:aae6fcc7d9bb 158 #endif
Kojto 119:aae6fcc7d9bb 159
Kojto 119:aae6fcc7d9bb 160
Kojto 119:aae6fcc7d9bb 161 /** \brief Rotate Right in unsigned value (32 bit)
Kojto 119:aae6fcc7d9bb 162
Kojto 119:aae6fcc7d9bb 163 This function Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits.
Kojto 119:aae6fcc7d9bb 164
Kojto 119:aae6fcc7d9bb 165 \param [in] value Value to rotate
Kojto 119:aae6fcc7d9bb 166 \param [in] value Number of Bits to rotate
Kojto 119:aae6fcc7d9bb 167 \return Rotated value
Kojto 119:aae6fcc7d9bb 168 */
Kojto 119:aae6fcc7d9bb 169 #define __ROR __ror
Kojto 119:aae6fcc7d9bb 170
Kojto 119:aae6fcc7d9bb 171
Kojto 119:aae6fcc7d9bb 172 /** \brief Breakpoint
Kojto 119:aae6fcc7d9bb 173
Kojto 119:aae6fcc7d9bb 174 This function causes the processor to enter Debug state.
Kojto 119:aae6fcc7d9bb 175 Debug tools can use this to investigate system state when the instruction at a particular address is reached.
Kojto 119:aae6fcc7d9bb 176
Kojto 119:aae6fcc7d9bb 177 \param [in] value is ignored by the processor.
Kojto 119:aae6fcc7d9bb 178 If required, a debugger can use it to store additional information about the breakpoint.
Kojto 119:aae6fcc7d9bb 179 */
Kojto 119:aae6fcc7d9bb 180 #define __BKPT(value) __breakpoint(value)
Kojto 119:aae6fcc7d9bb 181
Kojto 119:aae6fcc7d9bb 182
Kojto 119:aae6fcc7d9bb 183 /** \brief Reverse bit order of value
Kojto 119:aae6fcc7d9bb 184
Kojto 119:aae6fcc7d9bb 185 This function reverses the bit order of the given value.
Kojto 119:aae6fcc7d9bb 186
Kojto 119:aae6fcc7d9bb 187 \param [in] value Value to reverse
Kojto 119:aae6fcc7d9bb 188 \return Reversed value
Kojto 119:aae6fcc7d9bb 189 */
Kojto 119:aae6fcc7d9bb 190 #if (__CORTEX_M >= 0x03) || (__CORTEX_SC >= 300)
Kojto 119:aae6fcc7d9bb 191 #define __RBIT __rbit
Kojto 119:aae6fcc7d9bb 192 #else
Kojto 119:aae6fcc7d9bb 193 __attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value)
Kojto 119:aae6fcc7d9bb 194 {
Kojto 119:aae6fcc7d9bb 195 uint32_t result;
Kojto 119:aae6fcc7d9bb 196 int32_t s = 4 /*sizeof(v)*/ * 8 - 1; // extra shift needed at end
Kojto 119:aae6fcc7d9bb 197
Kojto 119:aae6fcc7d9bb 198 result = value; // r will be reversed bits of v; first get LSB of v
Kojto 119:aae6fcc7d9bb 199 for (value >>= 1; value; value >>= 1)
Kojto 119:aae6fcc7d9bb 200 {
Kojto 119:aae6fcc7d9bb 201 result <<= 1;
Kojto 119:aae6fcc7d9bb 202 result |= value & 1;
Kojto 119:aae6fcc7d9bb 203 s--;
Kojto 119:aae6fcc7d9bb 204 }
Kojto 119:aae6fcc7d9bb 205 result <<= s; // shift when v's highest bits are zero
Kojto 119:aae6fcc7d9bb 206 return(result);
Kojto 119:aae6fcc7d9bb 207 }
Kojto 119:aae6fcc7d9bb 208 #endif
Kojto 119:aae6fcc7d9bb 209
Kojto 119:aae6fcc7d9bb 210
Kojto 119:aae6fcc7d9bb 211 /** \brief Count leading zeros
Kojto 119:aae6fcc7d9bb 212
Kojto 119:aae6fcc7d9bb 213 This function counts the number of leading zeros of a data value.
Kojto 119:aae6fcc7d9bb 214
Kojto 119:aae6fcc7d9bb 215 \param [in] value Value to count the leading zeros
Kojto 119:aae6fcc7d9bb 216 \return number of leading zeros in value
Kojto 119:aae6fcc7d9bb 217 */
Kojto 119:aae6fcc7d9bb 218 #define __CLZ __clz
Kojto 119:aae6fcc7d9bb 219
Kojto 119:aae6fcc7d9bb 220
Kojto 119:aae6fcc7d9bb 221 #if (__CORTEX_M >= 0x03) || (__CORTEX_SC >= 300)
Kojto 119:aae6fcc7d9bb 222
Kojto 119:aae6fcc7d9bb 223 /** \brief LDR Exclusive (8 bit)
Kojto 119:aae6fcc7d9bb 224
Kojto 119:aae6fcc7d9bb 225 This function executes a exclusive LDR instruction for 8 bit value.
Kojto 119:aae6fcc7d9bb 226
Kojto 119:aae6fcc7d9bb 227 \param [in] ptr Pointer to data
Kojto 119:aae6fcc7d9bb 228 \return value of type uint8_t at (*ptr)
Kojto 119:aae6fcc7d9bb 229 */
Kojto 119:aae6fcc7d9bb 230 #define __LDREXB(ptr) ((uint8_t ) __ldrex(ptr))
Kojto 119:aae6fcc7d9bb 231
Kojto 119:aae6fcc7d9bb 232
Kojto 119:aae6fcc7d9bb 233 /** \brief LDR Exclusive (16 bit)
Kojto 119:aae6fcc7d9bb 234
Kojto 119:aae6fcc7d9bb 235 This function executes a exclusive LDR instruction for 16 bit values.
Kojto 119:aae6fcc7d9bb 236
Kojto 119:aae6fcc7d9bb 237 \param [in] ptr Pointer to data
Kojto 119:aae6fcc7d9bb 238 \return value of type uint16_t at (*ptr)
Kojto 119:aae6fcc7d9bb 239 */
Kojto 119:aae6fcc7d9bb 240 #define __LDREXH(ptr) ((uint16_t) __ldrex(ptr))
Kojto 119:aae6fcc7d9bb 241
Kojto 119:aae6fcc7d9bb 242
Kojto 119:aae6fcc7d9bb 243 /** \brief LDR Exclusive (32 bit)
Kojto 119:aae6fcc7d9bb 244
Kojto 119:aae6fcc7d9bb 245 This function executes a exclusive LDR instruction for 32 bit values.
Kojto 119:aae6fcc7d9bb 246
Kojto 119:aae6fcc7d9bb 247 \param [in] ptr Pointer to data
Kojto 119:aae6fcc7d9bb 248 \return value of type uint32_t at (*ptr)
Kojto 119:aae6fcc7d9bb 249 */
Kojto 119:aae6fcc7d9bb 250 #define __LDREXW(ptr) ((uint32_t ) __ldrex(ptr))
Kojto 119:aae6fcc7d9bb 251
Kojto 119:aae6fcc7d9bb 252
Kojto 119:aae6fcc7d9bb 253 /** \brief STR Exclusive (8 bit)
Kojto 119:aae6fcc7d9bb 254
Kojto 119:aae6fcc7d9bb 255 This function executes a exclusive STR instruction for 8 bit values.
Kojto 119:aae6fcc7d9bb 256
Kojto 119:aae6fcc7d9bb 257 \param [in] value Value to store
Kojto 119:aae6fcc7d9bb 258 \param [in] ptr Pointer to location
Kojto 119:aae6fcc7d9bb 259 \return 0 Function succeeded
Kojto 119:aae6fcc7d9bb 260 \return 1 Function failed
Kojto 119:aae6fcc7d9bb 261 */
Kojto 119:aae6fcc7d9bb 262 #define __STREXB(value, ptr) __strex(value, ptr)
Kojto 119:aae6fcc7d9bb 263
Kojto 119:aae6fcc7d9bb 264
Kojto 119:aae6fcc7d9bb 265 /** \brief STR Exclusive (16 bit)
Kojto 119:aae6fcc7d9bb 266
Kojto 119:aae6fcc7d9bb 267 This function executes a exclusive STR instruction for 16 bit values.
Kojto 119:aae6fcc7d9bb 268
Kojto 119:aae6fcc7d9bb 269 \param [in] value Value to store
Kojto 119:aae6fcc7d9bb 270 \param [in] ptr Pointer to location
Kojto 119:aae6fcc7d9bb 271 \return 0 Function succeeded
Kojto 119:aae6fcc7d9bb 272 \return 1 Function failed
Kojto 119:aae6fcc7d9bb 273 */
Kojto 119:aae6fcc7d9bb 274 #define __STREXH(value, ptr) __strex(value, ptr)
Kojto 119:aae6fcc7d9bb 275
Kojto 119:aae6fcc7d9bb 276
Kojto 119:aae6fcc7d9bb 277 /** \brief STR Exclusive (32 bit)
Kojto 119:aae6fcc7d9bb 278
Kojto 119:aae6fcc7d9bb 279 This function executes a exclusive STR instruction for 32 bit values.
Kojto 119:aae6fcc7d9bb 280
Kojto 119:aae6fcc7d9bb 281 \param [in] value Value to store
Kojto 119:aae6fcc7d9bb 282 \param [in] ptr Pointer to location
Kojto 119:aae6fcc7d9bb 283 \return 0 Function succeeded
Kojto 119:aae6fcc7d9bb 284 \return 1 Function failed
Kojto 119:aae6fcc7d9bb 285 */
Kojto 119:aae6fcc7d9bb 286 #define __STREXW(value, ptr) __strex(value, ptr)
Kojto 119:aae6fcc7d9bb 287
Kojto 119:aae6fcc7d9bb 288
Kojto 119:aae6fcc7d9bb 289 /** \brief Remove the exclusive lock
Kojto 119:aae6fcc7d9bb 290
Kojto 119:aae6fcc7d9bb 291 This function removes the exclusive lock which is created by LDREX.
Kojto 119:aae6fcc7d9bb 292
Kojto 119:aae6fcc7d9bb 293 */
Kojto 119:aae6fcc7d9bb 294 #define __CLREX __clrex
Kojto 119:aae6fcc7d9bb 295
Kojto 119:aae6fcc7d9bb 296
Kojto 119:aae6fcc7d9bb 297 /** \brief Signed Saturate
Kojto 119:aae6fcc7d9bb 298
Kojto 119:aae6fcc7d9bb 299 This function saturates a signed value.
Kojto 119:aae6fcc7d9bb 300
Kojto 119:aae6fcc7d9bb 301 \param [in] value Value to be saturated
Kojto 119:aae6fcc7d9bb 302 \param [in] sat Bit position to saturate to (1..32)
Kojto 119:aae6fcc7d9bb 303 \return Saturated value
Kojto 119:aae6fcc7d9bb 304 */
Kojto 119:aae6fcc7d9bb 305 #define __SSAT __ssat
Kojto 119:aae6fcc7d9bb 306
Kojto 119:aae6fcc7d9bb 307
Kojto 119:aae6fcc7d9bb 308 /** \brief Unsigned Saturate
Kojto 119:aae6fcc7d9bb 309
Kojto 119:aae6fcc7d9bb 310 This function saturates an unsigned value.
Kojto 119:aae6fcc7d9bb 311
Kojto 119:aae6fcc7d9bb 312 \param [in] value Value to be saturated
Kojto 119:aae6fcc7d9bb 313 \param [in] sat Bit position to saturate to (0..31)
Kojto 119:aae6fcc7d9bb 314 \return Saturated value
Kojto 119:aae6fcc7d9bb 315 */
Kojto 119:aae6fcc7d9bb 316 #define __USAT __usat
Kojto 119:aae6fcc7d9bb 317
Kojto 119:aae6fcc7d9bb 318
Kojto 119:aae6fcc7d9bb 319 /** \brief Rotate Right with Extend (32 bit)
Kojto 119:aae6fcc7d9bb 320
Kojto 119:aae6fcc7d9bb 321 This function moves each bit of a bitstring right by one bit.
Kojto 119:aae6fcc7d9bb 322 The carry input is shifted in at the left end of the bitstring.
Kojto 119:aae6fcc7d9bb 323
Kojto 119:aae6fcc7d9bb 324 \param [in] value Value to rotate
Kojto 119:aae6fcc7d9bb 325 \return Rotated value
Kojto 119:aae6fcc7d9bb 326 */
Kojto 119:aae6fcc7d9bb 327 #ifndef __NO_EMBEDDED_ASM
Kojto 119:aae6fcc7d9bb 328 __attribute__((section(".rrx_text"))) __STATIC_INLINE __ASM uint32_t __RRX(uint32_t value)
Kojto 119:aae6fcc7d9bb 329 {
Kojto 119:aae6fcc7d9bb 330 rrx r0, r0
Kojto 119:aae6fcc7d9bb 331 bx lr
Kojto 119:aae6fcc7d9bb 332 }
Kojto 119:aae6fcc7d9bb 333 #endif
Kojto 119:aae6fcc7d9bb 334
Kojto 119:aae6fcc7d9bb 335
Kojto 119:aae6fcc7d9bb 336 /** \brief LDRT Unprivileged (8 bit)
Kojto 119:aae6fcc7d9bb 337
Kojto 119:aae6fcc7d9bb 338 This function executes a Unprivileged LDRT instruction for 8 bit value.
Kojto 119:aae6fcc7d9bb 339
Kojto 119:aae6fcc7d9bb 340 \param [in] ptr Pointer to data
Kojto 119:aae6fcc7d9bb 341 \return value of type uint8_t at (*ptr)
Kojto 119:aae6fcc7d9bb 342 */
Kojto 119:aae6fcc7d9bb 343 #define __LDRBT(ptr) ((uint8_t ) __ldrt(ptr))
Kojto 119:aae6fcc7d9bb 344
Kojto 119:aae6fcc7d9bb 345
Kojto 119:aae6fcc7d9bb 346 /** \brief LDRT Unprivileged (16 bit)
Kojto 119:aae6fcc7d9bb 347
Kojto 119:aae6fcc7d9bb 348 This function executes a Unprivileged LDRT instruction for 16 bit values.
Kojto 119:aae6fcc7d9bb 349
Kojto 119:aae6fcc7d9bb 350 \param [in] ptr Pointer to data
Kojto 119:aae6fcc7d9bb 351 \return value of type uint16_t at (*ptr)
Kojto 119:aae6fcc7d9bb 352 */
Kojto 119:aae6fcc7d9bb 353 #define __LDRHT(ptr) ((uint16_t) __ldrt(ptr))
Kojto 119:aae6fcc7d9bb 354
Kojto 119:aae6fcc7d9bb 355
Kojto 119:aae6fcc7d9bb 356 /** \brief LDRT Unprivileged (32 bit)
Kojto 119:aae6fcc7d9bb 357
Kojto 119:aae6fcc7d9bb 358 This function executes a Unprivileged LDRT instruction for 32 bit values.
Kojto 119:aae6fcc7d9bb 359
Kojto 119:aae6fcc7d9bb 360 \param [in] ptr Pointer to data
Kojto 119:aae6fcc7d9bb 361 \return value of type uint32_t at (*ptr)
Kojto 119:aae6fcc7d9bb 362 */
Kojto 119:aae6fcc7d9bb 363 #define __LDRT(ptr) ((uint32_t ) __ldrt(ptr))
Kojto 119:aae6fcc7d9bb 364
Kojto 119:aae6fcc7d9bb 365
Kojto 119:aae6fcc7d9bb 366 /** \brief STRT Unprivileged (8 bit)
Kojto 119:aae6fcc7d9bb 367
Kojto 119:aae6fcc7d9bb 368 This function executes a Unprivileged STRT instruction for 8 bit values.
Kojto 119:aae6fcc7d9bb 369
Kojto 119:aae6fcc7d9bb 370 \param [in] value Value to store
Kojto 119:aae6fcc7d9bb 371 \param [in] ptr Pointer to location
Kojto 119:aae6fcc7d9bb 372 */
Kojto 119:aae6fcc7d9bb 373 #define __STRBT(value, ptr) __strt(value, ptr)
Kojto 119:aae6fcc7d9bb 374
Kojto 119:aae6fcc7d9bb 375
Kojto 119:aae6fcc7d9bb 376 /** \brief STRT Unprivileged (16 bit)
Kojto 119:aae6fcc7d9bb 377
Kojto 119:aae6fcc7d9bb 378 This function executes a Unprivileged STRT instruction for 16 bit values.
Kojto 119:aae6fcc7d9bb 379
Kojto 119:aae6fcc7d9bb 380 \param [in] value Value to store
Kojto 119:aae6fcc7d9bb 381 \param [in] ptr Pointer to location
Kojto 119:aae6fcc7d9bb 382 */
Kojto 119:aae6fcc7d9bb 383 #define __STRHT(value, ptr) __strt(value, ptr)
Kojto 119:aae6fcc7d9bb 384
Kojto 119:aae6fcc7d9bb 385
Kojto 119:aae6fcc7d9bb 386 /** \brief STRT Unprivileged (32 bit)
Kojto 119:aae6fcc7d9bb 387
Kojto 119:aae6fcc7d9bb 388 This function executes a Unprivileged STRT instruction for 32 bit values.
Kojto 119:aae6fcc7d9bb 389
Kojto 119:aae6fcc7d9bb 390 \param [in] value Value to store
Kojto 119:aae6fcc7d9bb 391 \param [in] ptr Pointer to location
Kojto 119:aae6fcc7d9bb 392 */
Kojto 119:aae6fcc7d9bb 393 #define __STRT(value, ptr) __strt(value, ptr)
Kojto 119:aae6fcc7d9bb 394
Kojto 119:aae6fcc7d9bb 395 #endif /* (__CORTEX_M >= 0x03) || (__CORTEX_SC >= 300) */
Kojto 119:aae6fcc7d9bb 396
Kojto 119:aae6fcc7d9bb 397
Kojto 119:aae6fcc7d9bb 398 #elif defined ( __GNUC__ ) /*------------------ GNU Compiler ---------------------*/
Kojto 119:aae6fcc7d9bb 399 /* GNU gcc specific functions */
Kojto 119:aae6fcc7d9bb 400
Kojto 119:aae6fcc7d9bb 401 /* Define macros for porting to both thumb1 and thumb2.
Kojto 119:aae6fcc7d9bb 402 * For thumb1, use low register (r0-r7), specified by constrant "l"
Kojto 119:aae6fcc7d9bb 403 * Otherwise, use general registers, specified by constrant "r" */
Kojto 119:aae6fcc7d9bb 404 #if defined (__thumb__) && !defined (__thumb2__)
Kojto 119:aae6fcc7d9bb 405 #define __CMSIS_GCC_OUT_REG(r) "=l" (r)
Kojto 119:aae6fcc7d9bb 406 #define __CMSIS_GCC_USE_REG(r) "l" (r)
Kojto 119:aae6fcc7d9bb 407 #else
Kojto 119:aae6fcc7d9bb 408 #define __CMSIS_GCC_OUT_REG(r) "=r" (r)
Kojto 119:aae6fcc7d9bb 409 #define __CMSIS_GCC_USE_REG(r) "r" (r)
Kojto 119:aae6fcc7d9bb 410 #endif
Kojto 119:aae6fcc7d9bb 411
Kojto 119:aae6fcc7d9bb 412 /** \brief No Operation
Kojto 119:aae6fcc7d9bb 413
Kojto 119:aae6fcc7d9bb 414 No Operation does nothing. This instruction can be used for code alignment purposes.
Kojto 119:aae6fcc7d9bb 415 */
Kojto 119:aae6fcc7d9bb 416 __attribute__((always_inline)) __STATIC_INLINE void __NOP(void)
Kojto 119:aae6fcc7d9bb 417 {
Kojto 119:aae6fcc7d9bb 418 __ASM volatile ("nop");
Kojto 119:aae6fcc7d9bb 419 }
Kojto 119:aae6fcc7d9bb 420
Kojto 119:aae6fcc7d9bb 421
Kojto 119:aae6fcc7d9bb 422 /** \brief Wait For Interrupt
Kojto 119:aae6fcc7d9bb 423
Kojto 119:aae6fcc7d9bb 424 Wait For Interrupt is a hint instruction that suspends execution
Kojto 119:aae6fcc7d9bb 425 until one of a number of events occurs.
Kojto 119:aae6fcc7d9bb 426 */
Kojto 119:aae6fcc7d9bb 427 __attribute__((always_inline)) __STATIC_INLINE void __WFI(void)
Kojto 119:aae6fcc7d9bb 428 {
Kojto 119:aae6fcc7d9bb 429 __ASM volatile ("wfi");
Kojto 119:aae6fcc7d9bb 430 }
Kojto 119:aae6fcc7d9bb 431
Kojto 119:aae6fcc7d9bb 432
Kojto 119:aae6fcc7d9bb 433 /** \brief Wait For Event
Kojto 119:aae6fcc7d9bb 434
Kojto 119:aae6fcc7d9bb 435 Wait For Event is a hint instruction that permits the processor to enter
Kojto 119:aae6fcc7d9bb 436 a low-power state until one of a number of events occurs.
Kojto 119:aae6fcc7d9bb 437 */
Kojto 119:aae6fcc7d9bb 438 __attribute__((always_inline)) __STATIC_INLINE void __WFE(void)
Kojto 119:aae6fcc7d9bb 439 {
Kojto 119:aae6fcc7d9bb 440 __ASM volatile ("wfe");
Kojto 119:aae6fcc7d9bb 441 }
Kojto 119:aae6fcc7d9bb 442
Kojto 119:aae6fcc7d9bb 443
Kojto 119:aae6fcc7d9bb 444 /** \brief Send Event
Kojto 119:aae6fcc7d9bb 445
Kojto 119:aae6fcc7d9bb 446 Send Event is a hint instruction. It causes an event to be signaled to the CPU.
Kojto 119:aae6fcc7d9bb 447 */
Kojto 119:aae6fcc7d9bb 448 __attribute__((always_inline)) __STATIC_INLINE void __SEV(void)
Kojto 119:aae6fcc7d9bb 449 {
Kojto 119:aae6fcc7d9bb 450 __ASM volatile ("sev");
Kojto 119:aae6fcc7d9bb 451 }
Kojto 119:aae6fcc7d9bb 452
Kojto 119:aae6fcc7d9bb 453
Kojto 119:aae6fcc7d9bb 454 /** \brief Instruction Synchronization Barrier
Kojto 119:aae6fcc7d9bb 455
Kojto 119:aae6fcc7d9bb 456 Instruction Synchronization Barrier flushes the pipeline in the processor,
Kojto 119:aae6fcc7d9bb 457 so that all instructions following the ISB are fetched from cache or
Kojto 119:aae6fcc7d9bb 458 memory, after the instruction has been completed.
Kojto 119:aae6fcc7d9bb 459 */
Kojto 119:aae6fcc7d9bb 460 __attribute__((always_inline)) __STATIC_INLINE void __ISB(void)
Kojto 119:aae6fcc7d9bb 461 {
Kojto 119:aae6fcc7d9bb 462 __ASM volatile ("isb 0xF":::"memory");
Kojto 119:aae6fcc7d9bb 463 }
Kojto 119:aae6fcc7d9bb 464
Kojto 119:aae6fcc7d9bb 465
Kojto 119:aae6fcc7d9bb 466 /** \brief Data Synchronization Barrier
Kojto 119:aae6fcc7d9bb 467
Kojto 119:aae6fcc7d9bb 468 This function acts as a special kind of Data Memory Barrier.
Kojto 119:aae6fcc7d9bb 469 It completes when all explicit memory accesses before this instruction complete.
Kojto 119:aae6fcc7d9bb 470 */
Kojto 119:aae6fcc7d9bb 471 __attribute__((always_inline)) __STATIC_INLINE void __DSB(void)
Kojto 119:aae6fcc7d9bb 472 {
Kojto 119:aae6fcc7d9bb 473 __ASM volatile ("dsb 0xF":::"memory");
Kojto 119:aae6fcc7d9bb 474 }
Kojto 119:aae6fcc7d9bb 475
Kojto 119:aae6fcc7d9bb 476
Kojto 119:aae6fcc7d9bb 477 /** \brief Data Memory Barrier
Kojto 119:aae6fcc7d9bb 478
Kojto 119:aae6fcc7d9bb 479 This function ensures the apparent order of the explicit memory operations before
Kojto 119:aae6fcc7d9bb 480 and after the instruction, without ensuring their completion.
Kojto 119:aae6fcc7d9bb 481 */
Kojto 119:aae6fcc7d9bb 482 __attribute__((always_inline)) __STATIC_INLINE void __DMB(void)
Kojto 119:aae6fcc7d9bb 483 {
Kojto 119:aae6fcc7d9bb 484 __ASM volatile ("dmb 0xF":::"memory");
Kojto 119:aae6fcc7d9bb 485 }
Kojto 119:aae6fcc7d9bb 486
Kojto 119:aae6fcc7d9bb 487
Kojto 119:aae6fcc7d9bb 488 /** \brief Reverse byte order (32 bit)
Kojto 119:aae6fcc7d9bb 489
Kojto 119:aae6fcc7d9bb 490 This function reverses the byte order in integer value.
Kojto 119:aae6fcc7d9bb 491
Kojto 119:aae6fcc7d9bb 492 \param [in] value Value to reverse
Kojto 119:aae6fcc7d9bb 493 \return Reversed value
Kojto 119:aae6fcc7d9bb 494 */
Kojto 119:aae6fcc7d9bb 495 __attribute__((always_inline)) __STATIC_INLINE uint32_t __REV(uint32_t value)
Kojto 119:aae6fcc7d9bb 496 {
Kojto 119:aae6fcc7d9bb 497 #if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
Kojto 119:aae6fcc7d9bb 498 return __builtin_bswap32(value);
Kojto 119:aae6fcc7d9bb 499 #else
Kojto 119:aae6fcc7d9bb 500 uint32_t result;
Kojto 119:aae6fcc7d9bb 501
Kojto 119:aae6fcc7d9bb 502 __ASM volatile ("rev %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) );
Kojto 119:aae6fcc7d9bb 503 return(result);
Kojto 119:aae6fcc7d9bb 504 #endif
Kojto 119:aae6fcc7d9bb 505 }
Kojto 119:aae6fcc7d9bb 506
Kojto 119:aae6fcc7d9bb 507
Kojto 119:aae6fcc7d9bb 508 /** \brief Reverse byte order (16 bit)
Kojto 119:aae6fcc7d9bb 509
Kojto 119:aae6fcc7d9bb 510 This function reverses the byte order in two unsigned short values.
Kojto 119:aae6fcc7d9bb 511
Kojto 119:aae6fcc7d9bb 512 \param [in] value Value to reverse
Kojto 119:aae6fcc7d9bb 513 \return Reversed value
Kojto 119:aae6fcc7d9bb 514 */
Kojto 119:aae6fcc7d9bb 515 __attribute__((always_inline)) __STATIC_INLINE uint32_t __REV16(uint32_t value)
Kojto 119:aae6fcc7d9bb 516 {
Kojto 119:aae6fcc7d9bb 517 uint32_t result;
Kojto 119:aae6fcc7d9bb 518
Kojto 119:aae6fcc7d9bb 519 __ASM volatile ("rev16 %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) );
Kojto 119:aae6fcc7d9bb 520 return(result);
Kojto 119:aae6fcc7d9bb 521 }
Kojto 119:aae6fcc7d9bb 522
Kojto 119:aae6fcc7d9bb 523
Kojto 119:aae6fcc7d9bb 524 /** \brief Reverse byte order in signed short value
Kojto 119:aae6fcc7d9bb 525
Kojto 119:aae6fcc7d9bb 526 This function reverses the byte order in a signed short value with sign extension to integer.
Kojto 119:aae6fcc7d9bb 527
Kojto 119:aae6fcc7d9bb 528 \param [in] value Value to reverse
Kojto 119:aae6fcc7d9bb 529 \return Reversed value
Kojto 119:aae6fcc7d9bb 530 */
Kojto 119:aae6fcc7d9bb 531 __attribute__((always_inline)) __STATIC_INLINE int32_t __REVSH(int32_t value)
Kojto 119:aae6fcc7d9bb 532 {
Kojto 119:aae6fcc7d9bb 533 #if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
Kojto 119:aae6fcc7d9bb 534 return (short)__builtin_bswap16(value);
Kojto 119:aae6fcc7d9bb 535 #else
Kojto 119:aae6fcc7d9bb 536 uint32_t result;
Kojto 119:aae6fcc7d9bb 537
Kojto 119:aae6fcc7d9bb 538 __ASM volatile ("revsh %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) );
Kojto 119:aae6fcc7d9bb 539 return(result);
Kojto 119:aae6fcc7d9bb 540 #endif
Kojto 119:aae6fcc7d9bb 541 }
Kojto 119:aae6fcc7d9bb 542
Kojto 119:aae6fcc7d9bb 543
Kojto 119:aae6fcc7d9bb 544 /** \brief Rotate Right in unsigned value (32 bit)
Kojto 119:aae6fcc7d9bb 545
Kojto 119:aae6fcc7d9bb 546 This function Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits.
Kojto 119:aae6fcc7d9bb 547
Kojto 119:aae6fcc7d9bb 548 \param [in] value Value to rotate
Kojto 119:aae6fcc7d9bb 549 \param [in] value Number of Bits to rotate
Kojto 119:aae6fcc7d9bb 550 \return Rotated value
Kojto 119:aae6fcc7d9bb 551 */
Kojto 119:aae6fcc7d9bb 552 __attribute__((always_inline)) __STATIC_INLINE uint32_t __ROR(uint32_t op1, uint32_t op2)
Kojto 119:aae6fcc7d9bb 553 {
Kojto 119:aae6fcc7d9bb 554 return (op1 >> op2) | (op1 << (32 - op2));
Kojto 119:aae6fcc7d9bb 555 }
Kojto 119:aae6fcc7d9bb 556
Kojto 119:aae6fcc7d9bb 557
Kojto 119:aae6fcc7d9bb 558 /** \brief Breakpoint
Kojto 119:aae6fcc7d9bb 559
Kojto 119:aae6fcc7d9bb 560 This function causes the processor to enter Debug state.
Kojto 119:aae6fcc7d9bb 561 Debug tools can use this to investigate system state when the instruction at a particular address is reached.
Kojto 119:aae6fcc7d9bb 562
Kojto 119:aae6fcc7d9bb 563 \param [in] value is ignored by the processor.
Kojto 119:aae6fcc7d9bb 564 If required, a debugger can use it to store additional information about the breakpoint.
Kojto 119:aae6fcc7d9bb 565 */
Kojto 119:aae6fcc7d9bb 566 #define __BKPT(value) __ASM volatile ("bkpt "#value)
Kojto 119:aae6fcc7d9bb 567
Kojto 119:aae6fcc7d9bb 568
Kojto 119:aae6fcc7d9bb 569 /** \brief Reverse bit order of value
Kojto 119:aae6fcc7d9bb 570
Kojto 119:aae6fcc7d9bb 571 This function reverses the bit order of the given value.
Kojto 119:aae6fcc7d9bb 572
Kojto 119:aae6fcc7d9bb 573 \param [in] value Value to reverse
Kojto 119:aae6fcc7d9bb 574 \return Reversed value
Kojto 119:aae6fcc7d9bb 575 */
Kojto 119:aae6fcc7d9bb 576 __attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value)
Kojto 119:aae6fcc7d9bb 577 {
Kojto 119:aae6fcc7d9bb 578 uint32_t result;
Kojto 119:aae6fcc7d9bb 579
Kojto 119:aae6fcc7d9bb 580 #if (__CORTEX_M >= 0x03) || (__CORTEX_SC >= 300)
Kojto 119:aae6fcc7d9bb 581 __ASM volatile ("rbit %0, %1" : "=r" (result) : "r" (value) );
Kojto 119:aae6fcc7d9bb 582 #else
Kojto 119:aae6fcc7d9bb 583 int32_t s = 4 /*sizeof(v)*/ * 8 - 1; // extra shift needed at end
Kojto 119:aae6fcc7d9bb 584
Kojto 119:aae6fcc7d9bb 585 result = value; // r will be reversed bits of v; first get LSB of v
Kojto 119:aae6fcc7d9bb 586 for (value >>= 1; value; value >>= 1)
Kojto 119:aae6fcc7d9bb 587 {
Kojto 119:aae6fcc7d9bb 588 result <<= 1;
Kojto 119:aae6fcc7d9bb 589 result |= value & 1;
Kojto 119:aae6fcc7d9bb 590 s--;
Kojto 119:aae6fcc7d9bb 591 }
Kojto 119:aae6fcc7d9bb 592 result <<= s; // shift when v's highest bits are zero
Kojto 119:aae6fcc7d9bb 593 #endif
Kojto 119:aae6fcc7d9bb 594 return(result);
Kojto 119:aae6fcc7d9bb 595 }
Kojto 119:aae6fcc7d9bb 596
Kojto 119:aae6fcc7d9bb 597
Kojto 119:aae6fcc7d9bb 598 /** \brief Count leading zeros
Kojto 119:aae6fcc7d9bb 599
Kojto 119:aae6fcc7d9bb 600 This function counts the number of leading zeros of a data value.
Kojto 119:aae6fcc7d9bb 601
Kojto 119:aae6fcc7d9bb 602 \param [in] value Value to count the leading zeros
Kojto 119:aae6fcc7d9bb 603 \return number of leading zeros in value
Kojto 119:aae6fcc7d9bb 604 */
Kojto 119:aae6fcc7d9bb 605 #define __CLZ __builtin_clz
Kojto 119:aae6fcc7d9bb 606
Kojto 119:aae6fcc7d9bb 607
Kojto 119:aae6fcc7d9bb 608 #if (__CORTEX_M >= 0x03) || (__CORTEX_SC >= 300)
Kojto 119:aae6fcc7d9bb 609
Kojto 119:aae6fcc7d9bb 610 /** \brief LDR Exclusive (8 bit)
Kojto 119:aae6fcc7d9bb 611
Kojto 119:aae6fcc7d9bb 612 This function executes a exclusive LDR instruction for 8 bit value.
Kojto 119:aae6fcc7d9bb 613
Kojto 119:aae6fcc7d9bb 614 \param [in] ptr Pointer to data
Kojto 119:aae6fcc7d9bb 615 \return value of type uint8_t at (*ptr)
Kojto 119:aae6fcc7d9bb 616 */
Kojto 119:aae6fcc7d9bb 617 __attribute__((always_inline)) __STATIC_INLINE uint8_t __LDREXB(volatile uint8_t *addr)
Kojto 119:aae6fcc7d9bb 618 {
Kojto 119:aae6fcc7d9bb 619 uint32_t result;
Kojto 119:aae6fcc7d9bb 620
Kojto 119:aae6fcc7d9bb 621 #if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
Kojto 119:aae6fcc7d9bb 622 __ASM volatile ("ldrexb %0, %1" : "=r" (result) : "Q" (*addr) );
Kojto 119:aae6fcc7d9bb 623 #else
Kojto 119:aae6fcc7d9bb 624 /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not
Kojto 119:aae6fcc7d9bb 625 accepted by assembler. So has to use following less efficient pattern.
Kojto 119:aae6fcc7d9bb 626 */
Kojto 119:aae6fcc7d9bb 627 __ASM volatile ("ldrexb %0, [%1]" : "=r" (result) : "r" (addr) : "memory" );
Kojto 119:aae6fcc7d9bb 628 #endif
Kojto 119:aae6fcc7d9bb 629 return ((uint8_t) result); /* Add explicit type cast here */
Kojto 119:aae6fcc7d9bb 630 }
Kojto 119:aae6fcc7d9bb 631
Kojto 119:aae6fcc7d9bb 632
Kojto 119:aae6fcc7d9bb 633 /** \brief LDR Exclusive (16 bit)
Kojto 119:aae6fcc7d9bb 634
Kojto 119:aae6fcc7d9bb 635 This function executes a exclusive LDR instruction for 16 bit values.
Kojto 119:aae6fcc7d9bb 636
Kojto 119:aae6fcc7d9bb 637 \param [in] ptr Pointer to data
Kojto 119:aae6fcc7d9bb 638 \return value of type uint16_t at (*ptr)
Kojto 119:aae6fcc7d9bb 639 */
Kojto 119:aae6fcc7d9bb 640 __attribute__((always_inline)) __STATIC_INLINE uint16_t __LDREXH(volatile uint16_t *addr)
Kojto 119:aae6fcc7d9bb 641 {
Kojto 119:aae6fcc7d9bb 642 uint32_t result;
Kojto 119:aae6fcc7d9bb 643
Kojto 119:aae6fcc7d9bb 644 #if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
Kojto 119:aae6fcc7d9bb 645 __ASM volatile ("ldrexh %0, %1" : "=r" (result) : "Q" (*addr) );
Kojto 119:aae6fcc7d9bb 646 #else
Kojto 119:aae6fcc7d9bb 647 /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not
Kojto 119:aae6fcc7d9bb 648 accepted by assembler. So has to use following less efficient pattern.
Kojto 119:aae6fcc7d9bb 649 */
Kojto 119:aae6fcc7d9bb 650 __ASM volatile ("ldrexh %0, [%1]" : "=r" (result) : "r" (addr) : "memory" );
Kojto 119:aae6fcc7d9bb 651 #endif
Kojto 119:aae6fcc7d9bb 652 return ((uint16_t) result); /* Add explicit type cast here */
Kojto 119:aae6fcc7d9bb 653 }
Kojto 119:aae6fcc7d9bb 654
Kojto 119:aae6fcc7d9bb 655
Kojto 119:aae6fcc7d9bb 656 /** \brief LDR Exclusive (32 bit)
Kojto 119:aae6fcc7d9bb 657
Kojto 119:aae6fcc7d9bb 658 This function executes a exclusive LDR instruction for 32 bit values.
Kojto 119:aae6fcc7d9bb 659
Kojto 119:aae6fcc7d9bb 660 \param [in] ptr Pointer to data
Kojto 119:aae6fcc7d9bb 661 \return value of type uint32_t at (*ptr)
Kojto 119:aae6fcc7d9bb 662 */
Kojto 119:aae6fcc7d9bb 663 __attribute__((always_inline)) __STATIC_INLINE uint32_t __LDREXW(volatile uint32_t *addr)
Kojto 119:aae6fcc7d9bb 664 {
Kojto 119:aae6fcc7d9bb 665 uint32_t result;
Kojto 119:aae6fcc7d9bb 666
Kojto 119:aae6fcc7d9bb 667 __ASM volatile ("ldrex %0, %1" : "=r" (result) : "Q" (*addr) );
Kojto 119:aae6fcc7d9bb 668 return(result);
Kojto 119:aae6fcc7d9bb 669 }
Kojto 119:aae6fcc7d9bb 670
Kojto 119:aae6fcc7d9bb 671
Kojto 119:aae6fcc7d9bb 672 /** \brief STR Exclusive (8 bit)
Kojto 119:aae6fcc7d9bb 673
Kojto 119:aae6fcc7d9bb 674 This function executes a exclusive STR instruction for 8 bit values.
Kojto 119:aae6fcc7d9bb 675
Kojto 119:aae6fcc7d9bb 676 \param [in] value Value to store
Kojto 119:aae6fcc7d9bb 677 \param [in] ptr Pointer to location
Kojto 119:aae6fcc7d9bb 678 \return 0 Function succeeded
Kojto 119:aae6fcc7d9bb 679 \return 1 Function failed
Kojto 119:aae6fcc7d9bb 680 */
Kojto 119:aae6fcc7d9bb 681 __attribute__((always_inline)) __STATIC_INLINE uint32_t __STREXB(uint8_t value, volatile uint8_t *addr)
Kojto 119:aae6fcc7d9bb 682 {
Kojto 119:aae6fcc7d9bb 683 uint32_t result;
Kojto 119:aae6fcc7d9bb 684
Kojto 119:aae6fcc7d9bb 685 __ASM volatile ("strexb %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) );
Kojto 119:aae6fcc7d9bb 686 return(result);
Kojto 119:aae6fcc7d9bb 687 }
Kojto 119:aae6fcc7d9bb 688
Kojto 119:aae6fcc7d9bb 689
Kojto 119:aae6fcc7d9bb 690 /** \brief STR Exclusive (16 bit)
Kojto 119:aae6fcc7d9bb 691
Kojto 119:aae6fcc7d9bb 692 This function executes a exclusive STR instruction for 16 bit values.
Kojto 119:aae6fcc7d9bb 693
Kojto 119:aae6fcc7d9bb 694 \param [in] value Value to store
Kojto 119:aae6fcc7d9bb 695 \param [in] ptr Pointer to location
Kojto 119:aae6fcc7d9bb 696 \return 0 Function succeeded
Kojto 119:aae6fcc7d9bb 697 \return 1 Function failed
Kojto 119:aae6fcc7d9bb 698 */
Kojto 119:aae6fcc7d9bb 699 __attribute__((always_inline)) __STATIC_INLINE uint32_t __STREXH(uint16_t value, volatile uint16_t *addr)
Kojto 119:aae6fcc7d9bb 700 {
Kojto 119:aae6fcc7d9bb 701 uint32_t result;
Kojto 119:aae6fcc7d9bb 702
Kojto 119:aae6fcc7d9bb 703 __ASM volatile ("strexh %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) );
Kojto 119:aae6fcc7d9bb 704 return(result);
Kojto 119:aae6fcc7d9bb 705 }
Kojto 119:aae6fcc7d9bb 706
Kojto 119:aae6fcc7d9bb 707
Kojto 119:aae6fcc7d9bb 708 /** \brief STR Exclusive (32 bit)
Kojto 119:aae6fcc7d9bb 709
Kojto 119:aae6fcc7d9bb 710 This function executes a exclusive STR instruction for 32 bit values.
Kojto 119:aae6fcc7d9bb 711
Kojto 119:aae6fcc7d9bb 712 \param [in] value Value to store
Kojto 119:aae6fcc7d9bb 713 \param [in] ptr Pointer to location
Kojto 119:aae6fcc7d9bb 714 \return 0 Function succeeded
Kojto 119:aae6fcc7d9bb 715 \return 1 Function failed
Kojto 119:aae6fcc7d9bb 716 */
Kojto 119:aae6fcc7d9bb 717 __attribute__((always_inline)) __STATIC_INLINE uint32_t __STREXW(uint32_t value, volatile uint32_t *addr)
Kojto 119:aae6fcc7d9bb 718 {
Kojto 119:aae6fcc7d9bb 719 uint32_t result;
Kojto 119:aae6fcc7d9bb 720
Kojto 119:aae6fcc7d9bb 721 __ASM volatile ("strex %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" (value) );
Kojto 119:aae6fcc7d9bb 722 return(result);
Kojto 119:aae6fcc7d9bb 723 }
Kojto 119:aae6fcc7d9bb 724
Kojto 119:aae6fcc7d9bb 725
Kojto 119:aae6fcc7d9bb 726 /** \brief Remove the exclusive lock
Kojto 119:aae6fcc7d9bb 727
Kojto 119:aae6fcc7d9bb 728 This function removes the exclusive lock which is created by LDREX.
Kojto 119:aae6fcc7d9bb 729
Kojto 119:aae6fcc7d9bb 730 */
Kojto 119:aae6fcc7d9bb 731 __attribute__((always_inline)) __STATIC_INLINE void __CLREX(void)
Kojto 119:aae6fcc7d9bb 732 {
Kojto 119:aae6fcc7d9bb 733 __ASM volatile ("clrex" ::: "memory");
Kojto 119:aae6fcc7d9bb 734 }
Kojto 119:aae6fcc7d9bb 735
Kojto 119:aae6fcc7d9bb 736
Kojto 119:aae6fcc7d9bb 737 /** \brief Signed Saturate
Kojto 119:aae6fcc7d9bb 738
Kojto 119:aae6fcc7d9bb 739 This function saturates a signed value.
Kojto 119:aae6fcc7d9bb 740
Kojto 119:aae6fcc7d9bb 741 \param [in] value Value to be saturated
Kojto 119:aae6fcc7d9bb 742 \param [in] sat Bit position to saturate to (1..32)
Kojto 119:aae6fcc7d9bb 743 \return Saturated value
Kojto 119:aae6fcc7d9bb 744 */
Kojto 119:aae6fcc7d9bb 745 #define __SSAT(ARG1,ARG2) \
Kojto 119:aae6fcc7d9bb 746 ({ \
Kojto 119:aae6fcc7d9bb 747 uint32_t __RES, __ARG1 = (ARG1); \
Kojto 119:aae6fcc7d9bb 748 __ASM ("ssat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \
Kojto 119:aae6fcc7d9bb 749 __RES; \
Kojto 119:aae6fcc7d9bb 750 })
Kojto 119:aae6fcc7d9bb 751
Kojto 119:aae6fcc7d9bb 752
Kojto 119:aae6fcc7d9bb 753 /** \brief Unsigned Saturate
Kojto 119:aae6fcc7d9bb 754
Kojto 119:aae6fcc7d9bb 755 This function saturates an unsigned value.
Kojto 119:aae6fcc7d9bb 756
Kojto 119:aae6fcc7d9bb 757 \param [in] value Value to be saturated
Kojto 119:aae6fcc7d9bb 758 \param [in] sat Bit position to saturate to (0..31)
Kojto 119:aae6fcc7d9bb 759 \return Saturated value
Kojto 119:aae6fcc7d9bb 760 */
Kojto 119:aae6fcc7d9bb 761 #define __USAT(ARG1,ARG2) \
Kojto 119:aae6fcc7d9bb 762 ({ \
Kojto 119:aae6fcc7d9bb 763 uint32_t __RES, __ARG1 = (ARG1); \
Kojto 119:aae6fcc7d9bb 764 __ASM ("usat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \
Kojto 119:aae6fcc7d9bb 765 __RES; \
Kojto 119:aae6fcc7d9bb 766 })
Kojto 119:aae6fcc7d9bb 767
Kojto 119:aae6fcc7d9bb 768
Kojto 119:aae6fcc7d9bb 769 /** \brief Rotate Right with Extend (32 bit)
Kojto 119:aae6fcc7d9bb 770
Kojto 119:aae6fcc7d9bb 771 This function moves each bit of a bitstring right by one bit.
Kojto 119:aae6fcc7d9bb 772 The carry input is shifted in at the left end of the bitstring.
Kojto 119:aae6fcc7d9bb 773
Kojto 119:aae6fcc7d9bb 774 \param [in] value Value to rotate
Kojto 119:aae6fcc7d9bb 775 \return Rotated value
Kojto 119:aae6fcc7d9bb 776 */
Kojto 119:aae6fcc7d9bb 777 __attribute__((always_inline)) __STATIC_INLINE uint32_t __RRX(uint32_t value)
Kojto 119:aae6fcc7d9bb 778 {
Kojto 119:aae6fcc7d9bb 779 uint32_t result;
Kojto 119:aae6fcc7d9bb 780
Kojto 119:aae6fcc7d9bb 781 __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) );
Kojto 119:aae6fcc7d9bb 782 return(result);
Kojto 119:aae6fcc7d9bb 783 }
Kojto 119:aae6fcc7d9bb 784
Kojto 119:aae6fcc7d9bb 785
Kojto 119:aae6fcc7d9bb 786 /** \brief LDRT Unprivileged (8 bit)
Kojto 119:aae6fcc7d9bb 787
Kojto 119:aae6fcc7d9bb 788 This function executes a Unprivileged LDRT instruction for 8 bit value.
Kojto 119:aae6fcc7d9bb 789
Kojto 119:aae6fcc7d9bb 790 \param [in] ptr Pointer to data
Kojto 119:aae6fcc7d9bb 791 \return value of type uint8_t at (*ptr)
Kojto 119:aae6fcc7d9bb 792 */
Kojto 119:aae6fcc7d9bb 793 __attribute__((always_inline)) __STATIC_INLINE uint8_t __LDRBT(volatile uint8_t *addr)
Kojto 119:aae6fcc7d9bb 794 {
Kojto 119:aae6fcc7d9bb 795 uint32_t result;
Kojto 119:aae6fcc7d9bb 796
Kojto 119:aae6fcc7d9bb 797 #if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
Kojto 119:aae6fcc7d9bb 798 __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*addr) );
Kojto 119:aae6fcc7d9bb 799 #else
Kojto 119:aae6fcc7d9bb 800 /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not
Kojto 119:aae6fcc7d9bb 801 accepted by assembler. So has to use following less efficient pattern.
Kojto 119:aae6fcc7d9bb 802 */
Kojto 119:aae6fcc7d9bb 803 __ASM volatile ("ldrbt %0, [%1]" : "=r" (result) : "r" (addr) : "memory" );
Kojto 119:aae6fcc7d9bb 804 #endif
Kojto 119:aae6fcc7d9bb 805 return ((uint8_t) result); /* Add explicit type cast here */
Kojto 119:aae6fcc7d9bb 806 }
Kojto 119:aae6fcc7d9bb 807
Kojto 119:aae6fcc7d9bb 808
Kojto 119:aae6fcc7d9bb 809 /** \brief LDRT Unprivileged (16 bit)
Kojto 119:aae6fcc7d9bb 810
Kojto 119:aae6fcc7d9bb 811 This function executes a Unprivileged LDRT instruction for 16 bit values.
Kojto 119:aae6fcc7d9bb 812
Kojto 119:aae6fcc7d9bb 813 \param [in] ptr Pointer to data
Kojto 119:aae6fcc7d9bb 814 \return value of type uint16_t at (*ptr)
Kojto 119:aae6fcc7d9bb 815 */
Kojto 119:aae6fcc7d9bb 816 __attribute__((always_inline)) __STATIC_INLINE uint16_t __LDRHT(volatile uint16_t *addr)
Kojto 119:aae6fcc7d9bb 817 {
Kojto 119:aae6fcc7d9bb 818 uint32_t result;
Kojto 119:aae6fcc7d9bb 819
Kojto 119:aae6fcc7d9bb 820 #if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
Kojto 119:aae6fcc7d9bb 821 __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*addr) );
Kojto 119:aae6fcc7d9bb 822 #else
Kojto 119:aae6fcc7d9bb 823 /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not
Kojto 119:aae6fcc7d9bb 824 accepted by assembler. So has to use following less efficient pattern.
Kojto 119:aae6fcc7d9bb 825 */
Kojto 119:aae6fcc7d9bb 826 __ASM volatile ("ldrht %0, [%1]" : "=r" (result) : "r" (addr) : "memory" );
Kojto 119:aae6fcc7d9bb 827 #endif
Kojto 119:aae6fcc7d9bb 828 return ((uint16_t) result); /* Add explicit type cast here */
Kojto 119:aae6fcc7d9bb 829 }
Kojto 119:aae6fcc7d9bb 830
Kojto 119:aae6fcc7d9bb 831
Kojto 119:aae6fcc7d9bb 832 /** \brief LDRT Unprivileged (32 bit)
Kojto 119:aae6fcc7d9bb 833
Kojto 119:aae6fcc7d9bb 834 This function executes a Unprivileged LDRT instruction for 32 bit values.
Kojto 119:aae6fcc7d9bb 835
Kojto 119:aae6fcc7d9bb 836 \param [in] ptr Pointer to data
Kojto 119:aae6fcc7d9bb 837 \return value of type uint32_t at (*ptr)
Kojto 119:aae6fcc7d9bb 838 */
Kojto 119:aae6fcc7d9bb 839 __attribute__((always_inline)) __STATIC_INLINE uint32_t __LDRT(volatile uint32_t *addr)
Kojto 119:aae6fcc7d9bb 840 {
Kojto 119:aae6fcc7d9bb 841 uint32_t result;
Kojto 119:aae6fcc7d9bb 842
Kojto 119:aae6fcc7d9bb 843 __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*addr) );
Kojto 119:aae6fcc7d9bb 844 return(result);
Kojto 119:aae6fcc7d9bb 845 }
Kojto 119:aae6fcc7d9bb 846
Kojto 119:aae6fcc7d9bb 847
Kojto 119:aae6fcc7d9bb 848 /** \brief STRT Unprivileged (8 bit)
Kojto 119:aae6fcc7d9bb 849
Kojto 119:aae6fcc7d9bb 850 This function executes a Unprivileged STRT instruction for 8 bit values.
Kojto 119:aae6fcc7d9bb 851
Kojto 119:aae6fcc7d9bb 852 \param [in] value Value to store
Kojto 119:aae6fcc7d9bb 853 \param [in] ptr Pointer to location
Kojto 119:aae6fcc7d9bb 854 */
Kojto 119:aae6fcc7d9bb 855 __attribute__((always_inline)) __STATIC_INLINE void __STRBT(uint8_t value, volatile uint8_t *addr)
Kojto 119:aae6fcc7d9bb 856 {
Kojto 119:aae6fcc7d9bb 857 __ASM volatile ("strbt %1, %0" : "=Q" (*addr) : "r" ((uint32_t)value) );
Kojto 119:aae6fcc7d9bb 858 }
Kojto 119:aae6fcc7d9bb 859
Kojto 119:aae6fcc7d9bb 860
Kojto 119:aae6fcc7d9bb 861 /** \brief STRT Unprivileged (16 bit)
Kojto 119:aae6fcc7d9bb 862
Kojto 119:aae6fcc7d9bb 863 This function executes a Unprivileged STRT instruction for 16 bit values.
Kojto 119:aae6fcc7d9bb 864
Kojto 119:aae6fcc7d9bb 865 \param [in] value Value to store
Kojto 119:aae6fcc7d9bb 866 \param [in] ptr Pointer to location
Kojto 119:aae6fcc7d9bb 867 */
Kojto 119:aae6fcc7d9bb 868 __attribute__((always_inline)) __STATIC_INLINE void __STRHT(uint16_t value, volatile uint16_t *addr)
Kojto 119:aae6fcc7d9bb 869 {
Kojto 119:aae6fcc7d9bb 870 __ASM volatile ("strht %1, %0" : "=Q" (*addr) : "r" ((uint32_t)value) );
Kojto 119:aae6fcc7d9bb 871 }
Kojto 119:aae6fcc7d9bb 872
Kojto 119:aae6fcc7d9bb 873
Kojto 119:aae6fcc7d9bb 874 /** \brief STRT Unprivileged (32 bit)
Kojto 119:aae6fcc7d9bb 875
Kojto 119:aae6fcc7d9bb 876 This function executes a Unprivileged STRT instruction for 32 bit values.
Kojto 119:aae6fcc7d9bb 877
Kojto 119:aae6fcc7d9bb 878 \param [in] value Value to store
Kojto 119:aae6fcc7d9bb 879 \param [in] ptr Pointer to location
Kojto 119:aae6fcc7d9bb 880 */
Kojto 119:aae6fcc7d9bb 881 __attribute__((always_inline)) __STATIC_INLINE void __STRT(uint32_t value, volatile uint32_t *addr)
Kojto 119:aae6fcc7d9bb 882 {
Kojto 119:aae6fcc7d9bb 883 __ASM volatile ("strt %1, %0" : "=Q" (*addr) : "r" (value) );
Kojto 119:aae6fcc7d9bb 884 }
Kojto 119:aae6fcc7d9bb 885
Kojto 119:aae6fcc7d9bb 886 #endif /* (__CORTEX_M >= 0x03) || (__CORTEX_SC >= 300) */
Kojto 119:aae6fcc7d9bb 887
Kojto 119:aae6fcc7d9bb 888
Kojto 119:aae6fcc7d9bb 889 #elif defined ( __ICCARM__ ) /*------------------ ICC Compiler -------------------*/
Kojto 119:aae6fcc7d9bb 890 /* IAR iccarm specific functions */
Kojto 119:aae6fcc7d9bb 891 #include <cmsis_iar.h>
Kojto 119:aae6fcc7d9bb 892
Kojto 119:aae6fcc7d9bb 893
Kojto 119:aae6fcc7d9bb 894 #elif defined ( __TMS470__ ) /*---------------- TI CCS Compiler ------------------*/
Kojto 119:aae6fcc7d9bb 895 /* TI CCS specific functions */
Kojto 119:aae6fcc7d9bb 896 #include <cmsis_ccs.h>
Kojto 119:aae6fcc7d9bb 897
Kojto 119:aae6fcc7d9bb 898
Kojto 119:aae6fcc7d9bb 899 #elif defined ( __TASKING__ ) /*------------------ TASKING Compiler --------------*/
Kojto 119:aae6fcc7d9bb 900 /* TASKING carm specific functions */
Kojto 119:aae6fcc7d9bb 901 /*
Kojto 119:aae6fcc7d9bb 902 * The CMSIS functions have been implemented as intrinsics in the compiler.
Kojto 119:aae6fcc7d9bb 903 * Please use "carm -?i" to get an up to date list of all intrinsics,
Kojto 119:aae6fcc7d9bb 904 * Including the CMSIS ones.
Kojto 119:aae6fcc7d9bb 905 */
Kojto 119:aae6fcc7d9bb 906
Kojto 119:aae6fcc7d9bb 907
Kojto 119:aae6fcc7d9bb 908 #elif defined ( __CSMC__ ) /*------------------ COSMIC Compiler -------------------*/
Kojto 119:aae6fcc7d9bb 909 /* Cosmic specific functions */
Kojto 119:aae6fcc7d9bb 910 #include <cmsis_csm.h>
Kojto 119:aae6fcc7d9bb 911
Kojto 119:aae6fcc7d9bb 912 #endif
Kojto 119:aae6fcc7d9bb 913
Kojto 119:aae6fcc7d9bb 914 /*@}*/ /* end of group CMSIS_Core_InstructionInterface */
Kojto 119:aae6fcc7d9bb 915
Kojto 119:aae6fcc7d9bb 916 #endif /* __CORE_CMINSTR_H */