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 Oct 27 16:45:56 2016 +0100
Revision:
128:9bcdf88f62b0
Parent:
113:f141b2784e32
Child:
139:856d2700e60b
Release 128 of the mbed library

Ports for Upcoming Targets


Fixes and Changes

2966: Add kw24 support https://github.com/ARMmbed/mbed-os/pull/2966
3068: MultiTech mDot - clean up PeripheralPins.c and add new pin names https://github.com/ARMmbed/mbed-os/pull/3068
3089: Kinetis HAL: Remove clock initialization code from serial and ticker https://github.com/ARMmbed/mbed-os/pull/3089
2943: [NRF5] NVIC_SetVector functionality https://github.com/ARMmbed/mbed-os/pull/2943
2938: InterruptIn changes in NCS36510 HAL. https://github.com/ARMmbed/mbed-os/pull/2938
3108: Fix sleep function for NRF52. https://github.com/ARMmbed/mbed-os/pull/3108
3076: STM32F1: Correct timer master value reading https://github.com/ARMmbed/mbed-os/pull/3076
3085: Add LOWPOWERTIMER capability for NUCLEO_F303ZE https://github.com/ARMmbed/mbed-os/pull/3085
3046: [BEETLE] Update BLE stack on Beetle board https://github.com/ARMmbed/mbed-os/pull/3046
3122: [Silicon Labs] Update of Silicon Labs HAL https://github.com/ARMmbed/mbed-os/pull/3122
3022: OnSemi RAM usage fix https://github.com/ARMmbed/mbed-os/pull/3022
3121: STM32F3: Correct UART4 and UART5 defines when using DEVICE_SERIAL_ASYNCH https://github.com/ARMmbed/mbed-os/pull/3121
3142: Targets- NUMAKER_PFM_NUC47216 remove mbed 2 https://github.com/ARMmbed/mbed-os/pull/3142

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
<> 128:9bcdf88f62b0 4 * @version 5.0.0
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 */