Development mbed library for MAX32630FTHR

Dependents:   blinky_max32630fthr

Committer:
switches
Date:
Fri Dec 16 16:27:57 2016 +0000
Revision:
3:1198227e6421
Parent:
0:5c4d7b2438d3
Changed ADC scale for MAX32625 platforms to 1.2V full scale to match MAX32630 platforms

Who changed what in which revision?

UserRevisionLine numberNew contents of line
switches 0:5c4d7b2438d3 1
switches 0:5c4d7b2438d3 2 /** \addtogroup platform */
switches 0:5c4d7b2438d3 3 /** @{*/
switches 0:5c4d7b2438d3 4 /*
switches 0:5c4d7b2438d3 5 * Copyright (c) 2015-2016, ARM Limited, All Rights Reserved
switches 0:5c4d7b2438d3 6 * SPDX-License-Identifier: Apache-2.0
switches 0:5c4d7b2438d3 7 *
switches 0:5c4d7b2438d3 8 * Licensed under the Apache License, Version 2.0 (the "License"); you may
switches 0:5c4d7b2438d3 9 * not use this file except in compliance with the License.
switches 0:5c4d7b2438d3 10 * You may obtain a copy of the License at
switches 0:5c4d7b2438d3 11 *
switches 0:5c4d7b2438d3 12 * http://www.apache.org/licenses/LICENSE-2.0
switches 0:5c4d7b2438d3 13 *
switches 0:5c4d7b2438d3 14 * Unless required by applicable law or agreed to in writing, software
switches 0:5c4d7b2438d3 15 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
switches 0:5c4d7b2438d3 16 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
switches 0:5c4d7b2438d3 17 * See the License for the specific language governing permissions and
switches 0:5c4d7b2438d3 18 * limitations under the License.
switches 0:5c4d7b2438d3 19 */
switches 0:5c4d7b2438d3 20
switches 0:5c4d7b2438d3 21 #ifndef __MBED_UTIL_CRITICAL_H__
switches 0:5c4d7b2438d3 22 #define __MBED_UTIL_CRITICAL_H__
switches 0:5c4d7b2438d3 23
switches 0:5c4d7b2438d3 24 #include <stdbool.h>
switches 0:5c4d7b2438d3 25 #include <stdint.h>
switches 0:5c4d7b2438d3 26 #include <stddef.h>
switches 0:5c4d7b2438d3 27
switches 0:5c4d7b2438d3 28 #ifdef __cplusplus
switches 0:5c4d7b2438d3 29 extern "C" {
switches 0:5c4d7b2438d3 30 #endif
switches 0:5c4d7b2438d3 31
switches 0:5c4d7b2438d3 32
switches 0:5c4d7b2438d3 33 /** Determine the current interrupts enabled state
switches 0:5c4d7b2438d3 34 *
switches 0:5c4d7b2438d3 35 * This function can be called to determine whether or not interrupts are currently enabled.
switches 0:5c4d7b2438d3 36 * \note
switches 0:5c4d7b2438d3 37 * NOTE:
switches 0:5c4d7b2438d3 38 * This function works for both cortex-A and cortex-M, although the underlyng implementation
switches 0:5c4d7b2438d3 39 * differs.
switches 0:5c4d7b2438d3 40 * @return true if interrupts are enabled, false otherwise
switches 0:5c4d7b2438d3 41 */
switches 0:5c4d7b2438d3 42 bool core_util_are_interrupts_enabled(void);
switches 0:5c4d7b2438d3 43
switches 0:5c4d7b2438d3 44 /** Mark the start of a critical section
switches 0:5c4d7b2438d3 45 *
switches 0:5c4d7b2438d3 46 * This function should be called to mark the start of a critical section of code.
switches 0:5c4d7b2438d3 47 * \note
switches 0:5c4d7b2438d3 48 * NOTES:
switches 0:5c4d7b2438d3 49 * 1) The use of this style of critical section is targetted at C based implementations.
switches 0:5c4d7b2438d3 50 * 2) These critical sections can be nested.
switches 0:5c4d7b2438d3 51 * 3) The interrupt enable state on entry to the first critical section (of a nested set, or single
switches 0:5c4d7b2438d3 52 * section) will be preserved on exit from the section.
switches 0:5c4d7b2438d3 53 * 4) This implementation will currently only work on code running in privileged mode.
switches 0:5c4d7b2438d3 54 */
switches 0:5c4d7b2438d3 55 void core_util_critical_section_enter(void);
switches 0:5c4d7b2438d3 56
switches 0:5c4d7b2438d3 57 /** Mark the end of a critical section
switches 0:5c4d7b2438d3 58 *
switches 0:5c4d7b2438d3 59 * This function should be called to mark the end of a critical section of code.
switches 0:5c4d7b2438d3 60 * \note
switches 0:5c4d7b2438d3 61 * NOTES:
switches 0:5c4d7b2438d3 62 * 1) The use of this style of critical section is targetted at C based implementations.
switches 0:5c4d7b2438d3 63 * 2) These critical sections can be nested.
switches 0:5c4d7b2438d3 64 * 3) The interrupt enable state on entry to the first critical section (of a nested set, or single
switches 0:5c4d7b2438d3 65 * section) will be preserved on exit from the section.
switches 0:5c4d7b2438d3 66 * 4) This implementation will currently only work on code running in privileged mode.
switches 0:5c4d7b2438d3 67 */
switches 0:5c4d7b2438d3 68 void core_util_critical_section_exit(void);
switches 0:5c4d7b2438d3 69
switches 0:5c4d7b2438d3 70 /**
switches 0:5c4d7b2438d3 71 * Atomic compare and set. It compares the contents of a memory location to a
switches 0:5c4d7b2438d3 72 * given value and, only if they are the same, modifies the contents of that
switches 0:5c4d7b2438d3 73 * memory location to a given new value. This is done as a single atomic
switches 0:5c4d7b2438d3 74 * operation. The atomicity guarantees that the new value is calculated based on
switches 0:5c4d7b2438d3 75 * up-to-date information; if the value had been updated by another thread in
switches 0:5c4d7b2438d3 76 * the meantime, the write would fail due to a mismatched expectedCurrentValue.
switches 0:5c4d7b2438d3 77 *
switches 0:5c4d7b2438d3 78 * Refer to https://en.wikipedia.org/wiki/Compare-and-set [which may redirect
switches 0:5c4d7b2438d3 79 * you to the article on compare-and swap].
switches 0:5c4d7b2438d3 80 *
switches 0:5c4d7b2438d3 81 * @param ptr The target memory location.
switches 0:5c4d7b2438d3 82 * @param[in,out] expectedCurrentValue A pointer to some location holding the
switches 0:5c4d7b2438d3 83 * expected current value of the data being set atomically.
switches 0:5c4d7b2438d3 84 * The computed 'desiredValue' should be a function of this current value.
switches 0:5c4d7b2438d3 85 * @Note: This is an in-out parameter. In the
switches 0:5c4d7b2438d3 86 * failure case of atomic_cas (where the
switches 0:5c4d7b2438d3 87 * destination isn't set), the pointee of expectedCurrentValue is
switches 0:5c4d7b2438d3 88 * updated with the current value.
switches 0:5c4d7b2438d3 89 * @param[in] desiredValue The new value computed based on '*expectedCurrentValue'.
switches 0:5c4d7b2438d3 90 *
switches 0:5c4d7b2438d3 91 * @return true if the memory location was atomically
switches 0:5c4d7b2438d3 92 * updated with the desired value (after verifying
switches 0:5c4d7b2438d3 93 * that it contained the expectedCurrentValue),
switches 0:5c4d7b2438d3 94 * false otherwise. In the failure case,
switches 0:5c4d7b2438d3 95 * exepctedCurrentValue is updated with the new
switches 0:5c4d7b2438d3 96 * value of the target memory location.
switches 0:5c4d7b2438d3 97 *
switches 0:5c4d7b2438d3 98 * pseudocode:
switches 0:5c4d7b2438d3 99 * function cas(p : pointer to int, old : pointer to int, new : int) returns bool {
switches 0:5c4d7b2438d3 100 * if *p != *old {
switches 0:5c4d7b2438d3 101 * *old = *p
switches 0:5c4d7b2438d3 102 * return false
switches 0:5c4d7b2438d3 103 * }
switches 0:5c4d7b2438d3 104 * *p = new
switches 0:5c4d7b2438d3 105 * return true
switches 0:5c4d7b2438d3 106 * }
switches 0:5c4d7b2438d3 107 *
switches 0:5c4d7b2438d3 108 * @Note: In the failure case (where the destination isn't set), the value
switches 0:5c4d7b2438d3 109 * pointed to by expectedCurrentValue is still updated with the current value.
switches 0:5c4d7b2438d3 110 * This property helps writing concise code for the following incr:
switches 0:5c4d7b2438d3 111 *
switches 0:5c4d7b2438d3 112 * function incr(p : pointer to int, a : int) returns int {
switches 0:5c4d7b2438d3 113 * done = false
switches 0:5c4d7b2438d3 114 * value = *p // This fetch operation need not be atomic.
switches 0:5c4d7b2438d3 115 * while not done {
switches 0:5c4d7b2438d3 116 * done = atomic_cas(p, &value, value + a) // *value gets updated automatically until success
switches 0:5c4d7b2438d3 117 * }
switches 0:5c4d7b2438d3 118 * return value + a
switches 0:5c4d7b2438d3 119 * }
switches 0:5c4d7b2438d3 120 */
switches 0:5c4d7b2438d3 121 bool core_util_atomic_cas_u8(uint8_t *ptr, uint8_t *expectedCurrentValue, uint8_t desiredValue);
switches 0:5c4d7b2438d3 122
switches 0:5c4d7b2438d3 123 /**
switches 0:5c4d7b2438d3 124 * Atomic compare and set. It compares the contents of a memory location to a
switches 0:5c4d7b2438d3 125 * given value and, only if they are the same, modifies the contents of that
switches 0:5c4d7b2438d3 126 * memory location to a given new value. This is done as a single atomic
switches 0:5c4d7b2438d3 127 * operation. The atomicity guarantees that the new value is calculated based on
switches 0:5c4d7b2438d3 128 * up-to-date information; if the value had been updated by another thread in
switches 0:5c4d7b2438d3 129 * the meantime, the write would fail due to a mismatched expectedCurrentValue.
switches 0:5c4d7b2438d3 130 *
switches 0:5c4d7b2438d3 131 * Refer to https://en.wikipedia.org/wiki/Compare-and-set [which may redirect
switches 0:5c4d7b2438d3 132 * you to the article on compare-and swap].
switches 0:5c4d7b2438d3 133 *
switches 0:5c4d7b2438d3 134 * @param ptr The target memory location.
switches 0:5c4d7b2438d3 135 * @param[in,out] expectedCurrentValue A pointer to some location holding the
switches 0:5c4d7b2438d3 136 * expected current value of the data being set atomically.
switches 0:5c4d7b2438d3 137 * The computed 'desiredValue' should be a function of this current value.
switches 0:5c4d7b2438d3 138 * @Note: This is an in-out parameter. In the
switches 0:5c4d7b2438d3 139 * failure case of atomic_cas (where the
switches 0:5c4d7b2438d3 140 * destination isn't set), the pointee of expectedCurrentValue is
switches 0:5c4d7b2438d3 141 * updated with the current value.
switches 0:5c4d7b2438d3 142 * @param[in] desiredValue The new value computed based on '*expectedCurrentValue'.
switches 0:5c4d7b2438d3 143 *
switches 0:5c4d7b2438d3 144 * @return true if the memory location was atomically
switches 0:5c4d7b2438d3 145 * updated with the desired value (after verifying
switches 0:5c4d7b2438d3 146 * that it contained the expectedCurrentValue),
switches 0:5c4d7b2438d3 147 * false otherwise. In the failure case,
switches 0:5c4d7b2438d3 148 * exepctedCurrentValue is updated with the new
switches 0:5c4d7b2438d3 149 * value of the target memory location.
switches 0:5c4d7b2438d3 150 *
switches 0:5c4d7b2438d3 151 * pseudocode:
switches 0:5c4d7b2438d3 152 * function cas(p : pointer to int, old : pointer to int, new : int) returns bool {
switches 0:5c4d7b2438d3 153 * if *p != *old {
switches 0:5c4d7b2438d3 154 * *old = *p
switches 0:5c4d7b2438d3 155 * return false
switches 0:5c4d7b2438d3 156 * }
switches 0:5c4d7b2438d3 157 * *p = new
switches 0:5c4d7b2438d3 158 * return true
switches 0:5c4d7b2438d3 159 * }
switches 0:5c4d7b2438d3 160 *
switches 0:5c4d7b2438d3 161 * @Note: In the failure case (where the destination isn't set), the value
switches 0:5c4d7b2438d3 162 * pointed to by expectedCurrentValue is still updated with the current value.
switches 0:5c4d7b2438d3 163 * This property helps writing concise code for the following incr:
switches 0:5c4d7b2438d3 164 *
switches 0:5c4d7b2438d3 165 * function incr(p : pointer to int, a : int) returns int {
switches 0:5c4d7b2438d3 166 * done = false
switches 0:5c4d7b2438d3 167 * value = *p // This fetch operation need not be atomic.
switches 0:5c4d7b2438d3 168 * while not done {
switches 0:5c4d7b2438d3 169 * done = atomic_cas(p, &value, value + a) // *value gets updated automatically until success
switches 0:5c4d7b2438d3 170 * }
switches 0:5c4d7b2438d3 171 * return value + a
switches 0:5c4d7b2438d3 172 * }
switches 0:5c4d7b2438d3 173 */
switches 0:5c4d7b2438d3 174 bool core_util_atomic_cas_u16(uint16_t *ptr, uint16_t *expectedCurrentValue, uint16_t desiredValue);
switches 0:5c4d7b2438d3 175
switches 0:5c4d7b2438d3 176 /**
switches 0:5c4d7b2438d3 177 * Atomic compare and set. It compares the contents of a memory location to a
switches 0:5c4d7b2438d3 178 * given value and, only if they are the same, modifies the contents of that
switches 0:5c4d7b2438d3 179 * memory location to a given new value. This is done as a single atomic
switches 0:5c4d7b2438d3 180 * operation. The atomicity guarantees that the new value is calculated based on
switches 0:5c4d7b2438d3 181 * up-to-date information; if the value had been updated by another thread in
switches 0:5c4d7b2438d3 182 * the meantime, the write would fail due to a mismatched expectedCurrentValue.
switches 0:5c4d7b2438d3 183 *
switches 0:5c4d7b2438d3 184 * Refer to https://en.wikipedia.org/wiki/Compare-and-set [which may redirect
switches 0:5c4d7b2438d3 185 * you to the article on compare-and swap].
switches 0:5c4d7b2438d3 186 *
switches 0:5c4d7b2438d3 187 * @param ptr The target memory location.
switches 0:5c4d7b2438d3 188 * @param[in,out] expectedCurrentValue A pointer to some location holding the
switches 0:5c4d7b2438d3 189 * expected current value of the data being set atomically.
switches 0:5c4d7b2438d3 190 * The computed 'desiredValue' should be a function of this current value.
switches 0:5c4d7b2438d3 191 * @Note: This is an in-out parameter. In the
switches 0:5c4d7b2438d3 192 * failure case of atomic_cas (where the
switches 0:5c4d7b2438d3 193 * destination isn't set), the pointee of expectedCurrentValue is
switches 0:5c4d7b2438d3 194 * updated with the current value.
switches 0:5c4d7b2438d3 195 * @param[in] desiredValue The new value computed based on '*expectedCurrentValue'.
switches 0:5c4d7b2438d3 196 *
switches 0:5c4d7b2438d3 197 * @return true if the memory location was atomically
switches 0:5c4d7b2438d3 198 * updated with the desired value (after verifying
switches 0:5c4d7b2438d3 199 * that it contained the expectedCurrentValue),
switches 0:5c4d7b2438d3 200 * false otherwise. In the failure case,
switches 0:5c4d7b2438d3 201 * exepctedCurrentValue is updated with the new
switches 0:5c4d7b2438d3 202 * value of the target memory location.
switches 0:5c4d7b2438d3 203 *
switches 0:5c4d7b2438d3 204 * pseudocode:
switches 0:5c4d7b2438d3 205 * function cas(p : pointer to int, old : pointer to int, new : int) returns bool {
switches 0:5c4d7b2438d3 206 * if *p != *old {
switches 0:5c4d7b2438d3 207 * *old = *p
switches 0:5c4d7b2438d3 208 * return false
switches 0:5c4d7b2438d3 209 * }
switches 0:5c4d7b2438d3 210 * *p = new
switches 0:5c4d7b2438d3 211 * return true
switches 0:5c4d7b2438d3 212 * }
switches 0:5c4d7b2438d3 213 *
switches 0:5c4d7b2438d3 214 * @Note: In the failure case (where the destination isn't set), the value
switches 0:5c4d7b2438d3 215 * pointed to by expectedCurrentValue is still updated with the current value.
switches 0:5c4d7b2438d3 216 * This property helps writing concise code for the following incr:
switches 0:5c4d7b2438d3 217 *
switches 0:5c4d7b2438d3 218 * function incr(p : pointer to int, a : int) returns int {
switches 0:5c4d7b2438d3 219 * done = false
switches 0:5c4d7b2438d3 220 * value = *p // This fetch operation need not be atomic.
switches 0:5c4d7b2438d3 221 * while not done {
switches 0:5c4d7b2438d3 222 * done = atomic_cas(p, &value, value + a) // *value gets updated automatically until success
switches 0:5c4d7b2438d3 223 * }
switches 0:5c4d7b2438d3 224 * return value + a
switches 0:5c4d7b2438d3 225 * }
switches 0:5c4d7b2438d3 226 */
switches 0:5c4d7b2438d3 227 bool core_util_atomic_cas_u32(uint32_t *ptr, uint32_t *expectedCurrentValue, uint32_t desiredValue);
switches 0:5c4d7b2438d3 228
switches 0:5c4d7b2438d3 229 /**
switches 0:5c4d7b2438d3 230 * Atomic compare and set. It compares the contents of a memory location to a
switches 0:5c4d7b2438d3 231 * given value and, only if they are the same, modifies the contents of that
switches 0:5c4d7b2438d3 232 * memory location to a given new value. This is done as a single atomic
switches 0:5c4d7b2438d3 233 * operation. The atomicity guarantees that the new value is calculated based on
switches 0:5c4d7b2438d3 234 * up-to-date information; if the value had been updated by another thread in
switches 0:5c4d7b2438d3 235 * the meantime, the write would fail due to a mismatched expectedCurrentValue.
switches 0:5c4d7b2438d3 236 *
switches 0:5c4d7b2438d3 237 * Refer to https://en.wikipedia.org/wiki/Compare-and-set [which may redirect
switches 0:5c4d7b2438d3 238 * you to the article on compare-and swap].
switches 0:5c4d7b2438d3 239 *
switches 0:5c4d7b2438d3 240 * @param ptr The target memory location.
switches 0:5c4d7b2438d3 241 * @param[in,out] expectedCurrentValue A pointer to some location holding the
switches 0:5c4d7b2438d3 242 * expected current value of the data being set atomically.
switches 0:5c4d7b2438d3 243 * The computed 'desiredValue' should be a function of this current value.
switches 0:5c4d7b2438d3 244 * @Note: This is an in-out parameter. In the
switches 0:5c4d7b2438d3 245 * failure case of atomic_cas (where the
switches 0:5c4d7b2438d3 246 * destination isn't set), the pointee of expectedCurrentValue is
switches 0:5c4d7b2438d3 247 * updated with the current value.
switches 0:5c4d7b2438d3 248 * @param[in] desiredValue The new value computed based on '*expectedCurrentValue'.
switches 0:5c4d7b2438d3 249 *
switches 0:5c4d7b2438d3 250 * @return true if the memory location was atomically
switches 0:5c4d7b2438d3 251 * updated with the desired value (after verifying
switches 0:5c4d7b2438d3 252 * that it contained the expectedCurrentValue),
switches 0:5c4d7b2438d3 253 * false otherwise. In the failure case,
switches 0:5c4d7b2438d3 254 * exepctedCurrentValue is updated with the new
switches 0:5c4d7b2438d3 255 * value of the target memory location.
switches 0:5c4d7b2438d3 256 *
switches 0:5c4d7b2438d3 257 * pseudocode:
switches 0:5c4d7b2438d3 258 * function cas(p : pointer to int, old : pointer to int, new : int) returns bool {
switches 0:5c4d7b2438d3 259 * if *p != *old {
switches 0:5c4d7b2438d3 260 * *old = *p
switches 0:5c4d7b2438d3 261 * return false
switches 0:5c4d7b2438d3 262 * }
switches 0:5c4d7b2438d3 263 * *p = new
switches 0:5c4d7b2438d3 264 * return true
switches 0:5c4d7b2438d3 265 * }
switches 0:5c4d7b2438d3 266 *
switches 0:5c4d7b2438d3 267 * @Note: In the failure case (where the destination isn't set), the value
switches 0:5c4d7b2438d3 268 * pointed to by expectedCurrentValue is still updated with the current value.
switches 0:5c4d7b2438d3 269 * This property helps writing concise code for the following incr:
switches 0:5c4d7b2438d3 270 *
switches 0:5c4d7b2438d3 271 * function incr(p : pointer to int, a : int) returns int {
switches 0:5c4d7b2438d3 272 * done = false
switches 0:5c4d7b2438d3 273 * value = *p // This fetch operation need not be atomic.
switches 0:5c4d7b2438d3 274 * while not done {
switches 0:5c4d7b2438d3 275 * done = atomic_cas(p, &value, value + a) // *value gets updated automatically until success
switches 0:5c4d7b2438d3 276 * }
switches 0:5c4d7b2438d3 277 * return value + a
switches 0:5c4d7b2438d3 278 * }
switches 0:5c4d7b2438d3 279 */
switches 0:5c4d7b2438d3 280 bool core_util_atomic_cas_ptr(void **ptr, void **expectedCurrentValue, void *desiredValue);
switches 0:5c4d7b2438d3 281
switches 0:5c4d7b2438d3 282 /**
switches 0:5c4d7b2438d3 283 * Atomic increment.
switches 0:5c4d7b2438d3 284 * @param valuePtr Target memory location being incremented.
switches 0:5c4d7b2438d3 285 * @param delta The amount being incremented.
switches 0:5c4d7b2438d3 286 * @return The new incremented value.
switches 0:5c4d7b2438d3 287 */
switches 0:5c4d7b2438d3 288 uint8_t core_util_atomic_incr_u8(uint8_t *valuePtr, uint8_t delta);
switches 0:5c4d7b2438d3 289
switches 0:5c4d7b2438d3 290 /**
switches 0:5c4d7b2438d3 291 * Atomic increment.
switches 0:5c4d7b2438d3 292 * @param valuePtr Target memory location being incremented.
switches 0:5c4d7b2438d3 293 * @param delta The amount being incremented.
switches 0:5c4d7b2438d3 294 * @return The new incremented value.
switches 0:5c4d7b2438d3 295 */
switches 0:5c4d7b2438d3 296 uint16_t core_util_atomic_incr_u16(uint16_t *valuePtr, uint16_t delta);
switches 0:5c4d7b2438d3 297
switches 0:5c4d7b2438d3 298 /**
switches 0:5c4d7b2438d3 299 * Atomic increment.
switches 0:5c4d7b2438d3 300 * @param valuePtr Target memory location being incremented.
switches 0:5c4d7b2438d3 301 * @param delta The amount being incremented.
switches 0:5c4d7b2438d3 302 * @return The new incremented value.
switches 0:5c4d7b2438d3 303 */
switches 0:5c4d7b2438d3 304 uint32_t core_util_atomic_incr_u32(uint32_t *valuePtr, uint32_t delta);
switches 0:5c4d7b2438d3 305
switches 0:5c4d7b2438d3 306 /**
switches 0:5c4d7b2438d3 307 * Atomic increment.
switches 0:5c4d7b2438d3 308 * @param valuePtr Target memory location being incremented.
switches 0:5c4d7b2438d3 309 * @param delta The amount being incremented in bytes.
switches 0:5c4d7b2438d3 310 * @return The new incremented value.
switches 0:5c4d7b2438d3 311 *
switches 0:5c4d7b2438d3 312 * @note The type of the pointer argument is not taken into account
switches 0:5c4d7b2438d3 313 * and the pointer is incremented by bytes.
switches 0:5c4d7b2438d3 314 */
switches 0:5c4d7b2438d3 315 void *core_util_atomic_incr_ptr(void **valuePtr, ptrdiff_t delta);
switches 0:5c4d7b2438d3 316
switches 0:5c4d7b2438d3 317 /**
switches 0:5c4d7b2438d3 318 * Atomic decrement.
switches 0:5c4d7b2438d3 319 * @param valuePtr Target memory location being decremented.
switches 0:5c4d7b2438d3 320 * @param delta The amount being decremented.
switches 0:5c4d7b2438d3 321 * @return The new decremented value.
switches 0:5c4d7b2438d3 322 */
switches 0:5c4d7b2438d3 323 uint8_t core_util_atomic_decr_u8(uint8_t *valuePtr, uint8_t delta);
switches 0:5c4d7b2438d3 324
switches 0:5c4d7b2438d3 325 /**
switches 0:5c4d7b2438d3 326 * Atomic decrement.
switches 0:5c4d7b2438d3 327 * @param valuePtr Target memory location being decremented.
switches 0:5c4d7b2438d3 328 * @param delta The amount being decremented.
switches 0:5c4d7b2438d3 329 * @return The new decremented value.
switches 0:5c4d7b2438d3 330 */
switches 0:5c4d7b2438d3 331 uint16_t core_util_atomic_decr_u16(uint16_t *valuePtr, uint16_t delta);
switches 0:5c4d7b2438d3 332
switches 0:5c4d7b2438d3 333 /**
switches 0:5c4d7b2438d3 334 * Atomic decrement.
switches 0:5c4d7b2438d3 335 * @param valuePtr Target memory location being decremented.
switches 0:5c4d7b2438d3 336 * @param delta The amount being decremented.
switches 0:5c4d7b2438d3 337 * @return The new decremented value.
switches 0:5c4d7b2438d3 338 */
switches 0:5c4d7b2438d3 339 uint32_t core_util_atomic_decr_u32(uint32_t *valuePtr, uint32_t delta);
switches 0:5c4d7b2438d3 340
switches 0:5c4d7b2438d3 341 /**
switches 0:5c4d7b2438d3 342 * Atomic decrement.
switches 0:5c4d7b2438d3 343 * @param valuePtr Target memory location being decremented.
switches 0:5c4d7b2438d3 344 * @param delta The amount being decremented in bytes.
switches 0:5c4d7b2438d3 345 * @return The new decremented value.
switches 0:5c4d7b2438d3 346 *
switches 0:5c4d7b2438d3 347 * @note The type of the pointer argument is not taken into account
switches 0:5c4d7b2438d3 348 * and the pointer is decremented by bytes
switches 0:5c4d7b2438d3 349 */
switches 0:5c4d7b2438d3 350 void *core_util_atomic_decr_ptr(void **valuePtr, ptrdiff_t delta);
switches 0:5c4d7b2438d3 351
switches 0:5c4d7b2438d3 352 #ifdef __cplusplus
switches 0:5c4d7b2438d3 353 } // extern "C"
switches 0:5c4d7b2438d3 354 #endif
switches 0:5c4d7b2438d3 355
switches 0:5c4d7b2438d3 356
switches 0:5c4d7b2438d3 357 #endif // __MBED_UTIL_CRITICAL_H__
switches 0:5c4d7b2438d3 358
switches 0:5c4d7b2438d3 359 /** @}*/