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.
TARGET_EFM32HG_STK3400/TARGET_Silicon_Labs/TARGET_EFM32/emlib/inc/em_rmu.h@136:ef9c61f8c49f, 2017-02-14 (annotated)
- Committer:
- Kojto
- Date:
- Tue Feb 14 11:24:20 2017 +0000
- Revision:
- 136:ef9c61f8c49f
- Parent:
- 128:9bcdf88f62b0
- Child:
- 139:856d2700e60b
Release 136 of the mbed library
Ports for Upcoming Targets
Fixes and Changes
3432: Target STM USBHOST support https://github.com/ARMmbed/mbed-os/pull/3432
3181: NUCLEO_F207ZG extending PeripheralPins.c: all available alternate functions can be used now https://github.com/ARMmbed/mbed-os/pull/3181
3626: NUCLEO_F412ZG : Add USB Device +Host https://github.com/ARMmbed/mbed-os/pull/3626
3628: Fix warnings https://github.com/ARMmbed/mbed-os/pull/3628
3629: STM32: L0 LL layer https://github.com/ARMmbed/mbed-os/pull/3629
3632: IDE Export support for platform VK_RZ_A1H https://github.com/ARMmbed/mbed-os/pull/3632
3642: Missing IRQ pin fix for platform VK_RZ_A1H https://github.com/ARMmbed/mbed-os/pull/3642
3664: Fix ncs36510 sleep definitions https://github.com/ARMmbed/mbed-os/pull/3664
3655: [STM32F4] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3655
3657: [STM32L4] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3657
3658: [STM32F3] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3658
3685: STM32: I2C: reset state machine https://github.com/ARMmbed/mbed-os/pull/3685
3692: uVisor: Standardize available legacy heap and stack https://github.com/ARMmbed/mbed-os/pull/3692
3621: Fix for #2884, LPC824: export to LPCXpresso, target running with wron https://github.com/ARMmbed/mbed-os/pull/3621
3649: [STM32F7] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3649
3695: Enforce device_name is valid in targets.json https://github.com/ARMmbed/mbed-os/pull/3695
3723: NCS36510: spi_format function bug fix https://github.com/ARMmbed/mbed-os/pull/3723
Who changed what in which revision?
User | Revision | Line number | New 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 */ |