fsl_power.h 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710
  1. /*
  2. * Copyright (c) 2017, NXP
  3. * All rights reserved.
  4. *
  5. * SPDX-License-Identifier: BSD-3-Clause
  6. */
  7. #ifndef _FSL_POWER_H_
  8. #define _FSL_POWER_H_
  9. #include "fsl_common.h"
  10. /*!
  11. * @addtogroup power
  12. * @{
  13. */
  14. /*******************************************************************************
  15. * Definitions
  16. ******************************************************************************/
  17. /*! @name Driver version */
  18. /*@{*/
  19. /*! @brief power driver version 1.0.0. */
  20. #define FSL_POWER_DRIVER_VERSION (MAKE_VERSION(1, 0, 0))
  21. /*@}*/
  22. /** @brief Low Power main structure */
  23. typedef enum
  24. {
  25. VD_AON = 0x0, /*!< Digital Always On power domain */
  26. VD_MEM = 0x1, /*!< Memories (SRAM) power domain */
  27. VD_DCDC = 0x2, /*!< Core logic power domain */
  28. VD_DEEPSLEEP = 0x3 /*!< Core logic power domain */
  29. } LPC_POWER_DOMAIN_T;
  30. /** @brief Low Power main structure */
  31. typedef struct
  32. { /* */
  33. __IO uint32_t CFG; /*!< Low Power Mode Configuration, and miscallenous options */
  34. __IO uint32_t PDCTRL0; /*!< Power Down control : controls power of various modules
  35. in the different Low power modes, including ROM */
  36. __IO uint32_t SRAMRETCTRL; /*!< Power Down control : controls power SRAM instances
  37. in the different Low power modes */
  38. __IO uint32_t CPURETCTRL; /*!< CPU0 retention control : controls CPU retention parameters in POWER DOWN modes */
  39. __IO uint64_t VOLTAGE; /*!< Voltage control in Low Power Modes */
  40. __IO uint64_t WAKEUPSRC; /*!< Wake up sources control for sleepcon */
  41. __IO uint64_t WAKEUPINT; /*!< Wake up sources control for ARM */
  42. __IO uint32_t HWWAKE; /*!< Interrupt that can postpone power down modes
  43. in case an interrupt is pending when the processor request deepsleep */
  44. __IO uint32_t WAKEUPIOSRC; /*!< Wake up I/O sources in DEEP POWER DOWN mode */
  45. __IO uint32_t TIMERCFG; /*!< Wake up timers configuration */
  46. __IO uint32_t TIMERCOUNT; /*!< Wake up Timer count*/
  47. __IO uint32_t POWERCYCLE; /*!< Cancels entry in Low Power mode if set with 0xDEADABBA (might be used by some
  48. interrupt handlers)*/
  49. } LPC_LOWPOWER_T;
  50. /* */
  51. #define LOWPOWER_POWERCYCLE_CANCELLED 0xDEADABBA /*!< */
  52. /* Low Power modes */
  53. #define LOWPOWER_CFG_LPMODE_INDEX 0
  54. #define LOWPOWER_CFG_LPMODE_MASK (0x3UL << LOWPOWER_CFG_LPMODE_INDEX)
  55. #define LOWPOWER_CFG_SELCLOCK_INDEX 2
  56. #define LOWPOWER_CFG_SELCLOCK_MASK (0x1UL << LOWPOWER_CFG_SELCLOCK_INDEX)
  57. #define LOWPOWER_CFG_SELMEMSUPPLY_INDEX 3
  58. #define LOWPOWER_CFG_SELMEMSUPPLY_MASK (0x1UL << LOWPOWER_CFG_SELMEMSUPPLY_INDEX)
  59. #define LOWPOWER_CFG_MEMLOWPOWERMODE_INDEX 4
  60. #define LOWPOWER_CFG_MEMLOWPOWERMODE_MASK (0x1UL << LOWPOWER_CFG_MEMLOWPOWERMODE_INDEX)
  61. #define LOWPOWER_CFG_LDODEEPSLEEPREF_INDEX 5
  62. #define LOWPOWER_CFG_LDODEEPSLEEPREF_MASK (0x1UL << LOWPOWER_CFG_LDODEEPSLEEPREF_INDEX)
  63. #define LOWPOWER_CFG_LPMODE_ACTIVE 0 /*!< ACTIVE mode */
  64. #define LOWPOWER_CFG_LPMODE_DEEPSLEEP 1 /*!< DEEP SLEEP mode */
  65. #define LOWPOWER_CFG_LPMODE_POWERDOWN 2 /*!< POWER DOWN mode */
  66. #define LOWPOWER_CFG_LPMODE_DEEPPOWERDOWN 3 /*!< DEEP POWER DOWN mode */
  67. #define LOWPOWER_CFG_LPMODE_SLEEP 4 /*!< SLEEP mode */
  68. #define LOWPOWER_CFG_SELCLOCK_1MHZ 0 /*!< The 1 MHz clock is used during the configuration of the PMC */
  69. #define LOWPOWER_CFG_SELCLOCK_12MHZ 1 /*!< The 12 MHz clock is used during the configuration of the PMC (to speed up PMC configuration process)*/
  70. #define LOWPOWER_CFG_SELMEMSUPPLY_LDOMEM 0 /*!< In DEEP SLEEP power mode, the Memories are supplied by the LDO_MEM */
  71. #define LOWPOWER_CFG_SELMEMSUPPLY_LDODEEPSLEEP 1 /*!< In DEEP SLEEP power mode, the Memories are supplied by the LDO_DEEP_SLEEP (or DCDC) */
  72. #define LOWPOWER_CFG_MEMLOWPOWERMODE_SOURCEBIASING 0 /*!< All SRAM instances use "Source Biasing" as low power mode technic (it is recommended to set LDO_MEM as high as possible -- 1.1V typical -- during low power mode) */
  73. #define LOWPOWER_CFG_MEMLOWPOWERMODE_VOLTAGESCALING 1 /*!< All SRAM instances use "Voltage Scaling" as low power mode technic (it is recommended to set LDO_MEM as low as possible -- down to 0.7V -- during low power mode) */
  74. #define LOWPOWER_CFG_LDODEEPSLEEPREF_FLASHBUFFER 0 /*!< LDO DEEP SLEEP uses Flash Buffer as reference */
  75. #define LOWPOWER_CFG_LDODEEPSLEEPREF_BANDGAG0P8V 1 /*!< LDO DEEP SLEEP uses Band Gap 0.8V as reference */
  76. /* CPU Retention Control*/
  77. #define LOWPOWER_CPURETCTRL_ENA_INDEX 0
  78. #define LOWPOWER_CPURETCTRL_ENA_MASK (0x1UL << LOWPOWER_CPURETCTRL_ENA_INDEX)
  79. #define LOWPOWER_CPURETCTRL_MEMBASE_INDEX 1
  80. #define LOWPOWER_CPURETCTRL_MEMBASE_MASK (0x1FFF << LOWPOWER_CPURETCTRL_MEMBASE_INDEX)
  81. #define LOWPOWER_CPURETCTRL_RETDATALENGTH_INDEX 14
  82. #define LOWPOWER_CPURETCTRL_RETDATALENGTH_MASK (0x3FFUL << LOWPOWER_CPURETCTRL_RETDATALENGTH_INDEX)
  83. #define LOWPOWER_CPURETCTRL_ENA_DISABLE 0 /*!< In POWER DOWN mode, CPU Retention is disabled */
  84. #define LOWPOWER_CPURETCTRL_ENA_ENABLE 1 /*!< In POWER DOWN mode, CPU Retention is enabled */
  85. /**
  86. * @brief Analog components power modes control during low power modes
  87. */
  88. typedef enum pd_bits
  89. {
  90. kPDRUNCFG_PD_DCDC = (1UL << 0),
  91. kPDRUNCFG_PD_BIAS = (1UL << 1),
  92. kPDRUNCFG_PD_BODCORE = (1UL << 2),
  93. kPDRUNCFG_PD_BODVBAT = (1UL << 3),
  94. kPDRUNCFG_PD_FRO1M = (1UL << 4),
  95. kPDRUNCFG_PD_FRO192M = (1UL << 5),
  96. kPDRUNCFG_PD_FRO32K = (1UL << 6),
  97. kPDRUNCFG_PD_XTAL32K = (1UL << 7),
  98. kPDRUNCFG_PD_XTAL32M = (1UL << 8),
  99. kPDRUNCFG_PD_PLL0 = (1UL << 9),
  100. kPDRUNCFG_PD_PLL1 = (1UL << 10),
  101. kPDRUNCFG_PD_USB0_PHY = (1UL << 11),
  102. kPDRUNCFG_PD_USB1_PHY = (1UL << 12),
  103. kPDRUNCFG_PD_COMP = (1UL << 13),
  104. kPDRUNCFG_PD_TEMPSENS = (1UL << 14),
  105. kPDRUNCFG_PD_GPADC = (1UL << 15),
  106. kPDRUNCFG_PD_LDOMEM = (1UL << 16),
  107. kPDRUNCFG_PD_LDODEEPSLEEP = (1UL << 17),
  108. kPDRUNCFG_PD_LDOUSBHS = (1UL << 18),
  109. kPDRUNCFG_PD_LDOGPADC = (1UL << 19),
  110. kPDRUNCFG_PD_LDOXO32M = (1UL << 20),
  111. kPDRUNCFG_PD_LDOFLASHNV = (1UL << 21),
  112. kPDRUNCFG_PD_RNG = (1UL << 22),
  113. kPDRUNCFG_PD_PLL0_SSCG = (1UL << 23),
  114. kPDRUNCFG_PD_ROM = (1UL << 24),
  115. /*
  116. This enum member has no practical meaning,it is used to avoid MISRA issue,
  117. user should not trying to use it.
  118. */
  119. kPDRUNCFG_ForceUnsigned = 0x80000000U,
  120. } pd_bit_t;
  121. /**
  122. * @brief SRAM instances retention control during low power modes
  123. */
  124. #define LOWPOWER_SRAMRETCTRL_RETEN_RAMX0 (1UL << 0) /*!< Enable SRAMX_0 retention when entering in Low power modes */
  125. #define LOWPOWER_SRAMRETCTRL_RETEN_RAMX1 (1UL << 1) /*!< Enable SRAMX_1 retention when entering in Low power modes */
  126. #define LOWPOWER_SRAMRETCTRL_RETEN_RAMX2 (1UL << 2) /*!< Enable SRAMX_2 retention when entering in Low power modes */
  127. #define LOWPOWER_SRAMRETCTRL_RETEN_RAMX3 (1UL << 3) /*!< Enable SRAMX_3 retention when entering in Low power modes */
  128. #define LOWPOWER_SRAMRETCTRL_RETEN_RAM00 (1UL << 4) /*!< Enable SRAM0_0 retention when entering in Low power modes */
  129. #define LOWPOWER_SRAMRETCTRL_RETEN_RAM01 (1UL << 5) /*!< Enable SRAM0_1 retention when entering in Low power modes */
  130. #define LOWPOWER_SRAMRETCTRL_RETEN_RAM10 (1UL << 6) /*!< Enable SRAM1_0 retention when entering in Low power modes */
  131. #define LOWPOWER_SRAMRETCTRL_RETEN_RAM20 (1UL << 7) /*!< Enable SRAM2_0 retention when entering in Low power modes */
  132. #define LOWPOWER_SRAMRETCTRL_RETEN_RAM30 (1UL << 8) /*!< Enable SRAM3_0 retention when entering in Low power modes */
  133. #define LOWPOWER_SRAMRETCTRL_RETEN_RAM31 (1UL << 9) /*!< Enable SRAM3_1 retention when entering in Low power modes */
  134. #define LOWPOWER_SRAMRETCTRL_RETEN_RAM40 (1UL << 10) /*!< Enable SRAM4_0 retention when entering in Low power modes */
  135. #define LOWPOWER_SRAMRETCTRL_RETEN_RAM41 (1UL << 11) /*!< Enable SRAM4_1 retention when entering in Low power modes */
  136. #define LOWPOWER_SRAMRETCTRL_RETEN_RAM42 (1UL << 12) /*!< Enable SRAM4_2 retention when entering in Low power modes */
  137. #define LOWPOWER_SRAMRETCTRL_RETEN_RAM43 (1UL << 13) /*!< Enable SRAM4_3 retention when entering in Low power modes */
  138. #define LOWPOWER_SRAMRETCTRL_RETEN_RAM_USB_HS (1UL << 14) /*!< Enable SRAM USB HS retention when entering in Low power modes */
  139. #define LOWPOWER_SRAMRETCTRL_RETEN_RAM_PUF (1UL << 15) /*!< Enable SRAM PUFF retention when entering in Low power modes */
  140. /**
  141. * @brief SRAM Low Power Modes
  142. */
  143. #define LOWPOWER_SRAM_LPMODE_MASK (0xFUL)
  144. #define LOWPOWER_SRAM_LPMODE_ACTIVE (0x6UL) /*!< SRAM functional mode */
  145. #define LOWPOWER_SRAM_LPMODE_SLEEP (0xFUL) /*!< SRAM Sleep mode (Data retention, fast wake up) */
  146. #define LOWPOWER_SRAM_LPMODE_DEEPSLEEP (0x8UL) /*!< SRAM Deep Sleep mode (Data retention, slow wake up) */
  147. #define LOWPOWER_SRAM_LPMODE_SHUTDOWN (0x9UL) /*!< SRAM Shut Down mode (no data retention) */
  148. #define LOWPOWER_SRAM_LPMODE_POWERUP (0xAUL) /*!< SRAM is powering up */
  149. /*@brief BOD VBAT level */
  150. typedef enum _power_bod_vbat_level
  151. {
  152. kPOWER_BodVbatLevel1000mv = 0, /*!< Brown out detector VBAT level 1V */
  153. kPOWER_BodVbatLevel1100mv = 1, /*!< Brown out detector VBAT level 1.1V */
  154. kPOWER_BodVbatLevel1200mv = 2, /*!< Brown out detector VBAT level 1.2V */
  155. kPOWER_BodVbatLevel1300mv = 3, /*!< Brown out detector VBAT level 1.3V */
  156. kPOWER_BodVbatLevel1400mv = 4, /*!< Brown out detector VBAT level 1.4V */
  157. kPOWER_BodVbatLevel1500mv = 5, /*!< Brown out detector VBAT level 1.5V */
  158. kPOWER_BodVbatLevel1600mv = 6, /*!< Brown out detector VBAT level 1.6V */
  159. kPOWER_BodVbatLevel1650mv = 7, /*!< Brown out detector VBAT level 1.65V */
  160. kPOWER_BodVbatLevel1700mv = 8, /*!< Brown out detector VBAT level 1.7V */
  161. kPOWER_BodVbatLevel1750mv = 9, /*!< Brown out detector VBAT level 1.75V */
  162. kPOWER_BodVbatLevel1800mv = 10, /*!< Brown out detector VBAT level 1.8V */
  163. kPOWER_BodVbatLevel1900mv = 11, /*!< Brown out detector VBAT level 1.9V */
  164. kPOWER_BodVbatLevel2000mv = 12, /*!< Brown out detector VBAT level 2V */
  165. kPOWER_BodVbatLevel2100mv = 13, /*!< Brown out detector VBAT level 2.1V */
  166. kPOWER_BodVbatLevel2200mv = 14, /*!< Brown out detector VBAT level 2.2V */
  167. kPOWER_BodVbatLevel2300mv = 15, /*!< Brown out detector VBAT level 2.3V */
  168. kPOWER_BodVbatLevel2400mv = 16, /*!< Brown out detector VBAT level 2.4V */
  169. kPOWER_BodVbatLevel2500mv = 17, /*!< Brown out detector VBAT level 2.5V */
  170. kPOWER_BodVbatLevel2600mv = 18, /*!< Brown out detector VBAT level 2.6V */
  171. kPOWER_BodVbatLevel2700mv = 19, /*!< Brown out detector VBAT level 2.7V */
  172. kPOWER_BodVbatLevel2806mv = 20, /*!< Brown out detector VBAT level 2.806V */
  173. kPOWER_BodVbatLevel2900mv = 21, /*!< Brown out detector VBAT level 2.9V */
  174. kPOWER_BodVbatLevel3000mv = 22, /*!< Brown out detector VBAT level 3.0V */
  175. kPOWER_BodVbatLevel3100mv = 23, /*!< Brown out detector VBAT level 3.1V */
  176. kPOWER_BodVbatLevel3200mv = 24, /*!< Brown out detector VBAT level 3.2V */
  177. kPOWER_BodVbatLevel3300mv = 25, /*!< Brown out detector VBAT level 3.3V */
  178. } power_bod_vbat_level_t;
  179. /*@brief BOD core level */
  180. typedef enum _power_bod_core_level
  181. {
  182. kPOWER_BodCoreLevel600mv = 0, /*!< Brown out detector core level 600mV */
  183. kPOWER_BodCoreLevel650mv = 1, /*!< Brown out detector core level 650mV */
  184. kPOWER_BodCoreLevel700mv = 2, /*!< Brown out detector core level 700mV */
  185. kPOWER_BodCoreLevel750mv = 3, /*!< Brown out detector core level 750mV */
  186. kPOWER_BodCoreLevel800mv = 4, /*!< Brown out detector core level 800mV */
  187. kPOWER_BodCoreLevel850mv = 5, /*!< Brown out detector core level 850mV */
  188. kPOWER_BodCoreLevel900mv = 6, /*!< Brown out detector core level 900mV */
  189. kPOWER_BodCoreLevel950mv = 7, /*!< Brown out detector core level 950mV */
  190. } power_bod_core_level_t;
  191. /*@brief BOD Hysteresis control */
  192. typedef enum _power_bod_hyst
  193. {
  194. kPOWER_BodHystLevel25mv = 0U, /*!< BOD Hysteresis control level 25mv */
  195. kPOWER_BodHystLevel50mv = 1U, /*!< BOD Hysteresis control level 50mv */
  196. kPOWER_BodHystLevel75mv = 2U, /*!< BOD Hysteresis control level 75mv */
  197. kPOWER_BodHystLevel100mv = 3U, /*!< BOD Hysteresis control level 100mv */
  198. } power_bod_hyst_t;
  199. /**
  200. * @brief LDO Voltage control in Low Power Modes
  201. */
  202. #define LOWPOWER_VOLTAGE_LDO_PMU_INDEX 0
  203. #define LOWPOWER_VOLTAGE_LDO_PMU_MASK (0x1FULL << LOWPOWER_VOLTAGE_LDO_PMU_INDEX)
  204. #define LOWPOWER_VOLTAGE_LDO_MEM_INDEX 5
  205. #define LOWPOWER_VOLTAGE_LDO_MEM_MASK (0x1FULL << LOWPOWER_VOLTAGE_LDO_MEM_INDEX)
  206. #define LOWPOWER_VOLTAGE_LDO_DEEP_SLEEP_INDEX 10
  207. #define LOWPOWER_VOLTAGE_LDO_DEEP_SLEEP_MASK (0x7ULL << LOWPOWER_VOLTAGE_LDO_DEEP_SLEEP_INDEX)
  208. #define LOWPOWER_VOLTAGE_LDO_PMU_BOOST_INDEX 19
  209. #define LOWPOWER_VOLTAGE_LDO_PMU_BOOST_MASK (0x1FULL << LOWPOWER_VOLTAGE_LDO_PMU_BOOST_INDEX)
  210. #define LOWPOWER_VOLTAGE_LDO_MEM_BOOST_INDEX 24
  211. #define LOWPOWER_VOLTAGE_LDO_MEM_BOOST_MASK (0x1FULL << LOWPOWER_VOLTAGE_LDO_MEM_BOOST_INDEX)
  212. #define LOWPOWER_VOLTAGE_DCDC_INDEX 29
  213. #define LOWPOWER_VOLTAGE_DCDC_MASK (0xFULL << LOWPOWER_VOLTAGE_DCDC_INDEX)
  214. /**
  215. * @brief Always On and Memories LDO voltage settings
  216. */
  217. typedef enum _v_ao
  218. {
  219. // V_AO_1P220 1.22 = 0, /*!< 1.22 V */
  220. V_AO_0P700 = 1, /*!< 0.7 V */
  221. V_AO_0P725 = 2, /*!< 0.725 V */
  222. V_AO_0P750 = 3, /*!< 0.75 V */
  223. V_AO_0P775 = 4, /*!< 0.775 V */
  224. V_AO_0P800 = 5, /*!< 0.8 V */
  225. V_AO_0P825 = 6, /*!< 0.825 V */
  226. V_AO_0P850 = 7, /*!< 0.85 V */
  227. V_AO_0P875 = 8, /*!< 0.875 V */
  228. V_AO_0P900 = 9, /*!< 0.9 V */
  229. V_AO_0P960 = 10, /*!< 0.96 V */
  230. V_AO_0P970 = 11, /*!< 0.97 V */
  231. V_AO_0P980 = 12, /*!< 0.98 V */
  232. V_AO_0P990 = 13, /*!< 0.99 V */
  233. V_AO_1P000 = 14, /*!< 1 V */
  234. V_AO_1P010 = 15, /*!< 1.01 V */
  235. V_AO_1P020 = 16, /*!< 1.02 V */
  236. V_AO_1P030 = 17, /*!< 1.03 V */
  237. V_AO_1P040 = 18, /*!< 1.04 V */
  238. V_AO_1P050 = 19, /*!< 1.05 V */
  239. V_AO_1P060 = 20, /*!< 1.06 V */
  240. V_AO_1P070 = 21, /*!< 1.07 V */
  241. V_AO_1P080 = 22, /*!< 1.08 V */
  242. V_AO_1P090 = 23, /*!< 1.09 V */
  243. V_AO_1P100 = 24, /*!< 1.1 V */
  244. V_AO_1P110 = 25, /*!< 1.11 V */
  245. V_AO_1P120 = 26, /*!< 1.12 V */
  246. V_AO_1P130 = 27, /*!< 1.13 V */
  247. V_AO_1P140 = 28, /*!< 1.14 V */
  248. V_AO_1P150 = 29, /*!< 1.15 V */
  249. V_AO_1P160 = 30, /*!< 1.16 V */
  250. V_AO_1P220 = 31 /*!< 1.22 V */
  251. } v_ao_t;
  252. /**
  253. * @brief Deep Sleep LDO voltage settings
  254. */
  255. typedef enum _v_deepsleep
  256. {
  257. V_DEEPSLEEP_0P900 = 0, /*!< 0.9 V */
  258. V_DEEPSLEEP_0P925 = 1, /*!< 0.925 V */
  259. V_DEEPSLEEP_0P950 = 2, /*!< 0.95 V */
  260. V_DEEPSLEEP_0P975 = 3, /*!< 0.975 V */
  261. V_DEEPSLEEP_1P000 = 4, /*!< 1.000 V */
  262. V_DEEPSLEEP_1P025 = 5, /*!< 1.025 V */
  263. V_DEEPSLEEP_1P050 = 6, /*!< 1.050 V */
  264. V_DEEPSLEEP_1P075 = 7 /*!< 1.075 V */
  265. } v_deepsleep_t;
  266. /**
  267. * @brief DCDC voltage settings
  268. */
  269. typedef enum _v_dcdc
  270. {
  271. V_DCDC_0P950 = 0, /*!< 0.95 V */
  272. V_DCDC_0P975 = 1, /*!< 0.975 V */
  273. V_DCDC_1P000 = 2, /*!< 1 V */
  274. V_DCDC_1P025 = 3, /*!< 1.025 V */
  275. V_DCDC_1P050 = 4, /*!< 1.050 V */
  276. V_DCDC_1P075 = 5, /*!< 1.075 V */
  277. V_DCDC_1P100 = 6, /*!< 1.1 V */
  278. V_DCDC_1P125 = 7, /*!< 1.125 V */
  279. V_DCDC_1P150 = 8, /*!< 1.150 V */
  280. V_DCDC_1P175 = 9, /*!< 1.175 V */
  281. V_DCDC_1P200 = 10 /*!< 1.2 V */
  282. } v_dcdc_t;
  283. /**
  284. * @brief LDO_FLASH_NV & LDO_USB voltage settings
  285. */
  286. typedef enum _v_flashnv
  287. {
  288. V_LDOFLASHNV_1P650 = 0, /*!< 0.95 V */
  289. V_LDOFLASHNV_1P700 = 1, /*!< 0.975 V */
  290. V_LDOFLASHNV_1P750 = 2, /*!< 1 V */
  291. V_LDOFLASHNV_0P800 = 3, /*!< 1.025 V */
  292. V_LDOFLASHNV_1P850 = 4, /*!< 1.050 V */
  293. V_LDOFLASHNV_1P900 = 5, /*!< 1.075 V */
  294. V_LDOFLASHNV_1P950 = 6, /*!< 1.1 V */
  295. V_LDOFLASHNV_2P000 = 7 /*!< 1.125 V */
  296. } v_flashnv_t;
  297. /**
  298. * @brief Low Power Modes Wake up sources
  299. */
  300. #define WAKEUP_SYS (1ULL << 0) /*!< [SLEEP, DEEP SLEEP ] */ /* WWDT0_IRQ and BOD_IRQ*/
  301. #define WAKEUP_SDMA0 (1ULL << 1) /*!< [SLEEP, DEEP SLEEP ] */
  302. #define WAKEUP_GPIO_GLOBALINT0 (1ULL << 2) /*!< [SLEEP, DEEP SLEEP, POWER DOWN ] */
  303. #define WAKEUP_GPIO_GLOBALINT1 (1ULL << 3) /*!< [SLEEP, DEEP SLEEP, POWER DOWN ] */
  304. #define WAKEUP_GPIO_INT0_0 (1ULL << 4) /*!< [SLEEP, DEEP SLEEP ] */
  305. #define WAKEUP_GPIO_INT0_1 (1ULL << 5) /*!< [SLEEP, DEEP SLEEP ] */
  306. #define WAKEUP_GPIO_INT0_2 (1ULL << 6) /*!< [SLEEP, DEEP SLEEP ] */
  307. #define WAKEUP_GPIO_INT0_3 (1ULL << 7) /*!< [SLEEP, DEEP SLEEP ] */
  308. #define WAKEUP_UTICK (1ULL << 8) /*!< [SLEEP, ] */
  309. #define WAKEUP_MRT (1ULL << 9) /*!< [SLEEP, ] */
  310. #define WAKEUP_CTIMER0 (1ULL << 10) /*!< [SLEEP, DEEP SLEEP ] */
  311. #define WAKEUP_CTIMER1 (1ULL << 11) /*!< [SLEEP, DEEP SLEEP ] */
  312. #define WAKEUP_SCT (1ULL << 12) /*!< [SLEEP, ] */
  313. #define WAKEUP_CTIMER3 (1ULL << 13) /*!< [SLEEP, DEEP SLEEP ] */
  314. #define WAKEUP_FLEXCOMM0 (1ULL << 14) /*!< [SLEEP, DEEP SLEEP ] */
  315. #define WAKEUP_FLEXCOMM1 (1ULL << 15) /*!< [SLEEP, DEEP SLEEP ] */
  316. #define WAKEUP_FLEXCOMM2 (1ULL << 16) /*!< [SLEEP, DEEP SLEEP ] */
  317. #define WAKEUP_FLEXCOMM3 (1ULL << 17) /*!< [SLEEP, DEEP SLEEP, POWER DOWN ] */
  318. #define WAKEUP_FLEXCOMM4 (1ULL << 18) /*!< [SLEEP, DEEP SLEEP ] */
  319. #define WAKEUP_FLEXCOMM5 (1ULL << 19) /*!< [SLEEP, DEEP SLEEP ] */
  320. #define WAKEUP_FLEXCOMM6 (1ULL << 20) /*!< [SLEEP, DEEP SLEEP ] */
  321. #define WAKEUP_FLEXCOMM7 (1ULL << 21) /*!< [SLEEP, DEEP SLEEP ] */
  322. #define WAKEUP_ADC (1ULL << 22) /*!< [SLEEP, ] */
  323. // reserved (1ULL << 23) /*!< [SLEEP, DEEP SLEEP ] */
  324. #define WAKEUP_ACMP_CAPT (1ULL << 24) /*!< [SLEEP, DEEP SLEEP, POWER DOWN ] */
  325. // reserved (1ULL << 25)
  326. // reserved (1ULL << 26)
  327. #define WAKEUP_USB0_NEEDCLK (1ULL << 27) /*!< [SLEEP, DEEP SLEEP ] */
  328. #define WAKEUP_USB0 (1ULL << 28) /*!< [SLEEP, DEEP SLEEP ] */
  329. #define WAKEUP_RTC_LITE_ALARM_WAKEUP (1ULL << 29) /*!< [SLEEP, DEEP SLEEP, POWER DOWN, DEEP POWER DOWN] */
  330. #define WAKEUP_EZH_ARCH_B (1ULL << 30) /*!< [SLEEP, ] */
  331. #define WAKEUP_WAKEUP_MAILBOX (1ULL << 31) /*!< [SLEEP, DEEP SLEEP, POWER DOWN ] */
  332. #define WAKEUP_GPIO_INT0_4 (1ULL << 32) /*!< [SLEEP, DEEP SLEEP ] */
  333. #define WAKEUP_GPIO_INT0_5 (1ULL << 33) /*!< [SLEEP, DEEP SLEEP ] */
  334. #define WAKEUP_GPIO_INT0_6 (1ULL << 34) /*!< [SLEEP, DEEP SLEEP ] */
  335. #define WAKEUP_GPIO_INT0_7 (1ULL << 35) /*!< [SLEEP, DEEP SLEEP ] */
  336. #define WAKEUP_CTIMER2 (1ULL << 36) /*!< [SLEEP, DEEP SLEEP ] */
  337. #define WAKEUP_CTIMER4 (1ULL << 37) /*!< [SLEEP, DEEP SLEEP ] */
  338. #define WAKEUP_OS_EVENT_TIMER (1ULL << 38) /*!< [SLEEP, DEEP SLEEP, POWER DOWN, DEEP POWER DOWN] */
  339. // reserved (1ULL << 39)
  340. // reserved (1ULL << 40)
  341. // reserved (1ULL << 41)
  342. #define WAKEUP_SDIO (1ULL << 42) /*!< [SLEEP, ] */
  343. // reserved (1ULL << 43)
  344. // reserved (1ULL << 44)
  345. // reserved (1ULL << 45)
  346. // reserved (1ULL << 46)
  347. #define WAKEUP_USB1 (1ULL << 47) /*!< [SLEEP, DEEP SLEEP ] */
  348. #define WAKEUP_USB1_NEEDCLK (1ULL << 48) /*!< [SLEEP, DEEP SLEEP ] */
  349. #define WAKEUP_SEC_HYPERVISOR_CALL (1ULL << 49) /*!< [SLEEP, ] */
  350. #define WAKEUP_SEC_GPIO_INT0_0 (1ULL << 50) /*!< [SLEEP, DEEP SLEEP ] */
  351. #define WAKEUP_SEC_GPIO_INT0_1 (1ULL << 51) /*!< [SLEEP, DEEP SLEEP ] */
  352. #define WAKEUP_PLU (1ULL << 52) /*!< [SLEEP, DEEP SLEEP ] */
  353. #define WAKEUP_SEC_VIO (1ULL << 53)
  354. #define WAKEUP_SHA (1ULL << 54) /*!< [SLEEP, ] */
  355. #define WAKEUP_CASPER (1ULL << 55) /*!< [SLEEP, ] */
  356. #define WAKEUP_PUFF (1ULL << 56) /*!< [SLEEP, ] */
  357. #define WAKEUP_PQ (1ULL << 57) /*!< [SLEEP, ] */
  358. #define WAKEUP_SDMA1 (1ULL << 58) /*!< [SLEEP, DEEP SLEEP ] */
  359. #define WAKEUP_LSPI_HS (1ULL << 59) /*!< [SLEEP, DEEP SLEEP ] */
  360. // reserved WAKEUP_PVTVF0_AMBER (1ULL << 60)
  361. // reserved WAKEUP_PVTVF0_RED (1ULL << 61)
  362. // reserved WAKEUP_PVTVF1_AMBER (1ULL << 62)
  363. #define WAKEUP_ALLWAKEUPIOS (1ULL << 63) /*!< [ , DEEP POWER DOWN] */
  364. /**
  365. * @brief Sleep Postpone
  366. */
  367. #define LOWPOWER_HWWAKE_FORCED (1UL << 0) /*!< Force peripheral clocking to stay on during deep-sleep mode. */
  368. #define LOWPOWER_HWWAKE_PERIPHERALS (1UL << 1) /*!< Wake for Flexcomms. Any Flexcomm FIFO reaching the level specified by its own TXLVL will cause peripheral clocking to wake up temporarily while the related status is asserted */
  369. #define LOWPOWER_HWWAKE_SDMA0 (1UL << 3) /*!< Wake for DMA0. DMA0 being busy will cause peripheral clocking to remain running until DMA completes. Used in conjonction with LOWPOWER_HWWAKE_PERIPHERALS */
  370. #define LOWPOWER_HWWAKE_SDMA1 (1UL << 5) /*!< Wake for DMA1. DMA0 being busy will cause peripheral clocking to remain running until DMA completes. Used in conjonction with LOWPOWER_HWWAKE_PERIPHERALS */
  371. #define LOWPOWER_HWWAKE_ENABLE_FRO192M (1UL << 31) /*!< Need to be set if FRO192M is disable - via PDCTRL0 - in Deep Sleep mode and any of LOWPOWER_HWWAKE_PERIPHERALS, LOWPOWER_HWWAKE_SDMA0 or LOWPOWER_HWWAKE_SDMA1 is set */
  372. /**
  373. * @brief Wake up I/O sources
  374. */
  375. #define LOWPOWER_WAKEUPIOSRC_PIO0_INDEX 0 /*!< Pin P1( 1) */
  376. #define LOWPOWER_WAKEUPIOSRC_PIO1_INDEX 2 /*!< Pin P0(28) */
  377. #define LOWPOWER_WAKEUPIOSRC_PIO2_INDEX 4 /*!< Pin P1(18) */
  378. #define LOWPOWER_WAKEUPIOSRC_PIO3_INDEX 6 /*!< Pin P1(30) */
  379. #define LOWPOWER_WAKEUPIOSRC_DISABLE 0 /*!< Wake up is disable */
  380. #define LOWPOWER_WAKEUPIOSRC_RISING 1 /*!< Wake up on rising edge */
  381. #define LOWPOWER_WAKEUPIOSRC_FALLING 2 /*!< Wake up on falling edge */
  382. #define LOWPOWER_WAKEUPIOSRC_RISING_FALLING 3 /*!< Wake up on both rising or falling edges */
  383. /**
  384. * @brief Wake up timers configuration in Low Power Modes
  385. */
  386. #define LOWPOWER_TIMERCFG_CTRL_INDEX 0
  387. #define LOWPOWER_TIMERCFG_CTRL_MASK (0x1UL << LOWPOWER_TIMERCFG_CTRL_INDEX)
  388. #define LOWPOWER_TIMERCFG_TIMER_INDEX 1
  389. #define LOWPOWER_TIMERCFG_TIMER_MASK (0x7UL << LOWPOWER_TIMERCFG_TIMER_INDEX)
  390. #define LOWPOWER_TIMERCFG_OSC32K_INDEX 4
  391. #define LOWPOWER_TIMERCFG_OSC32K_MASK (0x1UL << LOWPOWER_TIMERCFG_OSC32K_INDEX)
  392. #define LOWPOWER_TIMERCFG_CTRL_DISABLE 0 /*!< Wake Timer Disable */
  393. #define LOWPOWER_TIMERCFG_CTRL_ENABLE 1 /*!< Wake Timer Enable */
  394. /**
  395. * @brief Primary Wake up timers configuration in Low Power Modes
  396. */
  397. #define LOWPOWER_TIMERCFG_TIMER_RTC1KHZ 0 /*!< 1 KHz Real Time Counter (RTC) used as wake up source */
  398. #define LOWPOWER_TIMERCFG_TIMER_RTC1HZ 1 /*!< 1 Hz Real Time Counter (RTC) used as wake up source */
  399. #define LOWPOWER_TIMERCFG_TIMER_OSTIMER 2 /*!< OS Event Timer used as wake up source */
  400. #define LOWPOWER_TIMERCFG_OSC32K_FRO32KHZ 0 /*!< Wake up Timers uses FRO 32 KHz as clock source */
  401. #define LOWPOWER_TIMERCFG_OSC32K_XTAL32KHZ 1 /*!< Wake up Timers uses Chrystal 32 KHz as clock source */
  402. //! @brief Interface for lowpower functions
  403. typedef struct LowpowerDriverInterface
  404. {
  405. void (*power_cycle_cpu_and_flash)(void);
  406. void (*set_lowpower_mode)(LPC_LOWPOWER_T *p_lowpower_cfg);
  407. } lowpower_driver_interface_t;
  408. /* Power mode configuration API parameter */
  409. typedef enum _power_mode_config
  410. {
  411. kPmu_Sleep = 0U,
  412. kPmu_Deep_Sleep = 1U,
  413. kPmu_PowerDown = 2U,
  414. kPmu_Deep_PowerDown = 3U,
  415. } power_mode_cfg_t;
  416. /*******************************************************************************
  417. * API
  418. ******************************************************************************/
  419. #ifdef __cplusplus
  420. extern "C" {
  421. #endif
  422. /*!
  423. * @brief API to enable PDRUNCFG bit in the Syscon. Note that enabling the bit powers down the peripheral
  424. *
  425. * @param en peripheral for which to enable the PDRUNCFG bit
  426. * @return none
  427. */
  428. static inline void POWER_EnablePD(pd_bit_t en)
  429. {
  430. /* PDRUNCFGSET */
  431. PMC->PDRUNCFGSET0 = en;
  432. }
  433. /*!
  434. * @brief API to disable PDRUNCFG bit in the Syscon. Note that disabling the bit powers up the peripheral
  435. *
  436. * @param en peripheral for which to disable the PDRUNCFG bit
  437. * @return none
  438. */
  439. static inline void POWER_DisablePD(pd_bit_t en)
  440. {
  441. /* PDRUNCFGCLR */
  442. PMC->PDRUNCFGCLR0 = en;
  443. }
  444. /*!
  445. * @brief set BOD VBAT level.
  446. *
  447. * @param level BOD detect level
  448. * @param hyst BoD Hysteresis control
  449. * @param enBodVbatReset VBAT brown out detect reset
  450. */
  451. static inline void POWER_SetBodVbatLevel(power_bod_vbat_level_t level, power_bod_hyst_t hyst, bool enBodVbatReset)
  452. {
  453. PMC->BODVBAT = (PMC->BODVBAT & (~(PMC_BODVBAT_TRIGLVL_MASK | PMC_BODVBAT_HYST_MASK))) | PMC_BODVBAT_TRIGLVL(level) |
  454. PMC_BODVBAT_HYST(hyst);
  455. PMC->RESETCTRL =
  456. (PMC->RESETCTRL & (~PMC_RESETCTRL_BODVBATRESETENABLE_MASK)) | PMC_RESETCTRL_BODVBATRESETENABLE(enBodVbatReset);
  457. }
  458. /*!
  459. * @brief set BOD core level.
  460. *
  461. * @param level BOD detect level
  462. * @param hyst BoD Hysteresis control
  463. * @param enBodCoreReset core brown out detect reset
  464. */
  465. static inline void POWER_SetBodCoreLevel(power_bod_core_level_t level, power_bod_hyst_t hyst, bool enBodCoreReset)
  466. {
  467. PMC->BODCORE = (PMC->BODCORE & (~(PMC_BODCORE_TRIGLVL_MASK | PMC_BODCORE_HYST_MASK))) | PMC_BODCORE_TRIGLVL(level) |
  468. PMC_BODCORE_HYST(hyst);
  469. PMC->RESETCTRL =
  470. (PMC->RESETCTRL & (~PMC_RESETCTRL_BODCORERESETENABLE_MASK)) | PMC_RESETCTRL_BODCORERESETENABLE(enBodCoreReset);
  471. }
  472. /*!
  473. * @brief API to enable deep sleep bit in the ARM Core.
  474. *
  475. * @param none
  476. * @return none
  477. */
  478. static inline void POWER_EnableDeepSleep(void)
  479. {
  480. SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
  481. }
  482. /*!
  483. * @brief API to disable deep sleep bit in the ARM Core.
  484. *
  485. * @param none
  486. * @return none
  487. */
  488. static inline void POWER_DisableDeepSleep(void)
  489. {
  490. SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk;
  491. }
  492. /*!
  493. * @brief API to power down flash controller.
  494. *
  495. * @param none
  496. * @return none
  497. */
  498. static inline void POWER_PowerDownFlash(void)
  499. {
  500. #if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)
  501. /* TURN OFF clock ip_2113 (only needed for FLASH programming, will be turned on by ROM API) */
  502. CLOCK_DisableClock(kCLOCK_Flash);
  503. /* TURN OFF clock ip_2113 (only needed for FLASH programming, will be turned on by ROM API) */
  504. CLOCK_DisableClock(kCLOCK_Fmc);
  505. #endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */
  506. }
  507. /*!
  508. * @brief API to power up flash controller.
  509. *
  510. * @param none
  511. * @return none
  512. */
  513. static inline void POWER_PowerUpFlash(void)
  514. {
  515. #if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)
  516. /* TURN OFF clock ip_2113 (only needed for FLASH programming, will be turned on by ROM API) */
  517. CLOCK_EnableClock(kCLOCK_Fmc);
  518. #endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */
  519. }
  520. /**
  521. * @brief Configures and enters in low power mode
  522. * @param p_lowpower_cfg: pointer to a structure that contains all low power mode parameters
  523. * @return Nothing
  524. *
  525. * !!! IMPORTANT NOTES :
  526. * 1 - CPU Interrupt Enable registers are updated with p_lowpower_cfg->WAKEUPINT. They are NOT restored by the
  527. * API.
  528. * 2 - The Non Maskable Interrupt (NMI) should be disable before calling this API (otherwise, there is a risk
  529. * of Dead Lock).
  530. * 3 - The HARD FAULT handler should execute from SRAM. (The Hard fault handler should initiate a full chip
  531. * reset)
  532. */
  533. void Power_EnterLowPower(LPC_LOWPOWER_T *p_lowpower_cfg);
  534. /**
  535. * @brief Shut off the Flash and execute the _WFI(), then power up the Flash after wake-up event
  536. * This MUST BE EXECUTED outside the Flash:
  537. * either from ROM or from SRAM. The rest could stay in Flash. But, for consistency, it is
  538. * preferable to have all functions defined in this file implemented in ROM.
  539. * @param None
  540. * @return Nothing
  541. */
  542. void POWER_CycleCpuAndFlash(void);
  543. /**
  544. * @brief Configures and enters in DEEP-SLEEP low power mode
  545. * @param exclude_from_pd:
  546. * @param sram_retention_ctrl:
  547. * @param wakeup_interrupts:
  548. * @param hardware_wake_ctrl:
  549. * @return Nothing
  550. *
  551. * !!! IMPORTANT NOTES :
  552. 0 - CPU0 & System CLock frequency is switched to FRO12MHz and is NOT restored back by the API.
  553. * 1 - CPU0 Interrupt Enable registers (NVIC->ISER) are modified by this function. They are restored back in case of CPU retention or if POWERDOWN is not taken (for instance because an interrupt is pending).
  554. * 2 - The Non Maskable Interrupt (NMI) is disabled and its configuration before calling this function will be restored back if POWERDOWN is not taken (for instance because an RTC or OSTIMER interrupt is pending).
  555. * 3 - The HARD FAULT handler should execute from SRAM. (The Hard fault handler should initiate a full chip reset)
  556. reset)
  557. */
  558. void POWER_EnterDeepSleepEx(uint32_t exclude_from_pd, uint32_t sram_retention_ctrl, uint64_t wakeup_interrupts,uint32_t hardware_wake_ctrl);
  559. /**
  560. * @brief Configures and enters in POWERDOWN low power mode
  561. * @param exclude_from_pd:
  562. * @param sram_retention_ctrl:
  563. * @param wakeup_interrupts:
  564. * @param cpu_retention_ctrl: 0 = CPU retention is disable / 1 = CPU retention is enabled, all other values are
  565. RESERVED.
  566. * @return Nothing
  567. *
  568. * !!! IMPORTANT NOTES :
  569. 0 - CPU0 & System CLock frequency is switched to FRO12MHz and is NOT restored back by the API.
  570. * 1 - CPU0 Interrupt Enable registers (NVIC->ISER) are modified by this function. They are restored back in case of CPU retention or if POWERDOWN is not taken (for instance because an interrupt is pending).
  571. * 2 - The Non Maskable Interrupt (NMI) is disabled and its configuration before calling this function will be restored back if POWERDOWN is not taken (for instance because an RTC or OSTIMER interrupt is pending).
  572. * 3 - In case of CPU retention, it is the responsability of the user to make sure that SRAM instance containing the stack used to call this function WILL BE preserved during low power (via parameter "sram_retention_ctrl")
  573. * 4 - The HARD FAULT handler should execute from SRAM. (The Hard fault handler should initiate a full chip reset)
  574. reset)
  575. */
  576. void POWER_EnterPowerDownEx(uint32_t exclude_from_pd, uint32_t sram_retention_ctrl, uint64_t wakeup_interrupts, uint32_t cpu_retention_ctrl);
  577. /**
  578. * @brief Configures and enters in DEEPPOWERDOWN low power mode
  579. * @param exclude_from_pd:
  580. * @param sram_retention_ctrl:
  581. * @param wakeup_interrupts:
  582. * @param wakeup_io_ctrl:
  583. * @return Nothing
  584. *
  585. * !!! IMPORTANT NOTES :
  586. 0 - CPU0 & System CLock frequency is switched to FRO12MHz and is NOT restored back by the API.
  587. * 1 - CPU0 Interrupt Enable registers (NVIC->ISER) are modified by this function. They are restored back if DEEPPOWERDOWN is not taken (for instance because an RTC or OSTIMER interrupt is pending).
  588. * 2 - The Non Maskable Interrupt (NMI) is disabled and its configuration before calling this function will be restored back if DEEPPOWERDOWN is not taken (for instance because an RTC or OSTIMER interrupt is pending).
  589. * 3 - The HARD FAULT handler should execute from SRAM. (The Hard fault handler should initiate a full chip reset)
  590. */
  591. void POWER_EnterDeepPowerDownEx(uint32_t exclude_from_pd, uint32_t sram_retention_ctrl, uint64_t wakeup_interrupts, uint32_t wakeup_io_ctrl);
  592. /**
  593. * @brief Configures and enters in SLEEP low power mode
  594. * @param :
  595. * @return Nothing
  596. */
  597. void POWER_EnterSleep(void);
  598. /**
  599. * @brief PMC Deep Sleep function call
  600. * @return nothing
  601. */
  602. void POWER_EnterDeepSleep(uint32_t exclude_from_pd);
  603. /**
  604. * @brief PMC power Down function call
  605. * @return nothing
  606. */
  607. void POWER_EnterPowerDown(uint32_t exclude_from_pd);
  608. /**
  609. * @brief PMC Deep Power Down function call
  610. * @return nothing
  611. */
  612. void POWER_EnterDeepPowerDown(uint32_t exclude_from_pd);
  613. /*!
  614. * @brief Power Library API to enter different power mode.
  615. *
  616. * @param exclude_from_pd Bit mask of the PDRUNCFG0(low 32bits) and PDRUNCFG1(high 32bits) that needs to be powered on
  617. * during power mode selected.
  618. * @return none
  619. */
  620. void POWER_EnterPowerMode(power_mode_cfg_t mode, uint32_t exclude_from_pd);
  621. /*!
  622. * @brief Power Library API to choose normal regulation and set the voltage for the desired operating frequency.
  623. *
  624. * @param freq - The desired frequency at which the part would like to operate,
  625. * note that the voltage and flash wait states should be set before changing frequency
  626. * @return none
  627. */
  628. void POWER_SetVoltageForFreq(uint32_t freq);
  629. /*!
  630. * @brief Power Library API to return the library version.
  631. *
  632. * @param none
  633. * @return version number of the power library
  634. */
  635. uint32_t POWER_GetLibVersion(void);
  636. /**
  637. * @}
  638. */
  639. #ifdef __cplusplus
  640. }
  641. #endif
  642. #endif /* _FSL_POWER_H_ */