![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Color Oled(SSD1331) connect to STMicroelectronics Nucleo-F466
mbed-os/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K82F/drivers/fsl_pmc.h@3:f3764f852aa8, 2018-10-11 (annotated)
- Committer:
- kadonotakashi
- Date:
- Thu Oct 11 02:27:46 2018 +0000
- Revision:
- 3:f3764f852aa8
- Parent:
- 0:8fdf9a60065b
Nucreo 446 + SSD1331 test version;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kadonotakashi | 0:8fdf9a60065b | 1 | /* |
kadonotakashi | 0:8fdf9a60065b | 2 | * Copyright (c) 2015, Freescale Semiconductor, Inc. |
kadonotakashi | 0:8fdf9a60065b | 3 | * All rights reserved. |
kadonotakashi | 0:8fdf9a60065b | 4 | * |
kadonotakashi | 0:8fdf9a60065b | 5 | * Redistribution and use in source and binary forms, with or without modification, |
kadonotakashi | 0:8fdf9a60065b | 6 | * are permitted provided that the following conditions are met: |
kadonotakashi | 0:8fdf9a60065b | 7 | * |
kadonotakashi | 0:8fdf9a60065b | 8 | * o Redistributions of source code must retain the above copyright notice, this list |
kadonotakashi | 0:8fdf9a60065b | 9 | * of conditions and the following disclaimer. |
kadonotakashi | 0:8fdf9a60065b | 10 | * |
kadonotakashi | 0:8fdf9a60065b | 11 | * o Redistributions in binary form must reproduce the above copyright notice, this |
kadonotakashi | 0:8fdf9a60065b | 12 | * list of conditions and the following disclaimer in the documentation and/or |
kadonotakashi | 0:8fdf9a60065b | 13 | * other materials provided with the distribution. |
kadonotakashi | 0:8fdf9a60065b | 14 | * |
kadonotakashi | 0:8fdf9a60065b | 15 | * o Neither the name of Freescale Semiconductor, Inc. nor the names of its |
kadonotakashi | 0:8fdf9a60065b | 16 | * contributors may be used to endorse or promote products derived from this |
kadonotakashi | 0:8fdf9a60065b | 17 | * software without specific prior written permission. |
kadonotakashi | 0:8fdf9a60065b | 18 | * |
kadonotakashi | 0:8fdf9a60065b | 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
kadonotakashi | 0:8fdf9a60065b | 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
kadonotakashi | 0:8fdf9a60065b | 21 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
kadonotakashi | 0:8fdf9a60065b | 22 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
kadonotakashi | 0:8fdf9a60065b | 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
kadonotakashi | 0:8fdf9a60065b | 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
kadonotakashi | 0:8fdf9a60065b | 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
kadonotakashi | 0:8fdf9a60065b | 26 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
kadonotakashi | 0:8fdf9a60065b | 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
kadonotakashi | 0:8fdf9a60065b | 28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
kadonotakashi | 0:8fdf9a60065b | 29 | */ |
kadonotakashi | 0:8fdf9a60065b | 30 | #ifndef _FSL_PMC_H_ |
kadonotakashi | 0:8fdf9a60065b | 31 | #define _FSL_PMC_H_ |
kadonotakashi | 0:8fdf9a60065b | 32 | |
kadonotakashi | 0:8fdf9a60065b | 33 | #include "fsl_common.h" |
kadonotakashi | 0:8fdf9a60065b | 34 | |
kadonotakashi | 0:8fdf9a60065b | 35 | /*! @addtogroup pmc */ |
kadonotakashi | 0:8fdf9a60065b | 36 | /*! @{ */ |
kadonotakashi | 0:8fdf9a60065b | 37 | |
kadonotakashi | 0:8fdf9a60065b | 38 | |
kadonotakashi | 0:8fdf9a60065b | 39 | /******************************************************************************* |
kadonotakashi | 0:8fdf9a60065b | 40 | * Definitions |
kadonotakashi | 0:8fdf9a60065b | 41 | ******************************************************************************/ |
kadonotakashi | 0:8fdf9a60065b | 42 | |
kadonotakashi | 0:8fdf9a60065b | 43 | /*! @name Driver version */ |
kadonotakashi | 0:8fdf9a60065b | 44 | /*@{*/ |
kadonotakashi | 0:8fdf9a60065b | 45 | /*! @brief PMC driver version */ |
kadonotakashi | 0:8fdf9a60065b | 46 | #define FSL_PMC_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) /*!< Version 2.0.0. */ |
kadonotakashi | 0:8fdf9a60065b | 47 | /*@}*/ |
kadonotakashi | 0:8fdf9a60065b | 48 | |
kadonotakashi | 0:8fdf9a60065b | 49 | #if (defined(FSL_FEATURE_PMC_HAS_LVDV) && FSL_FEATURE_PMC_HAS_LVDV) |
kadonotakashi | 0:8fdf9a60065b | 50 | /*! |
kadonotakashi | 0:8fdf9a60065b | 51 | * @brief Low-voltage Detect Voltage Select |
kadonotakashi | 0:8fdf9a60065b | 52 | */ |
kadonotakashi | 0:8fdf9a60065b | 53 | typedef enum _pmc_low_volt_detect_volt_select |
kadonotakashi | 0:8fdf9a60065b | 54 | { |
kadonotakashi | 0:8fdf9a60065b | 55 | kPMC_LowVoltDetectLowTrip = 0U, /*!< Low-trip point selected (VLVD = VLVDL )*/ |
kadonotakashi | 0:8fdf9a60065b | 56 | kPMC_LowVoltDetectHighTrip = 1U /*!< High-trip point selected (VLVD = VLVDH )*/ |
kadonotakashi | 0:8fdf9a60065b | 57 | } pmc_low_volt_detect_volt_select_t; |
kadonotakashi | 0:8fdf9a60065b | 58 | #endif |
kadonotakashi | 0:8fdf9a60065b | 59 | |
kadonotakashi | 0:8fdf9a60065b | 60 | #if (defined(FSL_FEATURE_PMC_HAS_LVWV) && FSL_FEATURE_PMC_HAS_LVWV) |
kadonotakashi | 0:8fdf9a60065b | 61 | /*! |
kadonotakashi | 0:8fdf9a60065b | 62 | * @brief Low-voltage Warning Voltage Select |
kadonotakashi | 0:8fdf9a60065b | 63 | */ |
kadonotakashi | 0:8fdf9a60065b | 64 | typedef enum _pmc_low_volt_warning_volt_select |
kadonotakashi | 0:8fdf9a60065b | 65 | { |
kadonotakashi | 0:8fdf9a60065b | 66 | kPMC_LowVoltWarningLowTrip = 0U, /*!< Low-trip point selected (VLVW = VLVW1)*/ |
kadonotakashi | 0:8fdf9a60065b | 67 | kPMC_LowVoltWarningMid1Trip = 1U, /*!< Mid 1 trip point selected (VLVW = VLVW2)*/ |
kadonotakashi | 0:8fdf9a60065b | 68 | kPMC_LowVoltWarningMid2Trip = 2U, /*!< Mid 2 trip point selected (VLVW = VLVW3)*/ |
kadonotakashi | 0:8fdf9a60065b | 69 | kPMC_LowVoltWarningHighTrip = 3U /*!< High-trip point selected (VLVW = VLVW4)*/ |
kadonotakashi | 0:8fdf9a60065b | 70 | } pmc_low_volt_warning_volt_select_t; |
kadonotakashi | 0:8fdf9a60065b | 71 | #endif |
kadonotakashi | 0:8fdf9a60065b | 72 | |
kadonotakashi | 0:8fdf9a60065b | 73 | #if (defined(FSL_FEATURE_PMC_HAS_HVDSC1) && FSL_FEATURE_PMC_HAS_HVDSC1) |
kadonotakashi | 0:8fdf9a60065b | 74 | /*! |
kadonotakashi | 0:8fdf9a60065b | 75 | * @brief High-voltage Detect Voltage Select |
kadonotakashi | 0:8fdf9a60065b | 76 | */ |
kadonotakashi | 0:8fdf9a60065b | 77 | typedef enum _pmc_high_volt_detect_volt_select |
kadonotakashi | 0:8fdf9a60065b | 78 | { |
kadonotakashi | 0:8fdf9a60065b | 79 | kPMC_HighVoltDetectLowTrip = 0U, /*!< Low-trip point selected (VHVD = VHVDL )*/ |
kadonotakashi | 0:8fdf9a60065b | 80 | kPMC_HighVoltDetectHighTrip = 1U /*!< High-trip point selected (VHVD = VHVDH )*/ |
kadonotakashi | 0:8fdf9a60065b | 81 | } pmc_high_volt_detect_volt_select_t; |
kadonotakashi | 0:8fdf9a60065b | 82 | #endif /* FSL_FEATURE_PMC_HAS_HVDSC1 */ |
kadonotakashi | 0:8fdf9a60065b | 83 | |
kadonotakashi | 0:8fdf9a60065b | 84 | #if (defined(FSL_FEATURE_PMC_HAS_BGBDS) && FSL_FEATURE_PMC_HAS_BGBDS) |
kadonotakashi | 0:8fdf9a60065b | 85 | /*! |
kadonotakashi | 0:8fdf9a60065b | 86 | * @brief Bandgap Buffer Drive Select. |
kadonotakashi | 0:8fdf9a60065b | 87 | */ |
kadonotakashi | 0:8fdf9a60065b | 88 | typedef enum _pmc_bandgap_buffer_drive_select |
kadonotakashi | 0:8fdf9a60065b | 89 | { |
kadonotakashi | 0:8fdf9a60065b | 90 | kPMC_BandgapBufferDriveLow = 0U, /*!< Low-drive. */ |
kadonotakashi | 0:8fdf9a60065b | 91 | kPMC_BandgapBufferDriveHigh = 1U /*!< High-drive. */ |
kadonotakashi | 0:8fdf9a60065b | 92 | } pmc_bandgap_buffer_drive_select_t; |
kadonotakashi | 0:8fdf9a60065b | 93 | #endif /* FSL_FEATURE_PMC_HAS_BGBDS */ |
kadonotakashi | 0:8fdf9a60065b | 94 | |
kadonotakashi | 0:8fdf9a60065b | 95 | #if (defined(FSL_FEATURE_PMC_HAS_VLPO) && FSL_FEATURE_PMC_HAS_VLPO) |
kadonotakashi | 0:8fdf9a60065b | 96 | /*! |
kadonotakashi | 0:8fdf9a60065b | 97 | * @brief VLPx Option |
kadonotakashi | 0:8fdf9a60065b | 98 | */ |
kadonotakashi | 0:8fdf9a60065b | 99 | typedef enum _pmc_vlp_freq_option |
kadonotakashi | 0:8fdf9a60065b | 100 | { |
kadonotakashi | 0:8fdf9a60065b | 101 | kPMC_FreqRestrict = 0U, /*!< Frequency is restricted in VLPx mode. */ |
kadonotakashi | 0:8fdf9a60065b | 102 | kPMC_FreqUnrestrict = 1U /*!< Frequency is unrestricted in VLPx mode. */ |
kadonotakashi | 0:8fdf9a60065b | 103 | } pmc_vlp_freq_mode_t; |
kadonotakashi | 0:8fdf9a60065b | 104 | #endif /* FSL_FEATURE_PMC_HAS_VLPO */ |
kadonotakashi | 0:8fdf9a60065b | 105 | |
kadonotakashi | 0:8fdf9a60065b | 106 | #if (defined(FSL_FEATURE_PMC_HAS_VERID) && FSL_FEATURE_PMC_HAS_VERID) |
kadonotakashi | 0:8fdf9a60065b | 107 | /*! |
kadonotakashi | 0:8fdf9a60065b | 108 | @brief IP version ID definition. |
kadonotakashi | 0:8fdf9a60065b | 109 | */ |
kadonotakashi | 0:8fdf9a60065b | 110 | typedef struct _pmc_version_id |
kadonotakashi | 0:8fdf9a60065b | 111 | { |
kadonotakashi | 0:8fdf9a60065b | 112 | uint16_t feature; /*!< Feature Specification Number. */ |
kadonotakashi | 0:8fdf9a60065b | 113 | uint8_t minor; /*!< Minor version number. */ |
kadonotakashi | 0:8fdf9a60065b | 114 | uint8_t major; /*!< Major version number. */ |
kadonotakashi | 0:8fdf9a60065b | 115 | } pmc_version_id_t; |
kadonotakashi | 0:8fdf9a60065b | 116 | #endif /* FSL_FEATURE_PMC_HAS_VERID */ |
kadonotakashi | 0:8fdf9a60065b | 117 | |
kadonotakashi | 0:8fdf9a60065b | 118 | #if (defined(FSL_FEATURE_PMC_HAS_PARAM) && FSL_FEATURE_PMC_HAS_PARAM) |
kadonotakashi | 0:8fdf9a60065b | 119 | /*! @brief IP parameter definition. */ |
kadonotakashi | 0:8fdf9a60065b | 120 | typedef struct _pmc_param |
kadonotakashi | 0:8fdf9a60065b | 121 | { |
kadonotakashi | 0:8fdf9a60065b | 122 | bool vlpoEnable; /*!< VLPO enable. */ |
kadonotakashi | 0:8fdf9a60065b | 123 | bool hvdEnable; /*!< HVD enable. */ |
kadonotakashi | 0:8fdf9a60065b | 124 | } pmc_param_t; |
kadonotakashi | 0:8fdf9a60065b | 125 | #endif /* FSL_FEATURE_PMC_HAS_PARAM */ |
kadonotakashi | 0:8fdf9a60065b | 126 | |
kadonotakashi | 0:8fdf9a60065b | 127 | /*! |
kadonotakashi | 0:8fdf9a60065b | 128 | * @brief Low-voltage Detect Configuration Structure |
kadonotakashi | 0:8fdf9a60065b | 129 | */ |
kadonotakashi | 0:8fdf9a60065b | 130 | typedef struct _pmc_low_volt_detect_config |
kadonotakashi | 0:8fdf9a60065b | 131 | { |
kadonotakashi | 0:8fdf9a60065b | 132 | bool enableInt; /*!< Enable interrupt when Low-voltage detect*/ |
kadonotakashi | 0:8fdf9a60065b | 133 | bool enableReset; /*!< Enable system reset when Low-voltage detect*/ |
kadonotakashi | 0:8fdf9a60065b | 134 | #if (defined(FSL_FEATURE_PMC_HAS_LVDV) && FSL_FEATURE_PMC_HAS_LVDV) |
kadonotakashi | 0:8fdf9a60065b | 135 | pmc_low_volt_detect_volt_select_t voltSelect; /*!< Low-voltage detect trip point voltage selection*/ |
kadonotakashi | 0:8fdf9a60065b | 136 | #endif |
kadonotakashi | 0:8fdf9a60065b | 137 | } pmc_low_volt_detect_config_t; |
kadonotakashi | 0:8fdf9a60065b | 138 | |
kadonotakashi | 0:8fdf9a60065b | 139 | /*! |
kadonotakashi | 0:8fdf9a60065b | 140 | * @brief Low-voltage Warning Configuration Structure |
kadonotakashi | 0:8fdf9a60065b | 141 | */ |
kadonotakashi | 0:8fdf9a60065b | 142 | typedef struct _pmc_low_volt_warning_config |
kadonotakashi | 0:8fdf9a60065b | 143 | { |
kadonotakashi | 0:8fdf9a60065b | 144 | bool enableInt; /*!< Enable interrupt when low-voltage warning*/ |
kadonotakashi | 0:8fdf9a60065b | 145 | #if (defined(FSL_FEATURE_PMC_HAS_LVWV) && FSL_FEATURE_PMC_HAS_LVWV) |
kadonotakashi | 0:8fdf9a60065b | 146 | pmc_low_volt_warning_volt_select_t voltSelect; /*!< Low-voltage warning trip point voltage selection*/ |
kadonotakashi | 0:8fdf9a60065b | 147 | #endif |
kadonotakashi | 0:8fdf9a60065b | 148 | } pmc_low_volt_warning_config_t; |
kadonotakashi | 0:8fdf9a60065b | 149 | |
kadonotakashi | 0:8fdf9a60065b | 150 | #if (defined(FSL_FEATURE_PMC_HAS_HVDSC1) && FSL_FEATURE_PMC_HAS_HVDSC1) |
kadonotakashi | 0:8fdf9a60065b | 151 | /*! |
kadonotakashi | 0:8fdf9a60065b | 152 | * @brief High-voltage Detect Configuration Structure |
kadonotakashi | 0:8fdf9a60065b | 153 | */ |
kadonotakashi | 0:8fdf9a60065b | 154 | typedef struct _pmc_high_volt_detect_config |
kadonotakashi | 0:8fdf9a60065b | 155 | { |
kadonotakashi | 0:8fdf9a60065b | 156 | bool enableInt; /*!< Enable interrupt when high-voltage detect*/ |
kadonotakashi | 0:8fdf9a60065b | 157 | bool enableReset; /*!< Enable system reset when high-voltage detect*/ |
kadonotakashi | 0:8fdf9a60065b | 158 | pmc_high_volt_detect_volt_select_t voltSelect; /*!< High-voltage detect trip point voltage selection*/ |
kadonotakashi | 0:8fdf9a60065b | 159 | } pmc_high_volt_detect_config_t; |
kadonotakashi | 0:8fdf9a60065b | 160 | #endif /* FSL_FEATURE_PMC_HAS_HVDSC1 */ |
kadonotakashi | 0:8fdf9a60065b | 161 | |
kadonotakashi | 0:8fdf9a60065b | 162 | #if ((defined(FSL_FEATURE_PMC_HAS_BGBE) && FSL_FEATURE_PMC_HAS_BGBE) || \ |
kadonotakashi | 0:8fdf9a60065b | 163 | (defined(FSL_FEATURE_PMC_HAS_BGEN) && FSL_FEATURE_PMC_HAS_BGEN) || \ |
kadonotakashi | 0:8fdf9a60065b | 164 | (defined(FSL_FEATURE_PMC_HAS_BGBDS) && FSL_FEATURE_PMC_HAS_BGBDS)) |
kadonotakashi | 0:8fdf9a60065b | 165 | /*! |
kadonotakashi | 0:8fdf9a60065b | 166 | * @brief Bandgap Buffer configuration. |
kadonotakashi | 0:8fdf9a60065b | 167 | */ |
kadonotakashi | 0:8fdf9a60065b | 168 | typedef struct _pmc_bandgap_buffer_config |
kadonotakashi | 0:8fdf9a60065b | 169 | { |
kadonotakashi | 0:8fdf9a60065b | 170 | #if (defined(FSL_FEATURE_PMC_HAS_BGBE) && FSL_FEATURE_PMC_HAS_BGBE) |
kadonotakashi | 0:8fdf9a60065b | 171 | bool enable; /*!< Enable bandgap buffer. */ |
kadonotakashi | 0:8fdf9a60065b | 172 | #endif |
kadonotakashi | 0:8fdf9a60065b | 173 | #if (defined(FSL_FEATURE_PMC_HAS_BGEN) && FSL_FEATURE_PMC_HAS_BGEN) |
kadonotakashi | 0:8fdf9a60065b | 174 | bool enableInLowPowerMode; /*!< Enable bandgap buffer in low-power mode. */ |
kadonotakashi | 0:8fdf9a60065b | 175 | #endif /* FSL_FEATURE_PMC_HAS_BGEN */ |
kadonotakashi | 0:8fdf9a60065b | 176 | #if (defined(FSL_FEATURE_PMC_HAS_BGBDS) && FSL_FEATURE_PMC_HAS_BGBDS) |
kadonotakashi | 0:8fdf9a60065b | 177 | pmc_bandgap_buffer_drive_select_t drive; /*!< Bandgap buffer drive select. */ |
kadonotakashi | 0:8fdf9a60065b | 178 | #endif /* FSL_FEATURE_PMC_HAS_BGBDS */ |
kadonotakashi | 0:8fdf9a60065b | 179 | } pmc_bandgap_buffer_config_t; |
kadonotakashi | 0:8fdf9a60065b | 180 | #endif |
kadonotakashi | 0:8fdf9a60065b | 181 | |
kadonotakashi | 0:8fdf9a60065b | 182 | /******************************************************************************* |
kadonotakashi | 0:8fdf9a60065b | 183 | * API |
kadonotakashi | 0:8fdf9a60065b | 184 | ******************************************************************************/ |
kadonotakashi | 0:8fdf9a60065b | 185 | |
kadonotakashi | 0:8fdf9a60065b | 186 | #if defined(__cplusplus) |
kadonotakashi | 0:8fdf9a60065b | 187 | extern "C" { |
kadonotakashi | 0:8fdf9a60065b | 188 | #endif /* __cplusplus*/ |
kadonotakashi | 0:8fdf9a60065b | 189 | |
kadonotakashi | 0:8fdf9a60065b | 190 | /*! @name Power Management Controller Control APIs*/ |
kadonotakashi | 0:8fdf9a60065b | 191 | /*@{*/ |
kadonotakashi | 0:8fdf9a60065b | 192 | |
kadonotakashi | 0:8fdf9a60065b | 193 | #if (defined(FSL_FEATURE_PMC_HAS_VERID) && FSL_FEATURE_PMC_HAS_VERID) |
kadonotakashi | 0:8fdf9a60065b | 194 | /*! |
kadonotakashi | 0:8fdf9a60065b | 195 | * @brief Gets the PMC version ID. |
kadonotakashi | 0:8fdf9a60065b | 196 | * |
kadonotakashi | 0:8fdf9a60065b | 197 | * This function gets the PMC version ID, including major version number, |
kadonotakashi | 0:8fdf9a60065b | 198 | * minor version number, and a feature specification number. |
kadonotakashi | 0:8fdf9a60065b | 199 | * |
kadonotakashi | 0:8fdf9a60065b | 200 | * @param base PMC peripheral base address. |
kadonotakashi | 0:8fdf9a60065b | 201 | * @param versionId Pointer to version ID structure. |
kadonotakashi | 0:8fdf9a60065b | 202 | */ |
kadonotakashi | 0:8fdf9a60065b | 203 | static inline void PMC_GetVersionId(PMC_Type *base, pmc_version_id_t *versionId) |
kadonotakashi | 0:8fdf9a60065b | 204 | { |
kadonotakashi | 0:8fdf9a60065b | 205 | *((uint32_t *)versionId) = base->VERID; |
kadonotakashi | 0:8fdf9a60065b | 206 | } |
kadonotakashi | 0:8fdf9a60065b | 207 | #endif /* FSL_FEATURE_PMC_HAS_VERID */ |
kadonotakashi | 0:8fdf9a60065b | 208 | |
kadonotakashi | 0:8fdf9a60065b | 209 | #if (defined(FSL_FEATURE_PMC_HAS_PARAM) && FSL_FEATURE_PMC_HAS_PARAM) |
kadonotakashi | 0:8fdf9a60065b | 210 | /*! |
kadonotakashi | 0:8fdf9a60065b | 211 | * @brief Gets the PMC parameter. |
kadonotakashi | 0:8fdf9a60065b | 212 | * |
kadonotakashi | 0:8fdf9a60065b | 213 | * This function gets the PMC parameter including the VLPO enable and the HVD enable. |
kadonotakashi | 0:8fdf9a60065b | 214 | * |
kadonotakashi | 0:8fdf9a60065b | 215 | * @param base PMC peripheral base address. |
kadonotakashi | 0:8fdf9a60065b | 216 | * @param param Pointer to PMC param structure. |
kadonotakashi | 0:8fdf9a60065b | 217 | */ |
kadonotakashi | 0:8fdf9a60065b | 218 | void PMC_GetParam(PMC_Type *base, pmc_param_t *param); |
kadonotakashi | 0:8fdf9a60065b | 219 | #endif |
kadonotakashi | 0:8fdf9a60065b | 220 | |
kadonotakashi | 0:8fdf9a60065b | 221 | /*! |
kadonotakashi | 0:8fdf9a60065b | 222 | * @brief Configures the low-voltage detect setting. |
kadonotakashi | 0:8fdf9a60065b | 223 | * |
kadonotakashi | 0:8fdf9a60065b | 224 | * This function configures the low-voltage detect setting, including the trip |
kadonotakashi | 0:8fdf9a60065b | 225 | * point voltage setting, enables or disables the interrupt, enables or disables the system reset. |
kadonotakashi | 0:8fdf9a60065b | 226 | * |
kadonotakashi | 0:8fdf9a60065b | 227 | * @param base PMC peripheral base address. |
kadonotakashi | 0:8fdf9a60065b | 228 | * @param config Low-voltage detect configuration structure. |
kadonotakashi | 0:8fdf9a60065b | 229 | */ |
kadonotakashi | 0:8fdf9a60065b | 230 | void PMC_ConfigureLowVoltDetect(PMC_Type *base, const pmc_low_volt_detect_config_t *config); |
kadonotakashi | 0:8fdf9a60065b | 231 | |
kadonotakashi | 0:8fdf9a60065b | 232 | /*! |
kadonotakashi | 0:8fdf9a60065b | 233 | * @brief Gets the Low-voltage Detect Flag status. |
kadonotakashi | 0:8fdf9a60065b | 234 | * |
kadonotakashi | 0:8fdf9a60065b | 235 | * This function reads the current LVDF status. If it returns 1, a low-voltage event is detected. |
kadonotakashi | 0:8fdf9a60065b | 236 | * |
kadonotakashi | 0:8fdf9a60065b | 237 | * @param base PMC peripheral base address. |
kadonotakashi | 0:8fdf9a60065b | 238 | * @return Current low-voltage detect flag |
kadonotakashi | 0:8fdf9a60065b | 239 | * - true: Low-voltage detected |
kadonotakashi | 0:8fdf9a60065b | 240 | * - false: Low-voltage not detected |
kadonotakashi | 0:8fdf9a60065b | 241 | */ |
kadonotakashi | 0:8fdf9a60065b | 242 | static inline bool PMC_GetLowVoltDetectFlag(PMC_Type *base) |
kadonotakashi | 0:8fdf9a60065b | 243 | { |
kadonotakashi | 0:8fdf9a60065b | 244 | return (bool)(base->LVDSC1 & PMC_LVDSC1_LVDF_MASK); |
kadonotakashi | 0:8fdf9a60065b | 245 | } |
kadonotakashi | 0:8fdf9a60065b | 246 | |
kadonotakashi | 0:8fdf9a60065b | 247 | /*! |
kadonotakashi | 0:8fdf9a60065b | 248 | * @brief Acknowledges clearing the Low-voltage Detect flag. |
kadonotakashi | 0:8fdf9a60065b | 249 | * |
kadonotakashi | 0:8fdf9a60065b | 250 | * This function acknowledges the low-voltage detection errors (write 1 to |
kadonotakashi | 0:8fdf9a60065b | 251 | * clear LVDF). |
kadonotakashi | 0:8fdf9a60065b | 252 | * |
kadonotakashi | 0:8fdf9a60065b | 253 | * @param base PMC peripheral base address. |
kadonotakashi | 0:8fdf9a60065b | 254 | */ |
kadonotakashi | 0:8fdf9a60065b | 255 | static inline void PMC_ClearLowVoltDetectFlag(PMC_Type *base) |
kadonotakashi | 0:8fdf9a60065b | 256 | { |
kadonotakashi | 0:8fdf9a60065b | 257 | base->LVDSC1 |= PMC_LVDSC1_LVDACK_MASK; |
kadonotakashi | 0:8fdf9a60065b | 258 | } |
kadonotakashi | 0:8fdf9a60065b | 259 | |
kadonotakashi | 0:8fdf9a60065b | 260 | /*! |
kadonotakashi | 0:8fdf9a60065b | 261 | * @brief Configures the low-voltage warning setting. |
kadonotakashi | 0:8fdf9a60065b | 262 | * |
kadonotakashi | 0:8fdf9a60065b | 263 | * This function configures the low-voltage warning setting, including the trip |
kadonotakashi | 0:8fdf9a60065b | 264 | * point voltage setting and enabling or disabling the interrupt. |
kadonotakashi | 0:8fdf9a60065b | 265 | * |
kadonotakashi | 0:8fdf9a60065b | 266 | * @param base PMC peripheral base address. |
kadonotakashi | 0:8fdf9a60065b | 267 | * @param config Low-voltage warning configuration structure. |
kadonotakashi | 0:8fdf9a60065b | 268 | */ |
kadonotakashi | 0:8fdf9a60065b | 269 | void PMC_ConfigureLowVoltWarning(PMC_Type *base, const pmc_low_volt_warning_config_t *config); |
kadonotakashi | 0:8fdf9a60065b | 270 | |
kadonotakashi | 0:8fdf9a60065b | 271 | /*! |
kadonotakashi | 0:8fdf9a60065b | 272 | * @brief Gets the Low-voltage Warning Flag status. |
kadonotakashi | 0:8fdf9a60065b | 273 | * |
kadonotakashi | 0:8fdf9a60065b | 274 | * This function polls the current LVWF status. When 1 is returned, it |
kadonotakashi | 0:8fdf9a60065b | 275 | * indicates a low-voltage warning event. LVWF is set when V Supply transitions |
kadonotakashi | 0:8fdf9a60065b | 276 | * below the trip point or after reset and V Supply is already below the V LVW. |
kadonotakashi | 0:8fdf9a60065b | 277 | * |
kadonotakashi | 0:8fdf9a60065b | 278 | * @param base PMC peripheral base address. |
kadonotakashi | 0:8fdf9a60065b | 279 | * @return Current LVWF status |
kadonotakashi | 0:8fdf9a60065b | 280 | * - true: Low-voltage Warning Flag is set. |
kadonotakashi | 0:8fdf9a60065b | 281 | * - false: the Low-voltage Warning does not happen. |
kadonotakashi | 0:8fdf9a60065b | 282 | */ |
kadonotakashi | 0:8fdf9a60065b | 283 | static inline bool PMC_GetLowVoltWarningFlag(PMC_Type *base) |
kadonotakashi | 0:8fdf9a60065b | 284 | { |
kadonotakashi | 0:8fdf9a60065b | 285 | return (bool)(base->LVDSC2 & PMC_LVDSC2_LVWF_MASK); |
kadonotakashi | 0:8fdf9a60065b | 286 | } |
kadonotakashi | 0:8fdf9a60065b | 287 | |
kadonotakashi | 0:8fdf9a60065b | 288 | /*! |
kadonotakashi | 0:8fdf9a60065b | 289 | * @brief Acknowledges the Low-voltage Warning flag. |
kadonotakashi | 0:8fdf9a60065b | 290 | * |
kadonotakashi | 0:8fdf9a60065b | 291 | * This function acknowledges the low voltage warning errors (write 1 to |
kadonotakashi | 0:8fdf9a60065b | 292 | * clear LVWF). |
kadonotakashi | 0:8fdf9a60065b | 293 | * |
kadonotakashi | 0:8fdf9a60065b | 294 | * @param base PMC peripheral base address. |
kadonotakashi | 0:8fdf9a60065b | 295 | */ |
kadonotakashi | 0:8fdf9a60065b | 296 | static inline void PMC_ClearLowVoltWarningFlag(PMC_Type *base) |
kadonotakashi | 0:8fdf9a60065b | 297 | { |
kadonotakashi | 0:8fdf9a60065b | 298 | base->LVDSC2 |= PMC_LVDSC2_LVWACK_MASK; |
kadonotakashi | 0:8fdf9a60065b | 299 | } |
kadonotakashi | 0:8fdf9a60065b | 300 | |
kadonotakashi | 0:8fdf9a60065b | 301 | #if (defined(FSL_FEATURE_PMC_HAS_HVDSC1) && FSL_FEATURE_PMC_HAS_HVDSC1) |
kadonotakashi | 0:8fdf9a60065b | 302 | /*! |
kadonotakashi | 0:8fdf9a60065b | 303 | * @brief Configures the high-voltage detect setting. |
kadonotakashi | 0:8fdf9a60065b | 304 | * |
kadonotakashi | 0:8fdf9a60065b | 305 | * This function configures the high-voltage detect setting, including the trip |
kadonotakashi | 0:8fdf9a60065b | 306 | * point voltage setting, enabling or disabling the interrupt, enabling or disabling the system reset. |
kadonotakashi | 0:8fdf9a60065b | 307 | * |
kadonotakashi | 0:8fdf9a60065b | 308 | * @param base PMC peripheral base address. |
kadonotakashi | 0:8fdf9a60065b | 309 | * @param config High-voltage detect configuration structure. |
kadonotakashi | 0:8fdf9a60065b | 310 | */ |
kadonotakashi | 0:8fdf9a60065b | 311 | void PMC_ConfigureHighVoltDetect(PMC_Type *base, const pmc_high_volt_detect_config_t *config); |
kadonotakashi | 0:8fdf9a60065b | 312 | |
kadonotakashi | 0:8fdf9a60065b | 313 | /*! |
kadonotakashi | 0:8fdf9a60065b | 314 | * @brief Gets the High-voltage Detect Flag status. |
kadonotakashi | 0:8fdf9a60065b | 315 | * |
kadonotakashi | 0:8fdf9a60065b | 316 | * This function reads the current HVDF status. If it returns 1, a low |
kadonotakashi | 0:8fdf9a60065b | 317 | * voltage event is detected. |
kadonotakashi | 0:8fdf9a60065b | 318 | * |
kadonotakashi | 0:8fdf9a60065b | 319 | * @param base PMC peripheral base address. |
kadonotakashi | 0:8fdf9a60065b | 320 | * @return Current high-voltage detect flag |
kadonotakashi | 0:8fdf9a60065b | 321 | * - true: High-voltage detected |
kadonotakashi | 0:8fdf9a60065b | 322 | * - false: High-voltage not detected |
kadonotakashi | 0:8fdf9a60065b | 323 | */ |
kadonotakashi | 0:8fdf9a60065b | 324 | static inline bool PMC_GetHighVoltDetectFlag(PMC_Type *base) |
kadonotakashi | 0:8fdf9a60065b | 325 | { |
kadonotakashi | 0:8fdf9a60065b | 326 | return (bool)(base->HVDSC1 & PMC_HVDSC1_HVDF_MASK); |
kadonotakashi | 0:8fdf9a60065b | 327 | } |
kadonotakashi | 0:8fdf9a60065b | 328 | |
kadonotakashi | 0:8fdf9a60065b | 329 | /*! |
kadonotakashi | 0:8fdf9a60065b | 330 | * @brief Acknowledges clearing the High-voltage Detect flag. |
kadonotakashi | 0:8fdf9a60065b | 331 | * |
kadonotakashi | 0:8fdf9a60065b | 332 | * This function acknowledges the high-voltage detection errors (write 1 to |
kadonotakashi | 0:8fdf9a60065b | 333 | * clear HVDF). |
kadonotakashi | 0:8fdf9a60065b | 334 | * |
kadonotakashi | 0:8fdf9a60065b | 335 | * @param base PMC peripheral base address. |
kadonotakashi | 0:8fdf9a60065b | 336 | */ |
kadonotakashi | 0:8fdf9a60065b | 337 | static inline void PMC_ClearHighVoltDetectFlag(PMC_Type *base) |
kadonotakashi | 0:8fdf9a60065b | 338 | { |
kadonotakashi | 0:8fdf9a60065b | 339 | base->HVDSC1 |= PMC_HVDSC1_HVDACK_MASK; |
kadonotakashi | 0:8fdf9a60065b | 340 | } |
kadonotakashi | 0:8fdf9a60065b | 341 | #endif /* FSL_FEATURE_PMC_HAS_HVDSC1 */ |
kadonotakashi | 0:8fdf9a60065b | 342 | |
kadonotakashi | 0:8fdf9a60065b | 343 | #if ((defined(FSL_FEATURE_PMC_HAS_BGBE) && FSL_FEATURE_PMC_HAS_BGBE) || \ |
kadonotakashi | 0:8fdf9a60065b | 344 | (defined(FSL_FEATURE_PMC_HAS_BGEN) && FSL_FEATURE_PMC_HAS_BGEN) || \ |
kadonotakashi | 0:8fdf9a60065b | 345 | (defined(FSL_FEATURE_PMC_HAS_BGBDS) && FSL_FEATURE_PMC_HAS_BGBDS)) |
kadonotakashi | 0:8fdf9a60065b | 346 | /*! |
kadonotakashi | 0:8fdf9a60065b | 347 | * @brief Configures the PMC bandgap. |
kadonotakashi | 0:8fdf9a60065b | 348 | * |
kadonotakashi | 0:8fdf9a60065b | 349 | * This function configures the PMC bandgap, including the drive select and |
kadonotakashi | 0:8fdf9a60065b | 350 | * behavior in low-power mode. |
kadonotakashi | 0:8fdf9a60065b | 351 | * |
kadonotakashi | 0:8fdf9a60065b | 352 | * @param base PMC peripheral base address. |
kadonotakashi | 0:8fdf9a60065b | 353 | * @param config Pointer to the configuration structure |
kadonotakashi | 0:8fdf9a60065b | 354 | */ |
kadonotakashi | 0:8fdf9a60065b | 355 | void PMC_ConfigureBandgapBuffer(PMC_Type *base, const pmc_bandgap_buffer_config_t *config); |
kadonotakashi | 0:8fdf9a60065b | 356 | #endif |
kadonotakashi | 0:8fdf9a60065b | 357 | |
kadonotakashi | 0:8fdf9a60065b | 358 | #if (defined(FSL_FEATURE_PMC_HAS_ACKISO) && FSL_FEATURE_PMC_HAS_ACKISO) |
kadonotakashi | 0:8fdf9a60065b | 359 | /*! |
kadonotakashi | 0:8fdf9a60065b | 360 | * @brief Gets the acknowledge Peripherals and I/O pads isolation flag. |
kadonotakashi | 0:8fdf9a60065b | 361 | * |
kadonotakashi | 0:8fdf9a60065b | 362 | * This function reads the Acknowledge Isolation setting that indicates |
kadonotakashi | 0:8fdf9a60065b | 363 | * whether certain peripherals and the I/O pads are in a latched state as |
kadonotakashi | 0:8fdf9a60065b | 364 | * a result of having been in the VLLS mode. |
kadonotakashi | 0:8fdf9a60065b | 365 | * |
kadonotakashi | 0:8fdf9a60065b | 366 | * @param base PMC peripheral base address. |
kadonotakashi | 0:8fdf9a60065b | 367 | * @param base Base address for current PMC instance. |
kadonotakashi | 0:8fdf9a60065b | 368 | * @return ACK isolation |
kadonotakashi | 0:8fdf9a60065b | 369 | * 0 - Peripherals and I/O pads are in a normal run state. |
kadonotakashi | 0:8fdf9a60065b | 370 | * 1 - Certain peripherals and I/O pads are in an isolated and |
kadonotakashi | 0:8fdf9a60065b | 371 | * latched state. |
kadonotakashi | 0:8fdf9a60065b | 372 | */ |
kadonotakashi | 0:8fdf9a60065b | 373 | static inline bool PMC_GetPeriphIOIsolationFlag(PMC_Type *base) |
kadonotakashi | 0:8fdf9a60065b | 374 | { |
kadonotakashi | 0:8fdf9a60065b | 375 | return (bool)(base->REGSC & PMC_REGSC_ACKISO_MASK); |
kadonotakashi | 0:8fdf9a60065b | 376 | } |
kadonotakashi | 0:8fdf9a60065b | 377 | |
kadonotakashi | 0:8fdf9a60065b | 378 | /*! |
kadonotakashi | 0:8fdf9a60065b | 379 | * @brief Acknowledges the isolation flag to Peripherals and I/O pads. |
kadonotakashi | 0:8fdf9a60065b | 380 | * |
kadonotakashi | 0:8fdf9a60065b | 381 | * This function clears the ACK Isolation flag. Writing one to this setting |
kadonotakashi | 0:8fdf9a60065b | 382 | * when it is set releases the I/O pads and certain peripherals to their normal |
kadonotakashi | 0:8fdf9a60065b | 383 | * run mode state. |
kadonotakashi | 0:8fdf9a60065b | 384 | * |
kadonotakashi | 0:8fdf9a60065b | 385 | * @param base PMC peripheral base address. |
kadonotakashi | 0:8fdf9a60065b | 386 | */ |
kadonotakashi | 0:8fdf9a60065b | 387 | static inline void PMC_ClearPeriphIOIsolationFlag(PMC_Type *base) |
kadonotakashi | 0:8fdf9a60065b | 388 | { |
kadonotakashi | 0:8fdf9a60065b | 389 | base->REGSC |= PMC_REGSC_ACKISO_MASK; |
kadonotakashi | 0:8fdf9a60065b | 390 | } |
kadonotakashi | 0:8fdf9a60065b | 391 | #endif /* FSL_FEATURE_PMC_HAS_ACKISO */ |
kadonotakashi | 0:8fdf9a60065b | 392 | |
kadonotakashi | 0:8fdf9a60065b | 393 | #if (defined(FSL_FEATURE_PMC_HAS_REGONS) && FSL_FEATURE_PMC_HAS_REGONS) |
kadonotakashi | 0:8fdf9a60065b | 394 | /*! |
kadonotakashi | 0:8fdf9a60065b | 395 | * @brief Gets the regulator regulation status. |
kadonotakashi | 0:8fdf9a60065b | 396 | * |
kadonotakashi | 0:8fdf9a60065b | 397 | * This function returns the regulator to run a regulation status. It provides |
kadonotakashi | 0:8fdf9a60065b | 398 | * the current status of the internal voltage regulator. |
kadonotakashi | 0:8fdf9a60065b | 399 | * |
kadonotakashi | 0:8fdf9a60065b | 400 | * @param base PMC peripheral base address. |
kadonotakashi | 0:8fdf9a60065b | 401 | * @param base Base address for current PMC instance. |
kadonotakashi | 0:8fdf9a60065b | 402 | * @return Regulation status |
kadonotakashi | 0:8fdf9a60065b | 403 | * 0 - Regulator is in a stop regulation or in transition to/from the regulation. |
kadonotakashi | 0:8fdf9a60065b | 404 | * 1 - Regulator is in a run regulation. |
kadonotakashi | 0:8fdf9a60065b | 405 | * |
kadonotakashi | 0:8fdf9a60065b | 406 | */ |
kadonotakashi | 0:8fdf9a60065b | 407 | static inline bool PMC_IsRegulatorInRunRegulation(PMC_Type *base) |
kadonotakashi | 0:8fdf9a60065b | 408 | { |
kadonotakashi | 0:8fdf9a60065b | 409 | return (bool)(base->REGSC & PMC_REGSC_REGONS_MASK); |
kadonotakashi | 0:8fdf9a60065b | 410 | } |
kadonotakashi | 0:8fdf9a60065b | 411 | #endif /* FSL_FEATURE_PMC_HAS_REGONS */ |
kadonotakashi | 0:8fdf9a60065b | 412 | |
kadonotakashi | 0:8fdf9a60065b | 413 | /*@}*/ |
kadonotakashi | 0:8fdf9a60065b | 414 | |
kadonotakashi | 0:8fdf9a60065b | 415 | #if defined(__cplusplus) |
kadonotakashi | 0:8fdf9a60065b | 416 | } |
kadonotakashi | 0:8fdf9a60065b | 417 | #endif /* __cplusplus*/ |
kadonotakashi | 0:8fdf9a60065b | 418 | |
kadonotakashi | 0:8fdf9a60065b | 419 | /*! @}*/ |
kadonotakashi | 0:8fdf9a60065b | 420 | |
kadonotakashi | 0:8fdf9a60065b | 421 | #endif /* _FSL_PMC_H_*/ |