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

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

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

Committer:
Kojto
Date:
Fri Aug 12 13:04:35 2016 +0200
Revision:
123:b0220dba8be7
Parent:
97:433970e64889
Release 123 of the mbed library

Changes:
- new targets: nucleo_f207zg, beetle, nrf51_dk, hexiwear,
nuvoton nuc472, vk rz a1h
- ST - fix timer interrupt handler, sleep api fix
- NXP - lpc15xx us ticker fix
- Nordic - analogin fixes, LF clock init addition, enable i2c async

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 123:b0220dba8be7 1 /*
Kojto 123:b0220dba8be7 2 * Copyright (c) 2015 Nordic Semiconductor ASA
Kojto 97:433970e64889 3 * All rights reserved.
Kojto 123:b0220dba8be7 4 *
Kojto 123:b0220dba8be7 5 * Redistribution and use in source and binary forms, with or without modification,
Kojto 123:b0220dba8be7 6 * are permitted provided that the following conditions are met:
Kojto 123:b0220dba8be7 7 *
Kojto 123:b0220dba8be7 8 * 1. Redistributions of source code must retain the above copyright notice, this list
Kojto 123:b0220dba8be7 9 * of conditions and the following disclaimer.
Kojto 97:433970e64889 10 *
Kojto 123:b0220dba8be7 11 * 2. Redistributions in binary form, except as embedded into a Nordic Semiconductor ASA
Kojto 123:b0220dba8be7 12 * integrated circuit in a product or a software update for such product, must reproduce
Kojto 123:b0220dba8be7 13 * the above copyright notice, this list of conditions and the following disclaimer in
Kojto 123:b0220dba8be7 14 * the documentation and/or other materials provided with the distribution.
Kojto 97:433970e64889 15 *
Kojto 123:b0220dba8be7 16 * 3. Neither the name of Nordic Semiconductor ASA nor the names of its contributors may be
Kojto 123:b0220dba8be7 17 * used to endorse or promote products derived from this software without specific prior
Kojto 123:b0220dba8be7 18 * written permission.
Kojto 91:031413cf7a89 19 *
Kojto 123:b0220dba8be7 20 * 4. This software, with or without modification, must only be used with a
Kojto 123:b0220dba8be7 21 * Nordic Semiconductor ASA integrated circuit.
Kojto 91:031413cf7a89 22 *
Kojto 123:b0220dba8be7 23 * 5. Any software provided in binary or object form under this license must not be reverse
Kojto 123:b0220dba8be7 24 * engineered, decompiled, modified and/or disassembled.
Kojto 123:b0220dba8be7 25 *
Kojto 123:b0220dba8be7 26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
Kojto 123:b0220dba8be7 27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
Kojto 123:b0220dba8be7 28 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 123:b0220dba8be7 29 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
Kojto 123:b0220dba8be7 30 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
Kojto 123:b0220dba8be7 31 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
Kojto 123:b0220dba8be7 32 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
Kojto 123:b0220dba8be7 33 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
Kojto 123:b0220dba8be7 34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
Kojto 123:b0220dba8be7 35 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 123:b0220dba8be7 36 *
Kojto 91:031413cf7a89 37 */
Kojto 123:b0220dba8be7 38
Kojto 91:031413cf7a89 39 #ifndef _COMPILER_ABSTRACTION_H
Kojto 91:031413cf7a89 40 #define _COMPILER_ABSTRACTION_H
Kojto 91:031413cf7a89 41
Kojto 91:031413cf7a89 42 /*lint ++flb "Enter library region" */
Kojto 91:031413cf7a89 43
Kojto 91:031413cf7a89 44 #if defined ( __CC_ARM )
Kojto 123:b0220dba8be7 45
Kojto 97:433970e64889 46 #ifndef __ASM
Kojto 123:b0220dba8be7 47 #define __ASM __asm
Kojto 97:433970e64889 48 #endif
Kojto 123:b0220dba8be7 49
Kojto 97:433970e64889 50 #ifndef __INLINE
Kojto 123:b0220dba8be7 51 #define __INLINE __inline
Kojto 97:433970e64889 52 #endif
Kojto 123:b0220dba8be7 53
Kojto 97:433970e64889 54 #ifndef __WEAK
Kojto 123:b0220dba8be7 55 #define __WEAK __weak
Kojto 97:433970e64889 56 #endif
Kojto 123:b0220dba8be7 57
Kojto 123:b0220dba8be7 58 #ifndef __ALIGN
Kojto 123:b0220dba8be7 59 #define __ALIGN(n) __align(n)
Kojto 123:b0220dba8be7 60 #endif
Kojto 123:b0220dba8be7 61
Kojto 123:b0220dba8be7 62 #define GET_SP() __current_sp()
Kojto 123:b0220dba8be7 63
Kojto 97:433970e64889 64 #elif defined ( __ICCARM__ )
Kojto 123:b0220dba8be7 65
Kojto 97:433970e64889 66 #ifndef __ASM
Kojto 123:b0220dba8be7 67 #define __ASM __asm
Kojto 97:433970e64889 68 #endif
Kojto 123:b0220dba8be7 69
Kojto 97:433970e64889 70 #ifndef __INLINE
Kojto 123:b0220dba8be7 71 #define __INLINE inline
Kojto 97:433970e64889 72 #endif
Kojto 123:b0220dba8be7 73
Kojto 97:433970e64889 74 #ifndef __WEAK
Kojto 123:b0220dba8be7 75 #define __WEAK __weak
Kojto 97:433970e64889 76 #endif
Kojto 123:b0220dba8be7 77
Kojto 123:b0220dba8be7 78 /* Not defined for IAR since it requires a new line to work, and C preprocessor does not allow that. */
Kojto 123:b0220dba8be7 79 #ifndef __ALIGN
Kojto 123:b0220dba8be7 80 #define __ALIGN(n)
Kojto 123:b0220dba8be7 81 #endif
Kojto 123:b0220dba8be7 82
Kojto 123:b0220dba8be7 83 #define GET_SP() __get_SP()
Kojto 123:b0220dba8be7 84
Kojto 97:433970e64889 85 #elif defined ( __GNUC__ )
Kojto 123:b0220dba8be7 86
Kojto 97:433970e64889 87 #ifndef __ASM
Kojto 123:b0220dba8be7 88 #define __ASM __asm
Kojto 97:433970e64889 89 #endif
Kojto 123:b0220dba8be7 90
Kojto 97:433970e64889 91 #ifndef __INLINE
Kojto 123:b0220dba8be7 92 #define __INLINE inline
Kojto 97:433970e64889 93 #endif
Kojto 123:b0220dba8be7 94
Kojto 97:433970e64889 95 #ifndef __WEAK
Kojto 123:b0220dba8be7 96 #define __WEAK __attribute__((weak))
Kojto 97:433970e64889 97 #endif
Kojto 123:b0220dba8be7 98
Kojto 123:b0220dba8be7 99 #ifndef __ALIGN
Kojto 123:b0220dba8be7 100 #define __ALIGN(n) __attribute__((aligned(n)))
Kojto 123:b0220dba8be7 101 #endif
Kojto 123:b0220dba8be7 102
Kojto 123:b0220dba8be7 103 #define GET_SP() gcc_current_sp()
Kojto 91:031413cf7a89 104
Kojto 97:433970e64889 105 static inline unsigned int gcc_current_sp(void)
Kojto 97:433970e64889 106 {
Kojto 123:b0220dba8be7 107 register unsigned sp __ASM("sp");
Kojto 97:433970e64889 108 return sp;
Kojto 97:433970e64889 109 }
Kojto 123:b0220dba8be7 110
Kojto 97:433970e64889 111 #elif defined ( __TASKING__ )
Kojto 123:b0220dba8be7 112
Kojto 123:b0220dba8be7 113 #ifndef __ASM
Kojto 123:b0220dba8be7 114 #define __ASM __asm
Kojto 97:433970e64889 115 #endif
Kojto 123:b0220dba8be7 116
Kojto 97:433970e64889 117 #ifndef __INLINE
Kojto 123:b0220dba8be7 118 #define __INLINE inline
Kojto 97:433970e64889 119 #endif
Kojto 123:b0220dba8be7 120
Kojto 97:433970e64889 121 #ifndef __WEAK
Kojto 123:b0220dba8be7 122 #define __WEAK __attribute__((weak))
Kojto 97:433970e64889 123 #endif
Kojto 123:b0220dba8be7 124
Kojto 123:b0220dba8be7 125 #ifndef __ALIGN
Kojto 123:b0220dba8be7 126 #define __ALIGN(n) __align(n)
Kojto 123:b0220dba8be7 127 #endif
Kojto 123:b0220dba8be7 128
Kojto 123:b0220dba8be7 129 #define GET_SP() __get_MSP()
Kojto 123:b0220dba8be7 130
Kojto 91:031413cf7a89 131 #endif
Kojto 91:031413cf7a89 132
Kojto 91:031413cf7a89 133 /*lint --flb "Leave library region" */
Kojto 91:031413cf7a89 134
Kojto 91:031413cf7a89 135 #endif