RTEMS 6.1-rc4
Loading...
Searching...
No Matches
Files | Data Structures
CDOG

Files

file  fsl_cdog.h
 

Data Structures

struct  cdog_config_t
 

Driver version

enum  __cdog_debug_Action_ctrl_enum { kCDOG_DebugHaltCtrl_Run = 0x1 , kCDOG_DebugHaltCtrl_Pause = 0x2 }
 
enum  __cdog_irq_pause_ctrl_enum { kCDOG_IrqPauseCtrl_Run = 0x1 , kCDOG_IrqPauseCtrl_Pause = 0x2 }
 
enum  __cdog_fault_ctrl_enum { kCDOG_FaultCtrl_EnableReset = 0x1U , kCDOG_FaultCtrl_EnableInterrupt = 0x2U , kCDOG_FaultCtrl_NoAction = 0x4U }
 
enum  __code_lock_ctrl_enum { kCDOG_LockCtrl_Lock = 0x1 , kCDOG_LockCtrl_Unlock = 0x2 }
 
typedef uint32_t secure_counter_t
 
void CDOG_DriverIRQHandler (void)
 
#define FSL_CDOG_DRIVER_VERSION   (MAKE_VERSION(2, 1, 1))
 Defines CDOG driver version 2.1.1.
 
#define SC_ADD(add)
 
#define SC_ADD1
 
#define SC_ADD16
 
#define SC_ADD256
 
#define SC_SUB(sub)
 
#define SC_SUB1
 
#define SC_SUB16
 
#define SC_SUB256
 
#define SC_CHECK(val)
 

CDOG Functional Operation

status_t CDOG_Init (CDOG_Type *base, cdog_config_t *conf)
 Initialize CDOG.
 
void CDOG_Deinit (CDOG_Type *base)
 Deinitialize CDOG.
 
void CDOG_GetDefaultConfig (cdog_config_t *conf)
 Sets the default configuration of CDOG.
 
void CDOG_Stop (CDOG_Type *base, uint32_t stop)
 Stops secure counter and instruction timer.
 
void CDOG_Start (CDOG_Type *base, uint32_t reload, uint32_t start)
 Sets secure counter and instruction timer values.
 
void CDOG_Check (CDOG_Type *base, uint32_t check)
 Checks secure counter.
 
void CDOG_Set (CDOG_Type *base, uint32_t stop, uint32_t reload, uint32_t start)
 Sets secure counter and instruction timer values.
 
void CDOG_Add (CDOG_Type *base, uint32_t add)
 Add value to secure counter.
 
void CDOG_Add1 (CDOG_Type *base)
 Add 1 to secure counter.
 
void CDOG_Add16 (CDOG_Type *base)
 Add 16 to secure counter.
 
void CDOG_Add256 (CDOG_Type *base)
 Add 256 to secure counter.
 
void CDOG_Sub (CDOG_Type *base, uint32_t sub)
 
void CDOG_Sub1 (CDOG_Type *base)
 Substract 1 from secure counter.
 
void CDOG_Sub16 (CDOG_Type *base)
 Substract 16 from secure counter.
 
void CDOG_Sub256 (CDOG_Type *base)
 Substract 256 from secure counter.
 
void CDOG_WritePersistent (CDOG_Type *base, uint32_t value)
 Set the CDOG persistent word.
 
uint32_t CDOG_ReadPersistent (CDOG_Type *base)
 Get the CDOG persistent word.
 

Detailed Description

Macro Definition Documentation

◆ FSL_CDOG_DRIVER_VERSION

#define FSL_CDOG_DRIVER_VERSION   (MAKE_VERSION(2, 1, 1))

Defines CDOG driver version 2.1.1.

Change log:

  • Version 2.1.1
    • Remove bit CONTROL[CONTROL_CTRL]
  • Version 2.1.0
    • Rename CWT to CDOG
  • Version 2.0.2
    • Fix MISRA-2012 issues
  • Version 2.0.1
    • Fix doxygen issues
  • Version 2.0.0
    • initial version

◆ SC_ADD

#define SC_ADD (   add)
Value:
do \
{ \
CDOG->ADD = (secure_counter_t)(add); \
} while (0)
#define CDOG
Definition: MIMXRT1166_cm4.h:25374

◆ SC_ADD1

#define SC_ADD1
Value:
do \
{ \
CDOG->ADD1 = (secure_counter_t)0x1U; \
} while (0)

◆ SC_ADD16

#define SC_ADD16
Value:
do \
{ \
CDOG->ADD16 = (secure_counter_t)0x1U; \
} while (0)

◆ SC_ADD256

#define SC_ADD256
Value:
do \
{ \
CDOG->ADD256 = (secure_counter_t)0x1U; \
} while (0)

◆ SC_CHECK

#define SC_CHECK (   val)
Value:
do \
{ \
CDOG->RESTART = (secure_counter_t)val; \
} while (0)

◆ SC_SUB

#define SC_SUB (   sub)
Value:
do \
{ \
CDOG->SUB = (secure_counter_t)(sub); \
} while (0)

◆ SC_SUB1

#define SC_SUB1
Value:
do \
{ \
CDOG->SUB1 = (secure_counter_t)0x1U; \
} while (0)

◆ SC_SUB16

#define SC_SUB16
Value:
do \
{ \
CDOG->SUB16 = (secure_counter_t)0x1U; \
} while (0)

◆ SC_SUB256

#define SC_SUB256
Value:
do \
{ \
CDOG->SUB256 = (secure_counter_t)0x1U; \
} while (0)

Function Documentation

◆ CDOG_Add()

void CDOG_Add ( CDOG_Type base,
uint32_t  add 
)

Add value to secure counter.

This function add specified value to secure counter.

Parameters
baseCDOG peripheral base address.
addValue to be added.

brief Add value to secure counter

This function add specified value to secure counter.

param base CDOG peripheral base address. param add Value to be added.

◆ CDOG_Add1()

void CDOG_Add1 ( CDOG_Type base)

Add 1 to secure counter.

This function add 1 to secure counter.

Parameters
baseCDOG peripheral base address.

brief Add 1 to secure counter

This function add 1 to secure counter.

param base CDOG peripheral base address. param add Value to be added.

◆ CDOG_Add16()

void CDOG_Add16 ( CDOG_Type base)

Add 16 to secure counter.

This function add 16 to secure counter.

Parameters
baseCDOG peripheral base address.

brief Add 16 to secure counter

This function add 16 to secure counter.

param base CDOG peripheral base address. param add Value to be added.

◆ CDOG_Add256()

void CDOG_Add256 ( CDOG_Type base)

Add 256 to secure counter.

This function add 256 to secure counter.

Parameters
baseCDOG peripheral base address.

brief Add 256 to secure counter

This function add 256 to secure counter.

param base CDOG peripheral base address. param add Value to be added.

◆ CDOG_Check()

void CDOG_Check ( CDOG_Type base,
uint32_t  check 
)

Checks secure counter.

This function compares stop value in handler with secure counter value by writting to RELOAD refister.

Parameters
baseCDOG peripheral base address
checkexpected (stop) value

brief Checks secure counter.

This function compares stop value with secure counter value by writting to RELOAD refister.

param base CDOG peripheral base address param check expected (stop) value.

◆ CDOG_Deinit()

void CDOG_Deinit ( CDOG_Type base)

Deinitialize CDOG.

This function deinitializes CDOG secure counter.

Parameters
baseCDOG peripheral base address

brief Deinitialize CDOG

This function stops CDOG secure counter.

param base CDOG peripheral base address

◆ CDOG_GetDefaultConfig()

void CDOG_GetDefaultConfig ( cdog_config_t conf)

Sets the default configuration of CDOG.

This function initialize CDOG config structure to default values.

Parameters
confCDOG configuration structure

brief Sets the default configuration of CDOG

This function initialize CDOG config structure to default values.

param conf CDOG configuration structure

◆ CDOG_Init()

status_t CDOG_Init ( CDOG_Type base,
cdog_config_t conf 
)

Initialize CDOG.

This function initializes CDOG block and setting.

Parameters
baseCDOG peripheral base address
confCDOG configuration structure
Returns
Status of the init operation

brief Initialize CDOG

This function initializes CDOG block and setting.

param base CDOG peripheral base address param conf CDOG configuration structure return Status of the init operation

◆ CDOG_ReadPersistent()

uint32_t CDOG_ReadPersistent ( CDOG_Type base)

Get the CDOG persistent word.

Parameters
baseCDOG peripheral base address.
Returns
The persistent word.

brief Get the CDOG persistent word.

param base CDOG peripheral base address. return The persistent word.

◆ CDOG_Set()

void CDOG_Set ( CDOG_Type base,
uint32_t  stop,
uint32_t  reload,
uint32_t  start 
)

Sets secure counter and instruction timer values.

This function sets value in STOP, RELOAD and START registers for instruction timer and secure counter.

Parameters
baseCDOG peripheral base address
stopexpected value which will be compared with value of secure counter
reloadreload value for instruction timer
startstart value for secure timer

brief Sets secure counter and instruction timer values

This function sets value in STOP, RELOAD and START registers for instruction timer and secure counter.

param base CDOG peripheral base address param stop expected value which will be compared with value of secure counter param reload reload value for instruction timer param start start value for secure timer

◆ CDOG_Start()

void CDOG_Start ( CDOG_Type base,
uint32_t  reload,
uint32_t  start 
)

Sets secure counter and instruction timer values.

This function sets value in RELOAD and START registers for instruction timer and secure counter

Parameters
baseCDOG peripheral base address
reloadreload value
startstart value

brief Sets secure counter and instruction timer values

This function sets value in RELOAD and START registers for instruction timer.

param base CDOG peripheral base address param reload reload value param start start value

◆ CDOG_Stop()

void CDOG_Stop ( CDOG_Type base,
uint32_t  stop 
)

Stops secure counter and instruction timer.

This function stops instruction timer and secure counter. This also change state od CDOG to IDLE.

Parameters
baseCDOG peripheral base address
stopexpected value which will be compared with value of secure counter

brief Stops secure counter and instruction timer

This function stops instruction timer and secure counter. This also change state of CDOG to IDLE.

param base CDOG peripheral base address param stop expected value which will be compared with value of secure counter

◆ CDOG_Sub()

void CDOG_Sub ( CDOG_Type base,
uint32_t  sub 
)

brief Substract value to secure counter

This function substract specified value to secure counter.

param base CDOG peripheral base address. param sub Value to be substracted.

◆ CDOG_Sub1()

void CDOG_Sub1 ( CDOG_Type base)

Substract 1 from secure counter.

This function substract specified 1 from secure counter.

Parameters
baseCDOG peripheral base address.

brief Substract 1 from secure counter

This function substract specified 1 from secure counter.

param base CDOG peripheral base address.

◆ CDOG_Sub16()

void CDOG_Sub16 ( CDOG_Type base)

Substract 16 from secure counter.

This function substract specified 16 from secure counter.

Parameters
baseCDOG peripheral base address.

brief Substract 16 from secure counter

This function substract specified 16 from secure counter.

param base CDOG peripheral base address.

◆ CDOG_Sub256()

void CDOG_Sub256 ( CDOG_Type base)

Substract 256 from secure counter.

This function substract specified 256 from secure counter.

Parameters
baseCDOG peripheral base address.

brief Substract 256 from secure counter

This function substract specified 256 from secure counter.

param base CDOG peripheral base address.

◆ CDOG_WritePersistent()

void CDOG_WritePersistent ( CDOG_Type base,
uint32_t  value 
)

Set the CDOG persistent word.

Parameters
baseCDOG peripheral base address.
valueThe value to be written.

brief Set the CDOG persistent word.

param base CDOG peripheral base address. param value The value to be written.