annotate l476rg/Drivers/CMSIS/Include/cmsis_armcc.h @ 1:a0b14b11ad9f

working on dependencies between MCU devices such as GPIO, Pins and Timers
author cin
date Fri, 13 Jan 2017 02:11:02 +0300
parents 32a3b1785697
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
1 /**************************************************************************//**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
2 * @file cmsis_armcc.h
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
3 * @brief CMSIS Cortex-M Core Function/Instruction Header File
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
4 * @version V4.30
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
5 * @date 20. October 2015
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
6 ******************************************************************************/
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
7 /* Copyright (c) 2009 - 2015 ARM LIMITED
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
8
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
9 All rights reserved.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
10 Redistribution and use in source and binary forms, with or without
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
11 modification, are permitted provided that the following conditions are met:
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
12 - Redistributions of source code must retain the above copyright
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
13 notice, this list of conditions and the following disclaimer.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
14 - Redistributions in binary form must reproduce the above copyright
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
15 notice, this list of conditions and the following disclaimer in the
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
16 documentation and/or other materials provided with the distribution.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
17 - Neither the name of ARM nor the names of its contributors may be used
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
18 to endorse or promote products derived from this software without
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
19 specific prior written permission.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
20 *
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
23 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
24 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
25 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
26 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
27 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
28 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
29 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
30 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
31 POSSIBILITY OF SUCH DAMAGE.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
32 ---------------------------------------------------------------------------*/
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
33
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
34
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
35 #ifndef __CMSIS_ARMCC_H
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
36 #define __CMSIS_ARMCC_H
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
37
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
38
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
39 #if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 400677)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
40 #error "Please use ARM Compiler Toolchain V4.0.677 or later!"
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
41 #endif
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
42
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
43 /* ########################### Core Function Access ########################### */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
44 /** \ingroup CMSIS_Core_FunctionInterface
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
45 \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
46 @{
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
47 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
48
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
49 /* intrinsic void __enable_irq(); */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
50 /* intrinsic void __disable_irq(); */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
51
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
52 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
53 \brief Get Control Register
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
54 \details Returns the content of the Control Register.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
55 \return Control Register value
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
56 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
57 __STATIC_INLINE uint32_t __get_CONTROL(void)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
58 {
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
59 register uint32_t __regControl __ASM("control");
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
60 return(__regControl);
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
61 }
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
62
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
63
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
64 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
65 \brief Set Control Register
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
66 \details Writes the given value to the Control Register.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
67 \param [in] control Control Register value to set
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
68 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
69 __STATIC_INLINE void __set_CONTROL(uint32_t control)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
70 {
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
71 register uint32_t __regControl __ASM("control");
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
72 __regControl = control;
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
73 }
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
74
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
75
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
76 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
77 \brief Get IPSR Register
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
78 \details Returns the content of the IPSR Register.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
79 \return IPSR Register value
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
80 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
81 __STATIC_INLINE uint32_t __get_IPSR(void)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
82 {
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
83 register uint32_t __regIPSR __ASM("ipsr");
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
84 return(__regIPSR);
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
85 }
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
86
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
87
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
88 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
89 \brief Get APSR Register
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
90 \details Returns the content of the APSR Register.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
91 \return APSR Register value
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
92 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
93 __STATIC_INLINE uint32_t __get_APSR(void)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
94 {
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
95 register uint32_t __regAPSR __ASM("apsr");
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
96 return(__regAPSR);
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
97 }
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
98
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
99
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
100 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
101 \brief Get xPSR Register
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
102 \details Returns the content of the xPSR Register.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
103 \return xPSR Register value
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
104 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
105 __STATIC_INLINE uint32_t __get_xPSR(void)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
106 {
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
107 register uint32_t __regXPSR __ASM("xpsr");
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
108 return(__regXPSR);
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
109 }
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
110
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
111
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
112 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
113 \brief Get Process Stack Pointer
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
114 \details Returns the current value of the Process Stack Pointer (PSP).
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
115 \return PSP Register value
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
116 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
117 __STATIC_INLINE uint32_t __get_PSP(void)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
118 {
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
119 register uint32_t __regProcessStackPointer __ASM("psp");
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
120 return(__regProcessStackPointer);
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
121 }
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
122
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
123
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
124 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
125 \brief Set Process Stack Pointer
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
126 \details Assigns the given value to the Process Stack Pointer (PSP).
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
127 \param [in] topOfProcStack Process Stack Pointer value to set
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
128 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
129 __STATIC_INLINE void __set_PSP(uint32_t topOfProcStack)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
130 {
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
131 register uint32_t __regProcessStackPointer __ASM("psp");
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
132 __regProcessStackPointer = topOfProcStack;
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
133 }
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
134
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
135
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
136 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
137 \brief Get Main Stack Pointer
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
138 \details Returns the current value of the Main Stack Pointer (MSP).
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
139 \return MSP Register value
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
140 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
141 __STATIC_INLINE uint32_t __get_MSP(void)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
142 {
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
143 register uint32_t __regMainStackPointer __ASM("msp");
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
144 return(__regMainStackPointer);
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
145 }
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
146
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
147
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
148 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
149 \brief Set Main Stack Pointer
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
150 \details Assigns the given value to the Main Stack Pointer (MSP).
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
151 \param [in] topOfMainStack Main Stack Pointer value to set
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
152 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
153 __STATIC_INLINE void __set_MSP(uint32_t topOfMainStack)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
154 {
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
155 register uint32_t __regMainStackPointer __ASM("msp");
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
156 __regMainStackPointer = topOfMainStack;
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
157 }
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
158
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
159
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
160 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
161 \brief Get Priority Mask
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
162 \details Returns the current state of the priority mask bit from the Priority Mask Register.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
163 \return Priority Mask value
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
164 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
165 __STATIC_INLINE uint32_t __get_PRIMASK(void)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
166 {
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
167 register uint32_t __regPriMask __ASM("primask");
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
168 return(__regPriMask);
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
169 }
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
170
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
171
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
172 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
173 \brief Set Priority Mask
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
174 \details Assigns the given value to the Priority Mask Register.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
175 \param [in] priMask Priority Mask
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
176 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
177 __STATIC_INLINE void __set_PRIMASK(uint32_t priMask)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
178 {
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
179 register uint32_t __regPriMask __ASM("primask");
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
180 __regPriMask = (priMask);
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
181 }
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
182
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
183
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
184 #if (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
185
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
186 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
187 \brief Enable FIQ
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
188 \details Enables FIQ interrupts by clearing the F-bit in the CPSR.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
189 Can only be executed in Privileged modes.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
190 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
191 #define __enable_fault_irq __enable_fiq
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
192
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
193
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
194 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
195 \brief Disable FIQ
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
196 \details Disables FIQ interrupts by setting the F-bit in the CPSR.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
197 Can only be executed in Privileged modes.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
198 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
199 #define __disable_fault_irq __disable_fiq
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
200
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
201
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
202 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
203 \brief Get Base Priority
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
204 \details Returns the current value of the Base Priority register.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
205 \return Base Priority register value
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
206 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
207 __STATIC_INLINE uint32_t __get_BASEPRI(void)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
208 {
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
209 register uint32_t __regBasePri __ASM("basepri");
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
210 return(__regBasePri);
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
211 }
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
212
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
213
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
214 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
215 \brief Set Base Priority
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
216 \details Assigns the given value to the Base Priority register.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
217 \param [in] basePri Base Priority value to set
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
218 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
219 __STATIC_INLINE void __set_BASEPRI(uint32_t basePri)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
220 {
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
221 register uint32_t __regBasePri __ASM("basepri");
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
222 __regBasePri = (basePri & 0xFFU);
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
223 }
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
224
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
225
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
226 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
227 \brief Set Base Priority with condition
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
228 \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled,
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
229 or the new value increases the BASEPRI priority level.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
230 \param [in] basePri Base Priority value to set
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
231 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
232 __STATIC_INLINE void __set_BASEPRI_MAX(uint32_t basePri)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
233 {
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
234 register uint32_t __regBasePriMax __ASM("basepri_max");
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
235 __regBasePriMax = (basePri & 0xFFU);
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
236 }
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
237
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
238
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
239 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
240 \brief Get Fault Mask
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
241 \details Returns the current value of the Fault Mask register.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
242 \return Fault Mask register value
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
243 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
244 __STATIC_INLINE uint32_t __get_FAULTMASK(void)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
245 {
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
246 register uint32_t __regFaultMask __ASM("faultmask");
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
247 return(__regFaultMask);
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
248 }
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
249
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
250
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
251 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
252 \brief Set Fault Mask
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
253 \details Assigns the given value to the Fault Mask register.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
254 \param [in] faultMask Fault Mask value to set
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
255 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
256 __STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
257 {
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
258 register uint32_t __regFaultMask __ASM("faultmask");
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
259 __regFaultMask = (faultMask & (uint32_t)1);
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
260 }
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
261
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
262 #endif /* (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
263
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
264
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
265 #if (__CORTEX_M == 0x04U) || (__CORTEX_M == 0x07U)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
266
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
267 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
268 \brief Get FPSCR
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
269 \details Returns the current value of the Floating Point Status/Control register.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
270 \return Floating Point Status/Control register value
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
271 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
272 __STATIC_INLINE uint32_t __get_FPSCR(void)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
273 {
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
274 #if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
275 register uint32_t __regfpscr __ASM("fpscr");
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
276 return(__regfpscr);
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
277 #else
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
278 return(0U);
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
279 #endif
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
280 }
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
281
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
282
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
283 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
284 \brief Set FPSCR
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
285 \details Assigns the given value to the Floating Point Status/Control register.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
286 \param [in] fpscr Floating Point Status/Control value to set
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
287 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
288 __STATIC_INLINE void __set_FPSCR(uint32_t fpscr)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
289 {
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
290 #if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
291 register uint32_t __regfpscr __ASM("fpscr");
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
292 __regfpscr = (fpscr);
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
293 #endif
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
294 }
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
295
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
296 #endif /* (__CORTEX_M == 0x04U) || (__CORTEX_M == 0x07U) */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
297
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
298
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
299
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
300 /*@} end of CMSIS_Core_RegAccFunctions */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
301
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
302
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
303 /* ########################## Core Instruction Access ######################### */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
304 /** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
305 Access to dedicated instructions
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
306 @{
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
307 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
308
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
309 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
310 \brief No Operation
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
311 \details No Operation does nothing. This instruction can be used for code alignment purposes.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
312 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
313 #define __NOP __nop
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
314
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
315
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
316 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
317 \brief Wait For Interrupt
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
318 \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
319 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
320 #define __WFI __wfi
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
321
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
322
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
323 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
324 \brief Wait For Event
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
325 \details Wait For Event is a hint instruction that permits the processor to enter
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
326 a low-power state until one of a number of events occurs.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
327 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
328 #define __WFE __wfe
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
329
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
330
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
331 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
332 \brief Send Event
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
333 \details Send Event is a hint instruction. It causes an event to be signaled to the CPU.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
334 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
335 #define __SEV __sev
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
336
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
337
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
338 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
339 \brief Instruction Synchronization Barrier
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
340 \details Instruction Synchronization Barrier flushes the pipeline in the processor,
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
341 so that all instructions following the ISB are fetched from cache or memory,
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
342 after the instruction has been completed.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
343 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
344 #define __ISB() do {\
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
345 __schedule_barrier();\
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
346 __isb(0xF);\
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
347 __schedule_barrier();\
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
348 } while (0U)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
349
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
350 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
351 \brief Data Synchronization Barrier
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
352 \details Acts as a special kind of Data Memory Barrier.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
353 It completes when all explicit memory accesses before this instruction complete.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
354 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
355 #define __DSB() do {\
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
356 __schedule_barrier();\
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
357 __dsb(0xF);\
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
358 __schedule_barrier();\
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
359 } while (0U)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
360
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
361 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
362 \brief Data Memory Barrier
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
363 \details Ensures the apparent order of the explicit memory operations before
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
364 and after the instruction, without ensuring their completion.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
365 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
366 #define __DMB() do {\
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
367 __schedule_barrier();\
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
368 __dmb(0xF);\
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
369 __schedule_barrier();\
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
370 } while (0U)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
371
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
372 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
373 \brief Reverse byte order (32 bit)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
374 \details Reverses the byte order in integer value.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
375 \param [in] value Value to reverse
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
376 \return Reversed value
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
377 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
378 #define __REV __rev
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
379
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
380
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
381 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
382 \brief Reverse byte order (16 bit)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
383 \details Reverses the byte order in two unsigned short values.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
384 \param [in] value Value to reverse
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
385 \return Reversed value
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
386 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
387 #ifndef __NO_EMBEDDED_ASM
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
388 __attribute__((section(".rev16_text"))) __STATIC_INLINE __ASM uint32_t __REV16(uint32_t value)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
389 {
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
390 rev16 r0, r0
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
391 bx lr
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
392 }
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
393 #endif
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
394
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
395 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
396 \brief Reverse byte order in signed short value
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
397 \details Reverses the byte order in a signed short value with sign extension to integer.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
398 \param [in] value Value to reverse
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
399 \return Reversed value
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
400 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
401 #ifndef __NO_EMBEDDED_ASM
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
402 __attribute__((section(".revsh_text"))) __STATIC_INLINE __ASM int32_t __REVSH(int32_t value)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
403 {
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
404 revsh r0, r0
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
405 bx lr
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
406 }
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
407 #endif
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
408
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
409
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
410 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
411 \brief Rotate Right in unsigned value (32 bit)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
412 \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
413 \param [in] value Value to rotate
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
414 \param [in] value Number of Bits to rotate
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
415 \return Rotated value
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
416 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
417 #define __ROR __ror
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
418
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
419
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
420 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
421 \brief Breakpoint
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
422 \details Causes the processor to enter Debug state.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
423 Debug tools can use this to investigate system state when the instruction at a particular address is reached.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
424 \param [in] value is ignored by the processor.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
425 If required, a debugger can use it to store additional information about the breakpoint.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
426 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
427 #define __BKPT(value) __breakpoint(value)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
428
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
429
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
430 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
431 \brief Reverse bit order of value
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
432 \details Reverses the bit order of the given value.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
433 \param [in] value Value to reverse
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
434 \return Reversed value
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
435 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
436 #if (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
437 #define __RBIT __rbit
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
438 #else
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
439 __attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
440 {
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
441 uint32_t result;
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
442 int32_t s = 4 /*sizeof(v)*/ * 8 - 1; /* extra shift needed at end */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
443
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
444 result = value; /* r will be reversed bits of v; first get LSB of v */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
445 for (value >>= 1U; value; value >>= 1U)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
446 {
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
447 result <<= 1U;
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
448 result |= value & 1U;
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
449 s--;
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
450 }
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
451 result <<= s; /* shift when v's highest bits are zero */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
452 return(result);
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
453 }
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
454 #endif
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
455
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
456
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
457 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
458 \brief Count leading zeros
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
459 \details Counts the number of leading zeros of a data value.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
460 \param [in] value Value to count the leading zeros
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
461 \return number of leading zeros in value
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
462 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
463 #define __CLZ __clz
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
464
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
465
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
466 #if (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
467
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
468 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
469 \brief LDR Exclusive (8 bit)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
470 \details Executes a exclusive LDR instruction for 8 bit value.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
471 \param [in] ptr Pointer to data
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
472 \return value of type uint8_t at (*ptr)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
473 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
474 #if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
475 #define __LDREXB(ptr) ((uint8_t ) __ldrex(ptr))
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
476 #else
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
477 #define __LDREXB(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint8_t ) __ldrex(ptr)) _Pragma("pop")
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
478 #endif
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
479
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
480
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
481 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
482 \brief LDR Exclusive (16 bit)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
483 \details Executes a exclusive LDR instruction for 16 bit values.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
484 \param [in] ptr Pointer to data
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
485 \return value of type uint16_t at (*ptr)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
486 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
487 #if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
488 #define __LDREXH(ptr) ((uint16_t) __ldrex(ptr))
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
489 #else
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
490 #define __LDREXH(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint16_t) __ldrex(ptr)) _Pragma("pop")
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
491 #endif
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
492
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
493
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
494 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
495 \brief LDR Exclusive (32 bit)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
496 \details Executes a exclusive LDR instruction for 32 bit values.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
497 \param [in] ptr Pointer to data
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
498 \return value of type uint32_t at (*ptr)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
499 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
500 #if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
501 #define __LDREXW(ptr) ((uint32_t ) __ldrex(ptr))
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
502 #else
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
503 #define __LDREXW(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint32_t ) __ldrex(ptr)) _Pragma("pop")
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
504 #endif
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
505
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
506
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
507 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
508 \brief STR Exclusive (8 bit)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
509 \details Executes a exclusive STR instruction for 8 bit values.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
510 \param [in] value Value to store
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
511 \param [in] ptr Pointer to location
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
512 \return 0 Function succeeded
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
513 \return 1 Function failed
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
514 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
515 #if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
516 #define __STREXB(value, ptr) __strex(value, ptr)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
517 #else
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
518 #define __STREXB(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop")
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
519 #endif
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
520
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
521
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
522 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
523 \brief STR Exclusive (16 bit)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
524 \details Executes a exclusive STR instruction for 16 bit values.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
525 \param [in] value Value to store
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
526 \param [in] ptr Pointer to location
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
527 \return 0 Function succeeded
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
528 \return 1 Function failed
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
529 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
530 #if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
531 #define __STREXH(value, ptr) __strex(value, ptr)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
532 #else
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
533 #define __STREXH(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop")
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
534 #endif
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
535
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
536
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
537 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
538 \brief STR Exclusive (32 bit)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
539 \details Executes a exclusive STR instruction for 32 bit values.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
540 \param [in] value Value to store
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
541 \param [in] ptr Pointer to location
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
542 \return 0 Function succeeded
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
543 \return 1 Function failed
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
544 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
545 #if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
546 #define __STREXW(value, ptr) __strex(value, ptr)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
547 #else
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
548 #define __STREXW(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop")
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
549 #endif
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
550
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
551
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
552 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
553 \brief Remove the exclusive lock
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
554 \details Removes the exclusive lock which is created by LDREX.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
555 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
556 #define __CLREX __clrex
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
557
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
558
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
559 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
560 \brief Signed Saturate
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
561 \details Saturates a signed value.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
562 \param [in] value Value to be saturated
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
563 \param [in] sat Bit position to saturate to (1..32)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
564 \return Saturated value
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
565 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
566 #define __SSAT __ssat
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
567
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
568
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
569 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
570 \brief Unsigned Saturate
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
571 \details Saturates an unsigned value.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
572 \param [in] value Value to be saturated
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
573 \param [in] sat Bit position to saturate to (0..31)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
574 \return Saturated value
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
575 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
576 #define __USAT __usat
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
577
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
578
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
579 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
580 \brief Rotate Right with Extend (32 bit)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
581 \details Moves each bit of a bitstring right by one bit.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
582 The carry input is shifted in at the left end of the bitstring.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
583 \param [in] value Value to rotate
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
584 \return Rotated value
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
585 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
586 #ifndef __NO_EMBEDDED_ASM
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
587 __attribute__((section(".rrx_text"))) __STATIC_INLINE __ASM uint32_t __RRX(uint32_t value)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
588 {
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
589 rrx r0, r0
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
590 bx lr
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
591 }
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
592 #endif
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
593
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
594
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
595 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
596 \brief LDRT Unprivileged (8 bit)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
597 \details Executes a Unprivileged LDRT instruction for 8 bit value.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
598 \param [in] ptr Pointer to data
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
599 \return value of type uint8_t at (*ptr)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
600 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
601 #define __LDRBT(ptr) ((uint8_t ) __ldrt(ptr))
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
602
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
603
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
604 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
605 \brief LDRT Unprivileged (16 bit)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
606 \details Executes a Unprivileged LDRT instruction for 16 bit values.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
607 \param [in] ptr Pointer to data
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
608 \return value of type uint16_t at (*ptr)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
609 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
610 #define __LDRHT(ptr) ((uint16_t) __ldrt(ptr))
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
611
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
612
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
613 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
614 \brief LDRT Unprivileged (32 bit)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
615 \details Executes a Unprivileged LDRT instruction for 32 bit values.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
616 \param [in] ptr Pointer to data
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
617 \return value of type uint32_t at (*ptr)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
618 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
619 #define __LDRT(ptr) ((uint32_t ) __ldrt(ptr))
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
620
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
621
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
622 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
623 \brief STRT Unprivileged (8 bit)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
624 \details Executes a Unprivileged STRT instruction for 8 bit values.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
625 \param [in] value Value to store
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
626 \param [in] ptr Pointer to location
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
627 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
628 #define __STRBT(value, ptr) __strt(value, ptr)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
629
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
630
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
631 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
632 \brief STRT Unprivileged (16 bit)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
633 \details Executes a Unprivileged STRT instruction for 16 bit values.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
634 \param [in] value Value to store
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
635 \param [in] ptr Pointer to location
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
636 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
637 #define __STRHT(value, ptr) __strt(value, ptr)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
638
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
639
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
640 /**
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
641 \brief STRT Unprivileged (32 bit)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
642 \details Executes a Unprivileged STRT instruction for 32 bit values.
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
643 \param [in] value Value to store
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
644 \param [in] ptr Pointer to location
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
645 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
646 #define __STRT(value, ptr) __strt(value, ptr)
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
647
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
648 #endif /* (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
649
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
650 /*@}*/ /* end of group CMSIS_Core_InstructionInterface */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
651
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
652
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
653 /* ################### Compiler specific Intrinsics ########################### */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
654 /** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
655 Access to dedicated SIMD instructions
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
656 @{
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
657 */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
658
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
659 #if (__CORTEX_M >= 0x04U) /* only for Cortex-M4 and above */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
660
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
661 #define __SADD8 __sadd8
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
662 #define __QADD8 __qadd8
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
663 #define __SHADD8 __shadd8
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
664 #define __UADD8 __uadd8
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
665 #define __UQADD8 __uqadd8
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
666 #define __UHADD8 __uhadd8
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
667 #define __SSUB8 __ssub8
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
668 #define __QSUB8 __qsub8
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
669 #define __SHSUB8 __shsub8
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
670 #define __USUB8 __usub8
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
671 #define __UQSUB8 __uqsub8
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
672 #define __UHSUB8 __uhsub8
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
673 #define __SADD16 __sadd16
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
674 #define __QADD16 __qadd16
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
675 #define __SHADD16 __shadd16
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
676 #define __UADD16 __uadd16
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
677 #define __UQADD16 __uqadd16
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
678 #define __UHADD16 __uhadd16
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
679 #define __SSUB16 __ssub16
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
680 #define __QSUB16 __qsub16
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
681 #define __SHSUB16 __shsub16
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
682 #define __USUB16 __usub16
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
683 #define __UQSUB16 __uqsub16
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
684 #define __UHSUB16 __uhsub16
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
685 #define __SASX __sasx
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
686 #define __QASX __qasx
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
687 #define __SHASX __shasx
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
688 #define __UASX __uasx
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
689 #define __UQASX __uqasx
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
690 #define __UHASX __uhasx
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
691 #define __SSAX __ssax
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
692 #define __QSAX __qsax
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
693 #define __SHSAX __shsax
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
694 #define __USAX __usax
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
695 #define __UQSAX __uqsax
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
696 #define __UHSAX __uhsax
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
697 #define __USAD8 __usad8
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
698 #define __USADA8 __usada8
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
699 #define __SSAT16 __ssat16
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
700 #define __USAT16 __usat16
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
701 #define __UXTB16 __uxtb16
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
702 #define __UXTAB16 __uxtab16
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
703 #define __SXTB16 __sxtb16
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
704 #define __SXTAB16 __sxtab16
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
705 #define __SMUAD __smuad
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
706 #define __SMUADX __smuadx
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
707 #define __SMLAD __smlad
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
708 #define __SMLADX __smladx
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
709 #define __SMLALD __smlald
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
710 #define __SMLALDX __smlaldx
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
711 #define __SMUSD __smusd
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
712 #define __SMUSDX __smusdx
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
713 #define __SMLSD __smlsd
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
714 #define __SMLSDX __smlsdx
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
715 #define __SMLSLD __smlsld
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
716 #define __SMLSLDX __smlsldx
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
717 #define __SEL __sel
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
718 #define __QADD __qadd
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
719 #define __QSUB __qsub
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
720
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
721 #define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
722 ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) )
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
723
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
724 #define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
725 ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) )
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
726
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
727 #define __SMMLA(ARG1,ARG2,ARG3) ( (int32_t)((((int64_t)(ARG1) * (ARG2)) + \
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
728 ((int64_t)(ARG3) << 32U) ) >> 32U))
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
729
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
730 #endif /* (__CORTEX_M >= 0x04) */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
731 /*@} end of group CMSIS_SIMD_intrinsics */
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
732
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
733
32a3b1785697 a rough draft of Hardware Abstraction Layer for C++
cin
parents:
diff changeset
734 #endif /* __CMSIS_ARMCC_H */