12#include "fsl_common.h"
26#define FSL_SRC_DRIVER_VERSION (MAKE_VERSION(2, 0, 1))
34#if (defined(FSL_FEATURE_SRC_HAS_SRSR_RESET_OUT) && FSL_FEATURE_SRC_HAS_SRSR_RESET_OUT)
35 kSRC_ResetOutputEnableFlag = SRC_SRSR_RESET_OUT_MASK,
38#if !(defined(FSL_FEATURE_SRC_HAS_NO_SRSR_WBI) && FSL_FEATURE_SRC_HAS_NO_SRSR_WBI)
47#if (defined(FSL_FEATURE_SRC_HAS_SRSR_WDOG3_RST_B) && FSL_FEATURE_SRC_HAS_SRSR_WDOG3_RST_B)
48 kSRC_Wdog3ResetFlag = SRC_SRSR_WDOG3_RST_B_MASK,
52#if (defined(FSL_FEATURE_SRC_HAS_SRSR_SW) && FSL_FEATURE_SRC_HAS_SRSR_SW)
53 kSRC_SoftwareResetFlag = SRC_SRSR_SW_MASK,
58#if (defined(FSL_FEATURE_SRC_HAS_SRSR_JTAG_SW_RST) && FSL_FEATURE_SRC_HAS_SRSR_JTAG_SW_RST)
59 kSRC_JTAGSystemResetFlag =
60 SRC_SRSR_JTAG_SW_RST_MASK,
70#if (defined(FSL_FEATURE_SRC_HAS_SRSR_IPP_USER_RESET_B) && FSL_FEATURE_SRC_HAS_SRSR_IPP_USER_RESET_B)
71 kSRC_IppUserResetFlag = SRC_SRSR_IPP_USER_RESET_B_MASK,
75#if (defined(FSL_FEATURE_SRC_HAS_SRSR_SNVS) && FSL_FEATURE_SRC_HAS_SRSR_SNVS)
76 kSRC_SNVSFailResetFlag = SRC_SRSR_SNVS_MASK,
80#if (defined(FSL_FEATURE_SRC_HAS_SRSR_CSU_RESET_B) && FSL_FEATURE_SRC_HAS_SRSR_CSU_RESET_B)
81 kSRC_CsuResetFlag = SRC_SRSR_CSU_RESET_B_MASK,
84#if (defined(FSL_FEATURE_SRC_HAS_SRSR_LOCKUP) && FSL_FEATURE_SRC_HAS_SRSR_LOCKUP)
85 kSRC_CoreLockupResetFlag = SRC_SRSR_LOCKUP_MASK,
88#if (defined(FSL_FEATURE_SRC_HAS_SRSR_POR) && FSL_FEATURE_SRC_HAS_SRSR_POR)
89 kSRC_PowerOnResetFlag = SRC_SRSR_POR_MASK,
92#if (defined(FSL_FEATURE_SRC_HAS_SRSR_LOCKUP_SYSRESETREQ) && FSL_FEATURE_SRC_HAS_SRSR_LOCKUP_SYSRESETREQ)
93 kSRC_LockupSysResetFlag =
94 SRC_SRSR_LOCKUP_SYSRESETREQ_MASK,
98#if (defined(FSL_FEATURE_SRC_HAS_SRSR_IPP_RESET_B) && FSL_FEATURE_SRC_HAS_SRSR_IPP_RESET_B)
99 kSRC_IppResetPinFlag = SRC_SRSR_IPP_RESET_B_MASK,
104#if (defined(FSL_FEATURE_SRC_HAS_SISR) && FSL_FEATURE_SRC_HAS_SISR)
108enum _src_status_flags
110 kSRC_Core0WdogResetReqFlag =
111 SRC_SISR_CORE0_WDOG_RST_REQ_MASK,
115#if (defined(FSL_FEATURE_SRC_HAS_SCR_MIX_RST_STRCH) && FSL_FEATURE_SRC_HAS_SCR_MIX_RST_STRCH)
122typedef enum _src_mix_reset_stretch_cycles
124 kSRC_MixResetStretchCycleAlt0 = 0U,
125 kSRC_MixResetStretchCycleAlt1 = 1U,
126 kSRC_MixResetStretchCycleAlt2 = 2U,
127 kSRC_MixResetStretchCycleAlt3 = 3U,
128} src_mix_reset_stretch_cycles_t;
131#if (defined(FSL_FEATURE_SRC_HAS_SCR_WDOG3_RST_OPTN) && FSL_FEATURE_SRC_HAS_SCR_WDOG3_RST_OPTN)
135typedef enum _src_wdog3_reset_option
137 kSRC_Wdog3ResetOptionAlt0 = 0U,
138 kSRC_Wdog3ResetOptionAlt1 = 1U,
139} src_wdog3_reset_option_t;
157#if defined(__cplusplus)
165#if (defined(FSL_FEATURE_SRC_HAS_SCR_MASK_WDOG3_RST) && FSL_FEATURE_SRC_HAS_SCR_MASK_WDOG3_RST)
174static inline void SRC_EnableWDOG3Reset(
SRC_Type *base,
bool enable)
187#if (defined(FSL_FEATURE_SRC_HAS_SCR_MIX_RST_STRCH) && FSL_FEATURE_SRC_HAS_SCR_MIX_RST_STRCH)
194static inline void SRC_SetMixResetStretchCycles(
SRC_Type *base, src_mix_reset_stretch_cycles_t option)
196 base->SCR = (base->SCR & ~SRC_SCR_MIX_RST_STRCH_MASK) | SRC_SCR_MIX_RST_STRCH(option);
200#if (defined(FSL_FEATURE_SRC_HAS_SCR_DBG_RST_MSK_PG) && FSL_FEATURE_SRC_HAS_SCR_DBG_RST_MSK_PG)
207static inline void SRC_EnableCoreDebugResetAfterPowerGate(
SRC_Type *base,
bool enable)
211 base->SCR &= ~SRC_SCR_DBG_RST_MSK_PG_MASK;
215 base->SCR |= SRC_SCR_DBG_RST_MSK_PG_MASK;
220#if (defined(FSL_FEATURE_SRC_HAS_SCR_WDOG3_RST_OPTN) && FSL_FEATURE_SRC_HAS_SCR_WDOG3_RST_OPTN)
227static inline void SRC_SetWdog3ResetOption(
SRC_Type *base, src_wdog3_reset_option_t option)
229 base->SCR = (base->SCR & ~SRC_SCR_WDOG3_RST_OPTN_MASK) | SRC_SCR_WDOG3_RST_OPTN(option);
233#if (defined(FSL_FEATURE_SRC_HAS_SCR_CORES_DBG_RST) && FSL_FEATURE_SRC_HAS_SCR_CORES_DBG_RST)
239static inline void SRC_DoSoftwareResetARMCoreDebug(
SRC_Type *base)
241 base->SCR |= SRC_SCR_CORES_DBG_RST_MASK;
249static inline bool SRC_GetSoftwareResetARMCoreDebugDone(
SRC_Type *base)
251 return (0U == (base->SCR & SRC_SCR_CORES_DBG_RST_MASK));
255#if (defined(FSL_FEATURE_SRC_HAS_SCR_MTSR) && FSL_FEATURE_SRC_HAS_SCR_MTSR)
265static inline void SRC_EnableTemperatureSensorReset(
SRC_Type *base,
bool enable)
269 base->SCR = (base->SCR & ~SRC_SCR_MTSR_MASK) | SRC_SCR_MTSR(0x2);
273 base->SCR = (base->SCR & ~SRC_SCR_MTSR_MASK) | SRC_SCR_MTSR(0x5);
278#if (defined(FSL_FEATURE_SCR_HAS_SCR_CORE0_DBG_RST) && FSL_FEATURE_SCR_HAS_SCR_CORE0_DBG_RST)
284static inline void SRC_DoAssertCore0DebugReset(
SRC_Type *base)
286 base->SCR |= SRC_SCR_CORE0_DBG_RST_MASK;
294static inline bool SRC_GetAssertCore0DebugResetDone(
SRC_Type *base)
296 return (0U == (base->SCR & SRC_SCR_CORE0_DBG_RST_MASK));
300#if (defined(FSL_FEATURE_SRC_HAS_SCR_CORE0_RST) && FSL_FEATURE_SRC_HAS_SCR_CORE0_RST)
306static inline void SRC_DoSoftwareResetARMCore0(
SRC_Type *base)
308 base->SCR |= SRC_SCR_CORE0_RST_MASK;
317static inline bool SRC_GetSoftwareResetARMCore0Done(
SRC_Type *base)
319 return (0U == (base->SCR & SRC_SCR_CORE0_RST_MASK));
323#if (defined(FSL_FEATURE_SRC_HAS_SCR_SWRC) && FSL_FEATURE_SRC_HAS_SCR_SWRC)
332static inline void SRC_DoSoftwareResetARMCore(
SRC_Type *base)
334 base->SCR |= SRC_SCR_SWRC_MASK;
343static inline bool SRC_GetSoftwareResetARMCoreDone(
SRC_Type *base)
345 return (0U == (base->SCR & SRC_SCR_SWRC_MASK));
349#if (defined(FSL_FEATURE_SRC_HAS_SCR_EIM_RST) && FSL_FEATURE_SRC_HAS_SCR_EIM_RST)
359static inline void SRC_AssertEIMReset(
SRC_Type *base,
bool enable)
363 base->SCR |= SRC_SCR_EIM_RST_MASK;
367 base->SCR &= ~SRC_SCR_EIM_RST_MASK;
383static inline void SRC_EnableWDOGReset(
SRC_Type *base,
bool enable)
387 base->SCR = (base->SCR & ~SRC_SCR_MWDR_MASK) | SRC_SCR_MWDR(0xA);
391 base->SCR = (base->SCR & ~SRC_SCR_MWDR_MASK) | SRC_SCR_MWDR(0x5);
395#if !(defined(FSL_FEATURE_SRC_HAS_NO_SCR_WRBC) && FSL_FEATURE_SRC_HAS_NO_SCR_WRBC)
408 base->SCR = (base->SCR & ~SRC_SCR_WRBC_MASK) | SRC_SCR_WRBC(option);
412#if (defined(FSL_FEATURE_SRC_HAS_SCR_LOCKUP_RST) && FSL_FEATURE_SRC_HAS_SCR_LOCKUP_RST)
419static inline void SRC_EnableLockupReset(
SRC_Type *base,
bool enable)
423 base->SCR |= SRC_SCR_LOCKUP_RST_MASK;
427 base->SCR &= ~SRC_SCR_LOCKUP_RST_MASK;
432#if (defined(FSL_FEATURE_SRC_HAS_SCR_LUEN) && FSL_FEATURE_SRC_HAS_SCR_LUEN)
441static inline void SRC_EnableCoreLockupReset(
SRC_Type *base,
bool enable)
445 base->SCR |= SRC_SCR_LUEN_MASK;
449 base->SCR &= ~SRC_SCR_LUEN_MASK;
454#if !(defined(FSL_FEATURE_SRC_HAS_NO_SCR_WRE) && FSL_FEATURE_SRC_HAS_NO_SCR_WRE)
464static inline void SRC_EnableWarmReset(
SRC_Type *base,
bool enable)
468 base->SCR |= SRC_SCR_WRE_MASK;
472 base->SCR &= ~SRC_SCR_WRE_MASK;
477#if (defined(FSL_FEATURE_SRC_HAS_SISR) && FSL_FEATURE_SRC_HAS_SISR)
484static inline uint32_t SRC_GetStatusFlags(
SRC_Type *base)
499static inline uint32_t SRC_GetBootModeWord1(
SRC_Type *base)
513static inline uint32_t SRC_GetBootModeWord2(
SRC_Type *base)
518#if !(defined(FSL_FEATURE_SRC_HAS_NO_SRSR_WBI) && FSL_FEATURE_SRC_HAS_NO_SRSR_WBI)
531static inline void SRC_SetWarmBootIndication(
SRC_Type *base,
bool enable)
535 base->SRSR = (base->SRSR & ~SRC_SRSR_W1C_BITS_MASK) | SRC_SRSR_WBI_MASK;
539 base->SRSR = (base->SRSR & ~SRC_SRSR_W1C_BITS_MASK) & ~SRC_SRSR_WBI_MASK;
550static inline uint32_t SRC_GetResetStatusFlags(
SRC_Type *base)
575static inline void SRC_SetGeneralPurposeRegister(
SRC_Type *base, uint32_t index, uint32_t value)
577 assert(index < SRC_GPR_COUNT);
579 base->GPR[index] = value;
589static inline uint32_t SRC_GetGeneralPurposeRegister(
SRC_Type *base, uint32_t index)
591 assert(index < SRC_GPR_COUNT);
593 return base->GPR[index];
596#if defined(__cplusplus)
#define SRC_SCR_MASK_WDOG3_RST(x)
Definition: MIMXRT1052.h:42907
void SRC_ClearResetStatusFlags(SRC_Type *base, uint32_t flags)
Clear the status flags of SRC.
Definition: fsl_src.c:34
enum _src_warm_reset_bypass_count src_warm_reset_bypass_count_t
Selection of WARM reset bypass count.
_src_warm_reset_bypass_count
Selection of WARM reset bypass count.
Definition: fsl_src.h:150
_src_reset_status_flags
SRC reset status flags.
Definition: fsl_src.h:33
@ kSRC_WarmResetWaitClk64
Definition: fsl_src.h:154
@ kSRC_WarmResetWaitClk32
Definition: fsl_src.h:153
@ kSRC_WarmResetWaitClk16
Definition: fsl_src.h:152
@ kSRC_WarmResetWaitAlways
Definition: fsl_src.h:151
@ kSRC_WarmBootIndicationFlag
Definition: fsl_src.h:39
@ kSRC_TemperatureSensorResetFlag
Definition: fsl_src.h:42
@ kSRC_JTAGGeneratedResetFlag
Definition: fsl_src.h:64
@ kSRC_JTAGSoftwareResetFlag
Definition: fsl_src.h:62
@ kSRC_WatchdogResetFlag
Definition: fsl_src.h:67
Definition: MIMXRT1052.h:42848