1 /*
2 * Copyright (c) 2020 - 2024 Renesas Electronics Corporation and/or its affiliates
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6 
7 #ifndef BSP_POWER_H
8 #define BSP_POWER_H
9 
10 /** Common macro for FSP header files. There is also a corresponding FSP_FOOTER macro at the end of this file. */
11 FSP_HEADER
12 
13 /*******************************************************************************************************************//**
14  * @addtogroup BSP_MCU_RA2L1
15  * @{
16  **********************************************************************************************************************/
17 
18 /***********************************************************************************************************************
19  * Macro definitions
20  **********************************************************************************************************************/
21 #if BSP_FEATURE_BSP_HAS_DCDC_REGULATOR
22  #define BSP_PRV_POWER_USE_DCDC       (BSP_CFG_DCDC_ENABLE)
23 #else
24  #define BSP_PRV_POWER_USE_DCDC       (0)
25 #endif
26 
27 #define BSP_PRV_POWER_DCDC_DISABLE    (0)
28 #define BSP_PRV_POWER_DCDC_MANUAL     (1)
29 #define BSP_PRV_POWER_DCDC_STARTUP    (2)
30 
31 /***********************************************************************************************************************
32  * Typedef definitions
33  **********************************************************************************************************************/
34 
35 /** Voltage regulator mode */
36 typedef enum e_bsp_power_mode_t
37 {
38     BSP_POWER_MODE_DCDC_2V4_TO_2V7 = 3, ///< DCDC mode; 2.4V to 2.7V supply
39     BSP_POWER_MODE_DCDC_2V7_TO_3V6 = 0, ///< DCDC mode; 2.7V to 3.6V supply
40     BSP_POWER_MODE_DCDC_3V6_TO_4V5 = 1, ///< DCDC mode; 3.6V to 4.5V supply
41     BSP_POWER_MODE_DCDC_4V5_TO_5V5 = 2, ///< DCDC mode; 4.5V to 5.5V supply
42 
43     BSP_POWER_MODE_LDO       = 0x90,    ///< LDO mode
44     BSP_POWER_MODE_LDO_BOOST = 0xB0     // Alternate DCDCCTL value for entering subclock and low-power modes
45                                         // (see RA2L1 User's Manual (R01UH0853EJ0100) Section 10.5.1 (5))
46 } bsp_power_mode_t;
47 
48 /***********************************************************************************************************************
49  * Exported global functions (to be accessed by other files)
50  **********************************************************************************************************************/
51 
52 bsp_power_mode_t R_BSP_PowerModeSet(bsp_power_mode_t mode);
53 
54 /*******************************************************************************************************************//**
55  * @} (end addtogroup BSP_MCU_RA2L1)
56  **********************************************************************************************************************/
57 
58 /** Common macro for FSP header files. There is also a corresponding FSP_HEADER macro at the top of this file. */
59 FSP_FOOTER
60 
61 #endif
62