123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425 |
- #ifndef _FSL_PMC_H_
- #define _FSL_PMC_H_
- #include "fsl_common.h"
- #define FSL_PMC_DRIVER_VERSION (MAKE_VERSION(2, 0, 0))
- #if (defined(FSL_FEATURE_PMC_HAS_LVDV) && FSL_FEATURE_PMC_HAS_LVDV)
- typedef enum _pmc_low_volt_detect_volt_select
- {
- kPMC_LowVoltDetectLowTrip = 0U,
- kPMC_LowVoltDetectHighTrip = 1U
- } pmc_low_volt_detect_volt_select_t;
- #endif
- #if (defined(FSL_FEATURE_PMC_HAS_LVWV) && FSL_FEATURE_PMC_HAS_LVWV)
- typedef enum _pmc_low_volt_warning_volt_select
- {
- kPMC_LowVoltWarningLowTrip = 0U,
- kPMC_LowVoltWarningMid1Trip = 1U,
- kPMC_LowVoltWarningMid2Trip = 2U,
- kPMC_LowVoltWarningHighTrip = 3U
- } pmc_low_volt_warning_volt_select_t;
- #endif
- #if (defined(FSL_FEATURE_PMC_HAS_HVDSC1) && FSL_FEATURE_PMC_HAS_HVDSC1)
- typedef enum _pmc_high_volt_detect_volt_select
- {
- kPMC_HighVoltDetectLowTrip = 0U,
- kPMC_HighVoltDetectHighTrip = 1U
- } pmc_high_volt_detect_volt_select_t;
- #endif
- #if (defined(FSL_FEATURE_PMC_HAS_BGBDS) && FSL_FEATURE_PMC_HAS_BGBDS)
- typedef enum _pmc_bandgap_buffer_drive_select
- {
- kPMC_BandgapBufferDriveLow = 0U,
- kPMC_BandgapBufferDriveHigh = 1U
- } pmc_bandgap_buffer_drive_select_t;
- #endif
- #if (defined(FSL_FEATURE_PMC_HAS_VLPO) && FSL_FEATURE_PMC_HAS_VLPO)
- typedef enum _pmc_vlp_freq_option
- {
- kPMC_FreqRestrict = 0U,
- kPMC_FreqUnrestrict = 1U
- } pmc_vlp_freq_mode_t;
- #endif
- #if (defined(FSL_FEATURE_PMC_HAS_VERID) && FSL_FEATURE_PMC_HAS_VERID)
- typedef struct _pmc_version_id
- {
- uint16_t feature;
- uint8_t minor;
- uint8_t major;
- } pmc_version_id_t;
- #endif
- #if (defined(FSL_FEATURE_PMC_HAS_PARAM) && FSL_FEATURE_PMC_HAS_PARAM)
- typedef struct _pmc_param
- {
- bool vlpoEnable;
- bool hvdEnable;
- } pmc_param_t;
- #endif
- typedef struct _pmc_low_volt_detect_config
- {
- bool enableInt;
- bool enableReset;
- #if (defined(FSL_FEATURE_PMC_HAS_LVDV) && FSL_FEATURE_PMC_HAS_LVDV)
- pmc_low_volt_detect_volt_select_t voltSelect;
- #endif
- } pmc_low_volt_detect_config_t;
- typedef struct _pmc_low_volt_warning_config
- {
- bool enableInt;
- #if (defined(FSL_FEATURE_PMC_HAS_LVWV) && FSL_FEATURE_PMC_HAS_LVWV)
- pmc_low_volt_warning_volt_select_t voltSelect;
- #endif
- } pmc_low_volt_warning_config_t;
- #if (defined(FSL_FEATURE_PMC_HAS_HVDSC1) && FSL_FEATURE_PMC_HAS_HVDSC1)
- typedef struct _pmc_high_volt_detect_config
- {
- bool enableInt;
- bool enableReset;
- pmc_high_volt_detect_volt_select_t voltSelect;
- } pmc_high_volt_detect_config_t;
- #endif
- #if ((defined(FSL_FEATURE_PMC_HAS_BGBE) && FSL_FEATURE_PMC_HAS_BGBE) || \
- (defined(FSL_FEATURE_PMC_HAS_BGEN) && FSL_FEATURE_PMC_HAS_BGEN) || \
- (defined(FSL_FEATURE_PMC_HAS_BGBDS) && FSL_FEATURE_PMC_HAS_BGBDS))
- typedef struct _pmc_bandgap_buffer_config
- {
- #if (defined(FSL_FEATURE_PMC_HAS_BGBE) && FSL_FEATURE_PMC_HAS_BGBE)
- bool enable;
- #endif
- #if (defined(FSL_FEATURE_PMC_HAS_BGEN) && FSL_FEATURE_PMC_HAS_BGEN)
- bool enableInLowPowerMode;
- #endif
- #if (defined(FSL_FEATURE_PMC_HAS_BGBDS) && FSL_FEATURE_PMC_HAS_BGBDS)
- pmc_bandgap_buffer_drive_select_t drive;
- #endif
- } pmc_bandgap_buffer_config_t;
- #endif
- #if defined(__cplusplus)
- extern "C" {
- #endif
- #if (defined(FSL_FEATURE_PMC_HAS_VERID) && FSL_FEATURE_PMC_HAS_VERID)
- static inline void PMC_GetVersionId(PMC_Type *base, pmc_version_id_t *versionId)
- {
- *((uint32_t *)versionId) = base->VERID;
- }
- #endif
- #if (defined(FSL_FEATURE_PMC_HAS_PARAM) && FSL_FEATURE_PMC_HAS_PARAM)
- void PMC_GetParam(PMC_Type *base, pmc_param_t *param);
- #endif
- void PMC_ConfigureLowVoltDetect(PMC_Type *base, const pmc_low_volt_detect_config_t *config);
- static inline bool PMC_GetLowVoltDetectFlag(PMC_Type *base)
- {
- return (bool)(base->LVDSC1 & PMC_LVDSC1_LVDF_MASK);
- }
- static inline void PMC_ClearLowVoltDetectFlag(PMC_Type *base)
- {
- base->LVDSC1 |= PMC_LVDSC1_LVDACK_MASK;
- }
- void PMC_ConfigureLowVoltWarning(PMC_Type *base, const pmc_low_volt_warning_config_t *config);
- static inline bool PMC_GetLowVoltWarningFlag(PMC_Type *base)
- {
- return (bool)(base->LVDSC2 & PMC_LVDSC2_LVWF_MASK);
- }
- static inline void PMC_ClearLowVoltWarningFlag(PMC_Type *base)
- {
- base->LVDSC2 |= PMC_LVDSC2_LVWACK_MASK;
- }
- #if (defined(FSL_FEATURE_PMC_HAS_HVDSC1) && FSL_FEATURE_PMC_HAS_HVDSC1)
- void PMC_ConfigureHighVoltDetect(PMC_Type *base, const pmc_high_volt_detect_config_t *config);
- static inline bool PMC_GetHighVoltDetectFlag(PMC_Type *base)
- {
- return (bool)(base->HVDSC1 & PMC_HVDSC1_HVDF_MASK);
- }
- static inline void PMC_ClearHighVoltDetectFlag(PMC_Type *base)
- {
- base->HVDSC1 |= PMC_HVDSC1_HVDACK_MASK;
- }
- #endif
- #if ((defined(FSL_FEATURE_PMC_HAS_BGBE) && FSL_FEATURE_PMC_HAS_BGBE) || \
- (defined(FSL_FEATURE_PMC_HAS_BGEN) && FSL_FEATURE_PMC_HAS_BGEN) || \
- (defined(FSL_FEATURE_PMC_HAS_BGBDS) && FSL_FEATURE_PMC_HAS_BGBDS))
- void PMC_ConfigureBandgapBuffer(PMC_Type *base, const pmc_bandgap_buffer_config_t *config);
- #endif
- #if (defined(FSL_FEATURE_PMC_HAS_ACKISO) && FSL_FEATURE_PMC_HAS_ACKISO)
- static inline bool PMC_GetPeriphIOIsolationFlag(PMC_Type *base)
- {
- return (bool)(base->REGSC & PMC_REGSC_ACKISO_MASK);
- }
- static inline void PMC_ClearPeriphIOIsolationFlag(PMC_Type *base)
- {
- base->REGSC |= PMC_REGSC_ACKISO_MASK;
- }
- #endif
- #if (defined(FSL_FEATURE_PMC_HAS_REGONS) && FSL_FEATURE_PMC_HAS_REGONS)
- static inline bool PMC_IsRegulatorInRunRegulation(PMC_Type *base)
- {
- return (bool)(base->REGSC & PMC_REGSC_REGONS_MASK);
- }
- #endif
- #if defined(__cplusplus)
- }
- #endif
- #endif
|