1 /***************************************************************************//**
2  * @file
3  * @brief Device initialization for EMU.
4  *******************************************************************************
5  * # License
6  * <b>Copyright 2019 Silicon Laboratories Inc. www.silabs.com</b>
7  *******************************************************************************
8  *
9  * SPDX-License-Identifier: Zlib
10  *
11  * The licensor of this software is Silicon Laboratories Inc.
12  *
13  * This software is provided 'as-is', without any express or implied
14  * warranty. In no event will the authors be held liable for any damages
15  * arising from the use of this software.
16  *
17  * Permission is granted to anyone to use this software for any purpose,
18  * including commercial applications, and to alter it and redistribute it
19  * freely, subject to the following restrictions:
20  *
21  * 1. The origin of this software must not be misrepresented; you must not
22  *    claim that you wrote the original software. If you use this software
23  *    in a product, an acknowledgment in the product documentation would be
24  *    appreciated but is not required.
25  * 2. Altered source versions must be plainly marked as such, and must not be
26  *    misrepresented as being the original software.
27  * 3. This notice may not be removed or altered from any source distribution.
28  *
29  ******************************************************************************/
30 #ifndef SL_DEVICE_INIT_EMU_H
31 #define SL_DEVICE_INIT_EMU_H
32 
33 #if defined(SL_CATALOG_POWER_MANAGER_PRESENT)
34 #warning "Power Manager is present and handles EMU initialization. Remove device_init_emu from project to avoid conflicts"
35 #endif
36 
37 #include "sl_status.h"
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 /**
44  * @addtogroup device_init
45  * @{
46  * @addtogroup device_init_emu EMU Initialization
47  * @brief Initialize the Energy Management Unit.
48  * @details
49  * Initializes the Energy Management Unit by configuring Energy Mode 4 (EM4)
50  * according to settings in the configuration header
51  * `sl_device_init_emu_config.h`.
52  *
53  * On Series 2 devices, debugging in EM2 is enabled by default by ensuring
54  * that power to the debug power domain is sustained on EM2 entry.
55  * Debugging in EM2 can be disabled through the configuration header. If
56  * using Simplicity Studio, this header can also be configured using the
57  * Project Configurator by selecting the "Device Init: EMU" configuration
58  * component.
59  *
60  * @note Voltage scaling for Energy Modes 0 to 3 are configured by the
61  * @ref power_manager.
62  * @{
63  */
64 
65 /**
66  * Initialize EMU
67  *
68  * @details
69  * Initializes the Energy Management Unit by configuring Energy Mode 4 (EM4)
70  * according to settings in the configuration header
71  * `sl_device_init_emu_config.h`.
72  *
73  * On Series 2 devices, debugging in EM2 is enabled by default by ensuring
74  * that power to the debug power domain is sustained on EM2 entry.
75  *
76  * @note Voltage scaling for Energy Modes 0 to 3 are configured by the
77  * @ref power_manager.
78  *
79  * @return Status code
80  * @retval SL_STATUS_OK EMU initialized successfully
81  */
82 sl_status_t sl_device_init_emu(void);
83 
84 /**
85  * @} device_init_emu
86  * @} device_init
87  */
88 
89 #ifdef __cplusplus
90 }
91 #endif
92 
93 #endif // SL_DEVICE_INIT_EMU_H
94