Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:01

0001 /*
0002  * Copyright (c) 2016, Freescale Semiconductor, Inc.
0003  * Copyright 2017-2022, NXP
0004  * All rights reserved.
0005  *
0006  * SPDX-License-Identifier: BSD-3-Clause
0007  */
0008 
0009 #ifndef _FSL_SNVS_HP_H_
0010 #define _FSL_SNVS_HP_H_
0011 
0012 #include "fsl_common.h"
0013 
0014 /*!
0015  * @addtogroup snvs_hp
0016  * @{
0017  */
0018 
0019 /*******************************************************************************
0020  * Definitions
0021  ******************************************************************************/
0022 
0023 /*! @name Driver version */
0024 /*@{*/
0025 #define FSL_SNVS_HP_DRIVER_VERSION (MAKE_VERSION(2, 3, 2)) /*!< Version 2.3.2 */
0026 /*@}*/
0027 
0028 /*! @brief List of SNVS interrupts */
0029 typedef enum _snvs_hp_interrupts
0030 {
0031     kSNVS_RTC_AlarmInterrupt    = SNVS_HPCR_HPTA_EN_MASK, /*!< RTC time alarm */
0032     kSNVS_RTC_PeriodicInterrupt = SNVS_HPCR_PI_EN_MASK,   /*!< RTC periodic interrupt */
0033 } snvs_hp_interrupts_t;
0034 
0035 /*! @brief List of SNVS flags */
0036 typedef enum _snvs_hp_status_flags
0037 {
0038     kSNVS_RTC_AlarmInterruptFlag    = SNVS_HPSR_HPTA_MASK,          /*!< RTC time alarm flag */
0039     kSNVS_RTC_PeriodicInterruptFlag = SNVS_HPSR_PI_MASK,            /*!< RTC periodic interrupt flag */
0040     kSNVS_ZMK_ZeroFlag              = (int)SNVS_HPSR_ZMK_ZERO_MASK, /*!< The ZMK is zero */
0041     kSNVS_OTPMK_ZeroFlag            = SNVS_HPSR_OTPMK_ZERO_MASK,    /*!< The OTPMK is zero */
0042 } snvs_hp_status_flags_t;
0043 
0044 /* Re-map Security Violation for RT11xx specific violation*/
0045 #ifndef SNVS_HPSVSR_SV0_MASK
0046 #define SNVS_HPSVSR_SV0_MASK SNVS_HPSVSR_CAAM_MASK
0047 #endif
0048 
0049 #ifndef SNVS_HPSVSR_SV1_MASK
0050 #define SNVS_HPSVSR_SV1_MASK SNVS_HPSVSR_JTAGC_MASK
0051 #endif
0052 
0053 #ifndef SNVS_HPSVSR_SV2_MASK
0054 #define SNVS_HPSVSR_SV2_MASK SNVS_HPSVSR_WDOG2_MASK
0055 #endif
0056 
0057 #ifndef SNVS_HPSVSR_SV4_MASK
0058 #define SNVS_HPSVSR_SV4_MASK SNVS_HPSVSR_SRC_MASK
0059 #endif
0060 
0061 #ifndef SNVS_HPSVSR_SV5_MASK
0062 #define SNVS_HPSVSR_SV5_MASK SNVS_HPSVSR_OCOTP_MASK
0063 #endif
0064 
0065 /*! @brief List of SNVS security violation flags */
0066 typedef enum _snvs_hp_sv_status_flags
0067 {
0068     kSNVS_LP_ViolationFlag = SNVS_HPSVSR_SW_LPSV_MASK,           /*!< Low Power section Security Violation */
0069     kSNVS_ZMK_EccFailFlag  = SNVS_HPSVSR_ZMK_ECC_FAIL_MASK,      /*!< Zeroizable Master Key Error Correcting Code Check
0070                                                                    Failure */
0071     kSNVS_LP_SoftwareViolationFlag   = SNVS_HPSVSR_SW_LPSV_MASK, /*!< LP Software Security Violation */
0072     kSNVS_FatalSoftwareViolationFlag = SNVS_HPSVSR_SW_FSV_MASK,  /*!< Software Fatal Security Violation */
0073     kSNVS_SoftwareViolationFlag      = SNVS_HPSVSR_SW_SV_MASK,   /*!< Software Security Violation */
0074     kSNVS_Violation0Flag             = SNVS_HPSVSR_SV0_MASK,     /*!< Security Violation 0 */
0075     kSNVS_Violation1Flag             = SNVS_HPSVSR_SV1_MASK,     /*!< Security Violation 1 */
0076     kSNVS_Violation2Flag             = SNVS_HPSVSR_SV2_MASK,     /*!< Security Violation 2 */
0077 #if defined(SNVS_HPSVSR_SV3_MASK)
0078     kSNVS_Violation3Flag = SNVS_HPSVSR_SV3_MASK, /*!< Security Violation 3 */
0079 #endif                                           /* SNVS_HPSVSR_SV3_MASK */
0080     kSNVS_Violation4Flag = SNVS_HPSVSR_SV4_MASK, /*!< Security Violation 4 */
0081     kSNVS_Violation5Flag = SNVS_HPSVSR_SV5_MASK, /*!< Security Violation 5 */
0082 } snvs_hp_sv_status_flags_t;
0083 
0084 /*!
0085  * @brief Macro to make security violation flag
0086  *
0087  * Macro help to make security violation flag kSNVS_Violation0Flag to kSNVS_Violation5Flag,
0088  * For example, SNVS_MAKE_HP_SV_FLAG(0) is kSNVS_Violation0Flag.
0089  */
0090 #define SNVS_MAKE_HP_SV_FLAG(x) (1U << (SNVS_HPSVSR_SV0_SHIFT + (x)))
0091 
0092 /*! @brief Structure is used to hold the date and time */
0093 typedef struct _snvs_hp_rtc_datetime
0094 {
0095     uint16_t year;  /*!< Range from 1970 to 2099.*/
0096     uint8_t month;  /*!< Range from 1 to 12.*/
0097     uint8_t day;    /*!< Range from 1 to 31 (depending on month).*/
0098     uint8_t hour;   /*!< Range from 0 to 23.*/
0099     uint8_t minute; /*!< Range from 0 to 59.*/
0100     uint8_t second; /*!< Range from 0 to 59.*/
0101 } snvs_hp_rtc_datetime_t;
0102 
0103 /*!
0104  * @brief SNVS config structure
0105  *
0106  * This structure holds the configuration settings for the SNVS peripheral. To initialize this
0107  * structure to reasonable defaults, call the SNVS_GetDefaultConfig() function and pass a
0108  * pointer to your config structure instance.
0109  *
0110  * The config struct can be made const so it resides in flash
0111  */
0112 typedef struct _snvs_hp_rtc_config
0113 {
0114     bool rtcCalEnable;              /*!< true: RTC calibration mechanism is enabled;
0115                                          false:No calibration is used */
0116     uint32_t rtcCalValue;           /*!< Defines signed calibration value for nonsecure RTC;
0117                                          This is a 5-bit 2's complement value, range from -16 to +15 */
0118     uint32_t periodicInterruptFreq; /*!< Defines frequency of the periodic interrupt;
0119                                          Range from 0 to 15 */
0120 } snvs_hp_rtc_config_t;
0121 
0122 /*! @brief List of SNVS Security State Machine State */
0123 typedef enum _snvs_hp_ssm_state
0124 {
0125     kSNVS_SSMInit      = 0x00, /*!< Init */
0126     kSNVS_SSMHardFail  = 0x01, /*!< Hard Fail */
0127     kSNVS_SSMSoftFail  = 0x03, /*!< Soft Fail */
0128     kSNVS_SSMInitInter = 0x08, /*!< Init Intermediate (transition state between Init and Check) */
0129     kSNVS_SSMCheck     = 0x09, /*!< Check */
0130     kSNVS_SSMNonSecure = 0x0B, /*!< Non-Secure */
0131     kSNVS_SSMTrusted   = 0x0D, /*!< Trusted */
0132     kSNVS_SSMSecure    = 0x0F, /*!< Secure */
0133 } snvs_hp_ssm_state_t;
0134 
0135 /*******************************************************************************
0136  * API
0137  ******************************************************************************/
0138 
0139 #if defined(__cplusplus)
0140 extern "C" {
0141 #endif
0142 
0143 /*!
0144  * @name Initialization and deinitialization
0145  * @{
0146  */
0147 
0148 /*!
0149  * @brief Initialize the SNVS.
0150  *
0151  * @note This API should be called at the beginning of the application using the SNVS driver.
0152  *
0153  * @param base SNVS peripheral base address
0154  */
0155 void SNVS_HP_Init(SNVS_Type *base);
0156 
0157 /*!
0158  * @brief Deinitialize the SNVS.
0159  *
0160  * @param base SNVS peripheral base address
0161  */
0162 void SNVS_HP_Deinit(SNVS_Type *base);
0163 
0164 /*!
0165  * @brief Ungates the SNVS clock and configures the peripheral for basic operation.
0166  *
0167  * @note This API should be called at the beginning of the application using the SNVS driver.
0168  *
0169  * @param base   SNVS peripheral base address
0170  * @param config Pointer to the user's SNVS configuration structure.
0171  */
0172 void SNVS_HP_RTC_Init(SNVS_Type *base, const snvs_hp_rtc_config_t *config);
0173 
0174 /*!
0175  * @brief Stops the RTC and SRTC timers.
0176  *
0177  * @param base SNVS peripheral base address
0178  */
0179 void SNVS_HP_RTC_Deinit(SNVS_Type *base);
0180 
0181 /*!
0182  * @brief Fills in the SNVS config struct with the default settings.
0183  *
0184  * The default values are as follows.
0185  * @code
0186  *    config->rtccalenable = false;
0187  *    config->rtccalvalue = 0U;
0188  *    config->PIFreq = 0U;
0189  * @endcode
0190  * @param config Pointer to the user's SNVS configuration structure.
0191  */
0192 void SNVS_HP_RTC_GetDefaultConfig(snvs_hp_rtc_config_t *config);
0193 
0194 /*! @}*/
0195 
0196 /*!
0197  * @name Non secure RTC current Time & Alarm
0198  * @{
0199  */
0200 
0201 /*!
0202  * @brief Sets the SNVS RTC date and time according to the given time structure.
0203  *
0204  * @param base     SNVS peripheral base address
0205  * @param datetime Pointer to the structure where the date and time details are stored.
0206  *
0207  * @return kStatus_Success: Success in setting the time and starting the SNVS RTC
0208  *         kStatus_InvalidArgument: Error because the datetime format is incorrect
0209  */
0210 status_t SNVS_HP_RTC_SetDatetime(SNVS_Type *base, const snvs_hp_rtc_datetime_t *datetime);
0211 
0212 /*!
0213  * @brief Gets the SNVS RTC time and stores it in the given time structure.
0214  *
0215  * @param base     SNVS peripheral base address
0216  * @param datetime Pointer to the structure where the date and time details are stored.
0217  */
0218 void SNVS_HP_RTC_GetDatetime(SNVS_Type *base, snvs_hp_rtc_datetime_t *datetime);
0219 
0220 /*!
0221  * @brief Sets the SNVS RTC alarm time.
0222  *
0223  * The function sets the RTC alarm. It also checks whether the specified alarm time
0224  * is greater than the present time. If not, the function does not set the alarm
0225  * and returns an error.
0226  *
0227  * @param base      SNVS peripheral base address
0228  * @param alarmTime Pointer to the structure where the alarm time is stored.
0229  *
0230  * @return kStatus_Success: success in setting the SNVS RTC alarm
0231  *         kStatus_InvalidArgument: Error because the alarm datetime format is incorrect
0232  *         kStatus_Fail: Error because the alarm time has already passed
0233  */
0234 status_t SNVS_HP_RTC_SetAlarm(SNVS_Type *base, const snvs_hp_rtc_datetime_t *alarmTime);
0235 
0236 /*!
0237  * @brief Returns the SNVS RTC alarm time.
0238  *
0239  * @param base     SNVS peripheral base address
0240  * @param datetime Pointer to the structure where the alarm date and time details are stored.
0241  */
0242 void SNVS_HP_RTC_GetAlarm(SNVS_Type *base, snvs_hp_rtc_datetime_t *datetime);
0243 
0244 #if (defined(FSL_FEATURE_SNVS_HAS_SRTC) && (FSL_FEATURE_SNVS_HAS_SRTC > 0))
0245 /*!
0246  * @brief The function synchronizes RTC counter value with SRTC.
0247  *
0248  * @param base SNVS peripheral base address
0249  */
0250 void SNVS_HP_RTC_TimeSynchronize(SNVS_Type *base);
0251 #endif /* FSL_FEATURE_SNVS_HAS_SRTC */
0252 
0253 /*! @}*/
0254 
0255 /*!
0256  * @name Interrupt Interface
0257  * @{
0258  */
0259 
0260 /*!
0261  * @brief Enables the selected SNVS interrupts.
0262  *
0263  * @param base SNVS peripheral base address
0264  * @param mask The interrupts to enable. This is a logical OR of members of the
0265  *             enumeration :: _snvs_hp_interrupts_t
0266  */
0267 static inline void SNVS_HP_RTC_EnableInterrupts(SNVS_Type *base, uint32_t mask)
0268 {
0269     base->HPCR |= mask;
0270 }
0271 
0272 /*!
0273  * @brief Disables the selected SNVS interrupts.
0274  *
0275  * @param base SNVS peripheral base address
0276  * @param mask The interrupts to disable. This is a logical OR of members of the
0277  *             enumeration :: _snvs_hp_interrupts_t
0278  */
0279 static inline void SNVS_HP_RTC_DisableInterrupts(SNVS_Type *base, uint32_t mask)
0280 {
0281     base->HPCR &= ~mask;
0282 }
0283 
0284 /*!
0285  * @brief Gets the enabled SNVS interrupts.
0286  *
0287  * @param base SNVS peripheral base address
0288  *
0289  * @return The enabled interrupts. This is the logical OR of members of the
0290  *         enumeration :: _snvs_hp_interrupts_t
0291  */
0292 uint32_t SNVS_HP_RTC_GetEnabledInterrupts(SNVS_Type *base);
0293 
0294 /*! @}*/
0295 
0296 /*!
0297  * @name Status Interface
0298  * @{
0299  */
0300 
0301 /*!
0302  * @brief Gets the SNVS status flags.
0303  *
0304  * @param base SNVS peripheral base address
0305  *
0306  * @return The status flags. This is the logical OR of members of the
0307  *         enumeration :: _snvs_hp_status_flags_t
0308  */
0309 uint32_t SNVS_HP_RTC_GetStatusFlags(SNVS_Type *base);
0310 
0311 /*!
0312  * @brief  Clears the SNVS status flags.
0313  *
0314  * @param base SNVS peripheral base address
0315  * @param mask The status flags to clear. This is a logical OR of members of the
0316  *             enumeration :: _snvs_hp_status_flags_t
0317  */
0318 static inline void SNVS_HP_RTC_ClearStatusFlags(SNVS_Type *base, uint32_t mask)
0319 {
0320     base->HPSR |= mask;
0321 }
0322 
0323 /*! @}*/
0324 
0325 /*!
0326  * @name Timer Start and Stop
0327  * @{
0328  */
0329 
0330 /*!
0331  * @brief Starts the SNVS RTC time counter.
0332  *
0333  * @param base SNVS peripheral base address
0334  */
0335 static inline void SNVS_HP_RTC_StartTimer(SNVS_Type *base)
0336 {
0337     base->HPCR |= SNVS_HPCR_RTC_EN_MASK;
0338     while (0U == (base->HPCR & SNVS_HPCR_RTC_EN_MASK))
0339     {
0340     }
0341 }
0342 
0343 /*!
0344  * @brief Stops the SNVS RTC time counter.
0345  *
0346  * @param base SNVS peripheral base address
0347  */
0348 static inline void SNVS_HP_RTC_StopTimer(SNVS_Type *base)
0349 {
0350     base->HPCR &= ~SNVS_HPCR_RTC_EN_MASK;
0351     while ((base->HPCR & SNVS_HPCR_RTC_EN_MASK) != 0U)
0352     {
0353     }
0354 }
0355 
0356 /*! @}*/
0357 
0358 /*!
0359  * @brief Enable or disable master key selection.
0360  *
0361  * @param base SNVS peripheral base address
0362  * @param enable Pass true to enable, false to disable.
0363  */
0364 static inline void SNVS_HP_EnableMasterKeySelection(SNVS_Type *base, bool enable)
0365 {
0366     if (enable)
0367     {
0368         base->HPCOMR |= SNVS_HPCOMR_MKS_EN_MASK;
0369     }
0370     else
0371     {
0372         base->HPCOMR &= (~SNVS_HPCOMR_MKS_EN_MASK);
0373     }
0374 }
0375 
0376 /*!
0377  * @brief Trigger to program Zeroizable Master Key.
0378  *
0379  * @param base SNVS peripheral base address
0380  */
0381 static inline void SNVS_HP_ProgramZeroizableMasterKey(SNVS_Type *base)
0382 {
0383     base->HPCOMR |= SNVS_HPCOMR_PROG_ZMK_MASK;
0384 }
0385 
0386 /*!
0387  * @brief Trigger SSM State Transition
0388  *
0389  * Trigger state transition of the system security monitor (SSM). It results only
0390  * the following transitions of the SSM:
0391  *   - Check State -> Non-Secure (when Non-Secure Boot and not in Fab Configuration)
0392  *   - Check State --> Trusted (when Secure Boot or in Fab Configuration )
0393  *   - Trusted State --> Secure
0394  *   - Secure State --> Trusted
0395  *   - Soft Fail --> Non-Secure
0396  *
0397  * @param base SNVS peripheral base address
0398  */
0399 static inline void SNVS_HP_ChangeSSMState(SNVS_Type *base)
0400 {
0401     base->HPCOMR |= SNVS_HPCOMR_SSM_ST_MASK;
0402 }
0403 
0404 /*!
0405  * @brief Trigger Software Fatal Security Violation
0406  *
0407  * The result SSM state transition is:
0408  *  - Check State -> Soft Fail
0409  *  - Non-Secure State -> Soft Fail
0410  *  - Trusted State -> Soft Fail
0411  *  - Secure State -> Soft Fail
0412  *
0413  * @param base SNVS peripheral base address
0414  */
0415 static inline void SNVS_HP_SetSoftwareFatalSecurityViolation(SNVS_Type *base)
0416 {
0417     base->HPCOMR |= SNVS_HPCOMR_SW_FSV_MASK;
0418 }
0419 
0420 /*!
0421  * @brief Trigger Software Security Violation
0422  *
0423  * The result SSM state transition is:
0424  *  - Check -> Non-Secure
0425  *  - Trusted -> Soft Fail
0426  *  - Secure -> Soft Fail
0427  *
0428  * @param base SNVS peripheral base address
0429  */
0430 static inline void SNVS_HP_SetSoftwareSecurityViolation(SNVS_Type *base)
0431 {
0432     base->HPCOMR |= SNVS_HPCOMR_SW_SV_MASK;
0433 }
0434 
0435 /*!
0436  * @brief Get current SSM State
0437  *
0438  * @param base SNVS peripheral base address
0439  * @return Current SSM state
0440  */
0441 static inline snvs_hp_ssm_state_t SNVS_HP_GetSSMState(SNVS_Type *base)
0442 {
0443     return (snvs_hp_ssm_state_t)((uint32_t)((base->HPSR & SNVS_HPSR_SSM_STATE_MASK) >> SNVS_HPSR_SSM_STATE_SHIFT));
0444 }
0445 
0446 /*!
0447  * @brief Reset the SNVS LP section.
0448  *
0449  * Reset the LP section except SRTC and Time alarm.
0450  *
0451  * @param base SNVS peripheral base address
0452  */
0453 static inline void SNVS_HP_ResetLP(SNVS_Type *base)
0454 {
0455     base->HPCOMR |= SNVS_HPCOMR_LP_SWR_MASK;
0456 }
0457 
0458 /*!
0459  * @name High Assurance Counter (HAC)
0460  * @{
0461  */
0462 
0463 /*!
0464  * @brief Enable or disable the High Assurance Counter (HAC)
0465  *
0466  * @param base SNVS peripheral base address
0467  * @param enable Pass true to enable, false to disable.
0468  */
0469 static inline void SNVS_HP_EnableHighAssuranceCounter(SNVS_Type *base, bool enable)
0470 {
0471     if (enable)
0472     {
0473         base->HPCOMR |= SNVS_HPCOMR_HAC_EN_MASK;
0474     }
0475     else
0476     {
0477         base->HPCOMR &= (~SNVS_HPCOMR_HAC_EN_MASK);
0478     }
0479 }
0480 
0481 /*!
0482  * @brief Start or stop the High Assurance Counter (HAC)
0483  *
0484  * @param base SNVS peripheral base address
0485  * @param start Pass true to start, false to stop.
0486  */
0487 static inline void SNVS_HP_StartHighAssuranceCounter(SNVS_Type *base, bool start)
0488 {
0489     if (start)
0490     {
0491         base->HPCOMR &= (~SNVS_HPCOMR_HAC_STOP_MASK);
0492     }
0493     else
0494     {
0495         base->HPCOMR |= SNVS_HPCOMR_HAC_STOP_MASK;
0496     }
0497 }
0498 
0499 /*!
0500  * @brief Set the High Assurance Counter (HAC) initialize value.
0501  *
0502  * @param base SNVS peripheral base address
0503  * @param value The initial value to set.
0504  */
0505 static inline void SNVS_HP_SetHighAssuranceCounterInitialValue(SNVS_Type *base, uint32_t value)
0506 {
0507     base->HPHACIVR = value;
0508 }
0509 
0510 /*!
0511  * @brief Load the High Assurance Counter (HAC)
0512  *
0513  * This function loads the HAC initialize value to counter register.
0514  *
0515  * @param base SNVS peripheral base address
0516  */
0517 static inline void SNVS_HP_LoadHighAssuranceCounter(SNVS_Type *base)
0518 {
0519     base->HPCOMR |= SNVS_HPCOMR_HAC_LOAD_MASK;
0520 }
0521 
0522 /*!
0523  * @brief Get the current High Assurance Counter (HAC) value
0524  *
0525  * @param base SNVS peripheral base address
0526  * @return HAC currnet value.
0527  */
0528 static inline uint32_t SNVS_HP_GetHighAssuranceCounter(SNVS_Type *base)
0529 {
0530     return base->HPHACR;
0531 }
0532 
0533 /*!
0534  * @brief Clear the High Assurance Counter (HAC)
0535  *
0536  * This function can be called in a functional or soft fail state. When the HAC
0537  * is enabled:
0538  *   - If the HAC is cleared in the soft fail state, the SSM transitions to the
0539  * hard fail state immediately;
0540  *   - If the HAC is cleared in functional state, the SSM will transition to
0541  * hard fail immediately after transitioning to soft fail.
0542  *
0543  * @param base SNVS peripheral base address
0544  */
0545 static inline void SNVS_HP_ClearHighAssuranceCounter(SNVS_Type *base)
0546 {
0547     base->HPCOMR |= SNVS_HPCOMR_HAC_CLEAR_MASK;
0548 }
0549 
0550 /*!
0551  * @brief Lock the High Assurance Counter (HAC)
0552  *
0553  * Once locked, the HAC initialize value could not be changed, the HAC enable
0554  * status could not be changed. This could only be unlocked by system reset.
0555  *
0556  * @param base SNVS peripheral base address
0557  */
0558 static inline void SNVS_HP_LockHighAssuranceCounter(SNVS_Type *base)
0559 {
0560     base->HPLR |= SNVS_HPLR_HAC_L_MASK;
0561 }
0562 
0563 /*! @}*/
0564 
0565 /*!
0566  * @brief Get the SNVS HP status flags.
0567  *
0568  * The flags are returned as the OR'ed value f the
0569  *             enumeration :: _snvs_hp_status_flags_t.
0570  *
0571  * @param base SNVS peripheral base address
0572  * @return The OR'ed value of status flags.
0573  */
0574 static inline uint32_t SNVS_HP_GetStatusFlags(SNVS_Type *base)
0575 {
0576     return base->HPSR;
0577 }
0578 
0579 /*!
0580  * @brief Clear the SNVS HP status flags.
0581  *
0582  * The flags to clear are passed in as the OR'ed value of the
0583  *             enumeration :: _snvs_hp_status_flags_t.
0584  * Only these flags could be cleared using this API.
0585  *  - @ref kSNVS_RTC_PeriodicInterruptFlag
0586  *  - @ref kSNVS_RTC_AlarmInterruptFlag
0587  *
0588  * @param base SNVS peripheral base address
0589  * @param mask OR'ed value of the flags to clear.
0590  */
0591 static inline void SNVS_HP_ClearStatusFlags(SNVS_Type *base, uint32_t mask)
0592 {
0593     base->HPSR = mask;
0594 }
0595 
0596 /*!
0597  * @brief Get the SNVS HP security violation status flags.
0598  *
0599  * The flags are returned as the OR'ed value of the
0600  *             enumeration :: _snvs_hp_sv_status_flags_t.
0601  *
0602  * @param base SNVS peripheral base address
0603  * @return The OR'ed value of security violation status flags.
0604  */
0605 static inline uint32_t SNVS_HP_GetSecurityViolationStatusFlags(SNVS_Type *base)
0606 {
0607     return base->HPSVSR;
0608 }
0609 
0610 /*!
0611  * @brief Clear the SNVS HP security violation status flags.
0612  *
0613  * The flags to clear are passed in as the OR'ed value of the
0614  *             enumeration :: _snvs_hp_sv_status_flags_t.
0615  * Only these flags could be cleared using this API.
0616  *
0617  *  - @ref kSNVS_ZMK_EccFailFlag
0618  *  - @ref kSNVS_Violation0Flag
0619  *  - @ref kSNVS_Violation1Flag
0620  *  - @ref kSNVS_Violation2Flag
0621  *  - kSNVS_Violation3Flag
0622  *  - @ref kSNVS_Violation4Flag
0623  *  - @ref kSNVS_Violation5Flag
0624  *
0625  * @param base SNVS peripheral base address
0626  * @param mask OR'ed value of the flags to clear.
0627  */
0628 static inline void SNVS_HP_ClearSecurityViolationStatusFlags(SNVS_Type *base, uint32_t mask)
0629 {
0630     base->HPSVSR = mask;
0631 }
0632 
0633 #if defined(FSL_FEATURE_SNVS_HAS_SET_LOCK) && (FSL_FEATURE_SNVS_HAS_SET_LOCK > 0)
0634 /*!
0635  * brief Set SNVS HP Set locks.
0636  *
0637  * param base SNVS peripheral base address
0638  *
0639  */
0640 void SNVS_HP_SetLocks(SNVS_Type *base);
0641 #endif /* FSL_FEATURE_SNVS_HAS_SET_LOCK */
0642 
0643 #if defined(__cplusplus)
0644 }
0645 #endif
0646 
0647 /*! @}*/
0648 
0649 #endif /* _FSL_SNVS_HP_H_ */