10#include "fsl_common.h"
39#define FSL_CDOG_DRIVER_VERSION (MAKE_VERSION(2, 1, 1))
46 uint8_t miscompare : 3;
51 uint8_t irq_pause : 2;
52 uint8_t debug_halt : 2;
55enum __cdog_debug_Action_ctrl_enum
57 kCDOG_DebugHaltCtrl_Run = 0x1,
58 kCDOG_DebugHaltCtrl_Pause = 0x2,
61enum __cdog_irq_pause_ctrl_enum
63 kCDOG_IrqPauseCtrl_Run = 0x1,
64 kCDOG_IrqPauseCtrl_Pause = 0x2,
67enum __cdog_fault_ctrl_enum
69 kCDOG_FaultCtrl_EnableReset = 0x1U,
70 kCDOG_FaultCtrl_EnableInterrupt = 0x2U,
71 kCDOG_FaultCtrl_NoAction = 0x4U,
74enum __code_lock_ctrl_enum
76 kCDOG_LockCtrl_Lock = 0x1,
77 kCDOG_LockCtrl_Unlock = 0x2,
80typedef uint32_t secure_counter_t;
85 CDOG->ADD = (secure_counter_t)(add); \
91 CDOG->ADD1 = (secure_counter_t)0x1U; \
97 CDOG->ADD16 = (secure_counter_t)0x1U; \
103 CDOG->ADD256 = (secure_counter_t)0x1U; \
109 CDOG->SUB = (secure_counter_t)(sub); \
115 CDOG->SUB1 = (secure_counter_t)0x1U; \
121 CDOG->SUB16 = (secure_counter_t)0x1U; \
127 CDOG->SUB256 = (secure_counter_t)0x1U; \
130#define SC_CHECK(val) \
133 CDOG->RESTART = (secure_counter_t)val; \
140extern void CDOG_DriverIRQHandler(
void);
142#if defined(__cplusplus)
319#if defined(__cplusplus)
void CDOG_Set(CDOG_Type *base, uint32_t stop, uint32_t reload, uint32_t start)
Sets secure counter and instruction timer values.
Definition: fsl_cdog.c:88
void CDOG_Add1(CDOG_Type *base)
Add 1 to secure counter.
Definition: fsl_cdog.c:116
void CDOG_Sub1(CDOG_Type *base)
Substract 1 from secure counter.
Definition: fsl_cdog.c:167
void CDOG_Deinit(CDOG_Type *base)
Deinitialize CDOG.
Definition: fsl_cdog.c:301
void CDOG_Check(CDOG_Type *base, uint32_t check)
Checks secure counter.
Definition: fsl_cdog.c:205
void CDOG_GetDefaultConfig(cdog_config_t *conf)
Sets the default configuration of CDOG.
Definition: fsl_cdog.c:34
void CDOG_Add16(CDOG_Type *base)
Add 16 to secure counter.
Definition: fsl_cdog.c:129
void CDOG_Start(CDOG_Type *base, uint32_t reload, uint32_t start)
Sets secure counter and instruction timer values.
Definition: fsl_cdog.c:57
void CDOG_Stop(CDOG_Type *base, uint32_t stop)
Stops secure counter and instruction timer.
Definition: fsl_cdog.c:72
void CDOG_WritePersistent(CDOG_Type *base, uint32_t value)
Set the CDOG persistent word.
Definition: fsl_cdog.c:216
void CDOG_Sub256(CDOG_Type *base)
Substract 256 from secure counter.
Definition: fsl_cdog.c:191
void CDOG_Add256(CDOG_Type *base)
Add 256 to secure counter.
Definition: fsl_cdog.c:142
uint32_t CDOG_ReadPersistent(CDOG_Type *base)
Get the CDOG persistent word.
Definition: fsl_cdog.c:227
status_t CDOG_Init(CDOG_Type *base, cdog_config_t *conf)
Initialize CDOG.
Definition: fsl_cdog.c:241
void CDOG_Sub16(CDOG_Type *base)
Substract 16 from secure counter.
Definition: fsl_cdog.c:179
void CDOG_Sub(CDOG_Type *base, uint32_t sub)
Definition: fsl_cdog.c:155
void CDOG_Add(CDOG_Type *base, uint32_t add)
Add value to secure counter.
Definition: fsl_cdog.c:103
int32_t status_t
Type used for all status and error return values.
Definition: fsl_common.h:225
Definition: MIMXRT1166_cm4.h:24992
Definition: fsl_cdog.h:43