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

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

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

Committer:
<>
Date:
Thu Mar 30 13:26:47 2017 +0100
Revision:
139:856d2700e60b
Parent:
128:9bcdf88f62b0
Release 139 of the mbed library

Ports for Upcoming Targets

3934: [Silicon Labs] Update to HAL and devices https://github.com/ARMmbed/mbed-os/pull/3934

Known Issues

There is an issue with LPC1768 failing the 'Semihost file system' test with this release.

Fixes and Changes

3691: [TLS / hw acceleration] AES ECB for NUCLEO_F439ZI https://github.com/ARMmbed/mbed-os/pull/3691
3869: NCS36510: Default range changed from 0 to 950mV - ADC https://github.com/ARMmbed/mbed-os/pull/3869
3893: [STM32F7] Update STM32 Cube version v1.6.0 https://github.com/ARMmbed/mbed-os/pull/3893
3917: Fix mistake register setting in serial_format() https://github.com/ARMmbed/mbed-os/pull/3917
3927: [DELTA_DFBM_NQ620] Add RC calibration setting and revise mbed_overrides.c https://github.com/ARMmbed/mbed-os/pull/3927
3918: [NUC472/M453] Support unique locally administered MAC address and other driver updates https://github.com/ARMmbed/mbed-os/pull/3918
3920: Heap size adjusted to work for both tls-client and mbed-client https://github.com/ARMmbed/mbed-os/pull/3920
3969: NUCLEO_F302R8: Add missing PB_8/PB_9 CAN pins https://github.com/ARMmbed/mbed-os/pull/3969

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 98:8ab26030e058 1 /***************************************************************************//**
Kojto 98:8ab26030e058 2 * @file em_rmu.h
Kojto 98:8ab26030e058 3 * @brief Reset Management Unit (RMU) peripheral API
<> 139:856d2700e60b 4 * @version 5.1.2
Kojto 98:8ab26030e058 5 *******************************************************************************
Kojto 98:8ab26030e058 6 * @section License
<> 128:9bcdf88f62b0 7 * <b>Copyright 2016 Silicon Laboratories, Inc. http://www.silabs.com</b>
Kojto 98:8ab26030e058 8 *******************************************************************************
Kojto 98:8ab26030e058 9 *
Kojto 98:8ab26030e058 10 * Permission is granted to anyone to use this software for any purpose,
Kojto 98:8ab26030e058 11 * including commercial applications, and to alter it and redistribute it
Kojto 98:8ab26030e058 12 * freely, subject to the following restrictions:
Kojto 98:8ab26030e058 13 *
Kojto 98:8ab26030e058 14 * 1. The origin of this software must not be misrepresented; you must not
Kojto 98:8ab26030e058 15 * claim that you wrote the original software.
Kojto 98:8ab26030e058 16 * 2. Altered source versions must be plainly marked as such, and must not be
Kojto 98:8ab26030e058 17 * misrepresented as being the original software.
Kojto 98:8ab26030e058 18 * 3. This notice may not be removed or altered from any source distribution.
Kojto 98:8ab26030e058 19 *
Kojto 98:8ab26030e058 20 * DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Labs has no
Kojto 98:8ab26030e058 21 * obligation to support this Software. Silicon Labs is providing the
Kojto 98:8ab26030e058 22 * Software "AS IS", with no express or implied warranties of any kind,
Kojto 98:8ab26030e058 23 * including, but not limited to, any implied warranties of merchantability
Kojto 98:8ab26030e058 24 * or fitness for any particular purpose or warranties against infringement
Kojto 98:8ab26030e058 25 * of any proprietary rights of a third party.
Kojto 98:8ab26030e058 26 *
Kojto 98:8ab26030e058 27 * Silicon Labs will not be liable for any consequential, incidental, or
Kojto 98:8ab26030e058 28 * special damages, or any other relief, or for any claim by any third party,
Kojto 98:8ab26030e058 29 * arising from your use of this Software.
Kojto 98:8ab26030e058 30 *
Kojto 98:8ab26030e058 31 ******************************************************************************/
Kojto 98:8ab26030e058 32
<> 128:9bcdf88f62b0 33 #ifndef EM_RMU_H
<> 128:9bcdf88f62b0 34 #define EM_RMU_H
Kojto 98:8ab26030e058 35
Kojto 98:8ab26030e058 36 #include "em_device.h"
Kojto 98:8ab26030e058 37 #if defined(RMU_COUNT) && (RMU_COUNT > 0)
Kojto 113:f141b2784e32 38 #include "em_assert.h"
Kojto 98:8ab26030e058 39
Kojto 98:8ab26030e058 40 #include <stdbool.h>
Kojto 98:8ab26030e058 41
Kojto 98:8ab26030e058 42 #ifdef __cplusplus
Kojto 98:8ab26030e058 43 extern "C" {
Kojto 98:8ab26030e058 44 #endif
Kojto 98:8ab26030e058 45
Kojto 98:8ab26030e058 46 /***************************************************************************//**
<> 128:9bcdf88f62b0 47 * @addtogroup emlib
Kojto 98:8ab26030e058 48 * @{
Kojto 98:8ab26030e058 49 ******************************************************************************/
Kojto 98:8ab26030e058 50
Kojto 98:8ab26030e058 51 /***************************************************************************//**
Kojto 98:8ab26030e058 52 * @addtogroup RMU
Kojto 98:8ab26030e058 53 * @{
Kojto 98:8ab26030e058 54 ******************************************************************************/
Kojto 98:8ab26030e058 55
Kojto 98:8ab26030e058 56 /*******************************************************************************
Kojto 98:8ab26030e058 57 ******************************** ENUMS ************************************
Kojto 98:8ab26030e058 58 ******************************************************************************/
Kojto 98:8ab26030e058 59
Kojto 113:f141b2784e32 60 /** RMU reset modes */
Kojto 113:f141b2784e32 61 typedef enum
Kojto 113:f141b2784e32 62 {
Kojto 113:f141b2784e32 63 #if defined(_RMU_CTRL_PINRMODE_MASK)
Kojto 113:f141b2784e32 64 rmuResetModeDisabled = _RMU_CTRL_PINRMODE_DISABLED,
Kojto 113:f141b2784e32 65 rmuResetModeLimited = _RMU_CTRL_PINRMODE_LIMITED,
Kojto 113:f141b2784e32 66 rmuResetModeExtended = _RMU_CTRL_PINRMODE_EXTENDED,
Kojto 113:f141b2784e32 67 rmuResetModeFull = _RMU_CTRL_PINRMODE_FULL,
Kojto 113:f141b2784e32 68 #else
Kojto 113:f141b2784e32 69 rmuResetModeClear = 0,
Kojto 113:f141b2784e32 70 rmuResetModeSet = 1,
Kojto 113:f141b2784e32 71 #endif
Kojto 113:f141b2784e32 72 } RMU_ResetMode_TypeDef;
Kojto 113:f141b2784e32 73
Kojto 98:8ab26030e058 74 /** RMU controlled peripheral reset control and reset source control */
Kojto 98:8ab26030e058 75 typedef enum
Kojto 98:8ab26030e058 76 {
Kojto 113:f141b2784e32 77 #if defined(RMU_CTRL_BURSTEN)
Kojto 113:f141b2784e32 78 rmuResetBU = _RMU_CTRL_BURSTEN_MASK, /**< Reset control over Backup Power domain select */
Kojto 113:f141b2784e32 79 #endif
Kojto 113:f141b2784e32 80 #if defined(RMU_CTRL_LOCKUPRDIS)
Kojto 113:f141b2784e32 81 rmuResetLockUp = _RMU_CTRL_LOCKUPRDIS_MASK, /**< Cortex lockup reset select */
Kojto 113:f141b2784e32 82 #elif defined(_RMU_CTRL_LOCKUPRMODE_MASK)
Kojto 113:f141b2784e32 83 rmuResetLockUp = _RMU_CTRL_LOCKUPRMODE_MASK, /**< Cortex lockup reset select */
Kojto 98:8ab26030e058 84 #endif
Kojto 113:f141b2784e32 85 #if defined(_RMU_CTRL_WDOGRMODE_MASK)
Kojto 113:f141b2784e32 86 rmuResetWdog = _RMU_CTRL_WDOGRMODE_MASK, /**< WDOG reset select */
Kojto 113:f141b2784e32 87 #endif
Kojto 113:f141b2784e32 88 #if defined(_RMU_CTRL_LOCKUPRMODE_MASK)
Kojto 113:f141b2784e32 89 rmuResetCoreLockup = _RMU_CTRL_LOCKUPRMODE_MASK, /**< Cortex lockup reset select */
Kojto 113:f141b2784e32 90 #endif
Kojto 113:f141b2784e32 91 #if defined(_RMU_CTRL_SYSRMODE_MASK)
Kojto 113:f141b2784e32 92 rmuResetSys = _RMU_CTRL_SYSRMODE_MASK, /**< SYSRESET select */
Kojto 113:f141b2784e32 93 #endif
Kojto 113:f141b2784e32 94 #if defined(_RMU_CTRL_PINRMODE_MASK)
Kojto 113:f141b2784e32 95 rmuResetPin = _RMU_CTRL_PINRMODE_MASK, /**< Pin reset select */
Kojto 113:f141b2784e32 96 #endif
Kojto 98:8ab26030e058 97 } RMU_Reset_TypeDef;
Kojto 98:8ab26030e058 98
Kojto 98:8ab26030e058 99 /*******************************************************************************
Kojto 98:8ab26030e058 100 ***************************** PROTOTYPES **********************************
Kojto 98:8ab26030e058 101 ******************************************************************************/
Kojto 98:8ab26030e058 102
Kojto 98:8ab26030e058 103 /** RMU_LockupResetDisable kept for backwards compatibility */
Kojto 98:8ab26030e058 104 #define RMU_LockupResetDisable(A) RMU_ResetControl(rmuResetLockUp, A)
Kojto 98:8ab26030e058 105
Kojto 113:f141b2784e32 106 void RMU_ResetControl(RMU_Reset_TypeDef reset, RMU_ResetMode_TypeDef mode);
Kojto 98:8ab26030e058 107 void RMU_ResetCauseClear(void);
Kojto 98:8ab26030e058 108 uint32_t RMU_ResetCauseGet(void);
Kojto 98:8ab26030e058 109
Kojto 113:f141b2784e32 110 #if defined(_RMU_CTRL_RESETSTATE_MASK)
Kojto 113:f141b2784e32 111 /***************************************************************************//**
Kojto 113:f141b2784e32 112 * @brief
Kojto 113:f141b2784e32 113 * Set user reset state. This state is reset only by a Power-on-reset and a
Kojto 113:f141b2784e32 114 * pin reset.
Kojto 113:f141b2784e32 115 *
Kojto 113:f141b2784e32 116 * @param[in] userState User state to set
Kojto 113:f141b2784e32 117 ******************************************************************************/
Kojto 113:f141b2784e32 118 __STATIC_INLINE void RMU_UserResetStateSet(uint32_t userState)
Kojto 113:f141b2784e32 119 {
Kojto 113:f141b2784e32 120 EFM_ASSERT(!(userState
Kojto 113:f141b2784e32 121 & ~(_RMU_CTRL_RESETSTATE_MASK >> _RMU_CTRL_RESETSTATE_SHIFT)));
Kojto 113:f141b2784e32 122 RMU->CTRL = (RMU->CTRL & ~_RMU_CTRL_RESETSTATE_MASK)
Kojto 113:f141b2784e32 123 | (userState << _RMU_CTRL_RESETSTATE_SHIFT);
Kojto 113:f141b2784e32 124 }
Kojto 113:f141b2784e32 125
Kojto 113:f141b2784e32 126 /***************************************************************************//**
Kojto 113:f141b2784e32 127 * @brief
Kojto 113:f141b2784e32 128 * Get user reset state. This state is reset only by a Power-on-reset and a
Kojto 113:f141b2784e32 129 * pin reset.
Kojto 113:f141b2784e32 130 *
Kojto 113:f141b2784e32 131 * @return
Kojto 113:f141b2784e32 132 * Reset surviving user state
Kojto 113:f141b2784e32 133 ******************************************************************************/
Kojto 113:f141b2784e32 134 __STATIC_INLINE uint32_t RMU_UserResetStateGet(void)
Kojto 113:f141b2784e32 135 {
Kojto 113:f141b2784e32 136 uint32_t userState = (RMU->CTRL & _RMU_CTRL_RESETSTATE_MASK)
Kojto 113:f141b2784e32 137 >> _RMU_CTRL_RESETSTATE_SHIFT;
Kojto 113:f141b2784e32 138 return userState;
Kojto 113:f141b2784e32 139 }
Kojto 113:f141b2784e32 140 #endif
Kojto 113:f141b2784e32 141
Kojto 98:8ab26030e058 142 /** @} (end addtogroup RMU) */
<> 128:9bcdf88f62b0 143 /** @} (end addtogroup emlib) */
Kojto 98:8ab26030e058 144
Kojto 98:8ab26030e058 145 #ifdef __cplusplus
Kojto 98:8ab26030e058 146 }
Kojto 98:8ab26030e058 147 #endif
Kojto 98:8ab26030e058 148
Kojto 98:8ab26030e058 149 #endif /* defined(RMU_COUNT) && (RMU_COUNT > 0) */
<> 128:9bcdf88f62b0 150 #endif /* EM_RMU_H */