MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Cwt

Overview

Files

file  fsl_cwt.h
 

Driver version

#define FSL_CWT_DRIVER_VERSION   (MAKE_VERSION(2, 0, 1))
 Defines CWT driver version 2.0.1. More...
 

CWT Functional Operation

status_t CWT_Init (CDOG_Type *base, cwt_config_t *conf)
 Initialize CWT. More...
 
void CWT_Deinit (CDOG_Type *base)
 Deinitialize CWT. More...
 
void CWT_GetDefaultConfig (cwt_config_t *conf)
 Sets the default configuration of CWT. More...
 
void CWT_Stop (CDOG_Type *base, uint32_t stop)
 Stops secure counter and instruction timer. More...
 
void CWT_Start (CDOG_Type *base, uint32_t reload, uint32_t start)
 Sets secure counter and instruction timer values. More...
 
void CWT_Check (CDOG_Type *base, uint32_t check)
 Checks secure counter. More...
 
void CWT_Set (CDOG_Type *base, uint32_t stop, uint32_t reload, uint32_t start)
 Sets secure counter and instruction timer values. More...
 
void CWT_Add (CDOG_Type *base, uint32_t add)
 Add value to secure counter. More...
 
void CWT_Add1 (CDOG_Type *base)
 Add 1 to secure counter. More...
 
void CWT_Add16 (CDOG_Type *base)
 Add 16 to secure counter. More...
 
void CWT_Add256 (CDOG_Type *base)
 Add 256 to secure counter. More...
 
void CWT_Sub (CDOG_Type *base, uint32_t sub)
 brief Substract value to secure counter More...
 
void CWT_Sub1 (CDOG_Type *base)
 Substract 1 from secure counter. More...
 
void CWT_Sub16 (CDOG_Type *base)
 Substract 16 from secure counter. More...
 
void CWT_Sub256 (CDOG_Type *base)
 Substract 256 from secure counter. More...
 
void CWT_WritePersistent (CDOG_Type *base, uint32_t value)
 Set the CWT persistent word. More...
 
uint32_t CWT_ReadPersistent (CDOG_Type *base)
 Get the CWT persistent word. More...
 

Macro Definition Documentation

#define FSL_CWT_DRIVER_VERSION   (MAKE_VERSION(2, 0, 1))

Change log:

  • Version 2.0.1
    • Fix doxygen issues
  • Version 2.0.0
    • initial version

Function Documentation

status_t CWT_Init ( CDOG_Type *  base,
cwt_config_t *  conf 
)

This function initializes CWT block and setting.

Parameters
baseCWT peripheral base address
confCWT configuration structure
Returns
Status of the init operation
void CWT_Deinit ( CDOG_Type *  base)

This function deinitializes CWT secure counter.

Parameters
baseCWT peripheral base address
void CWT_GetDefaultConfig ( cwt_config_t *  conf)

This function initialize CWT config structure to default values.

Parameters
confCWT configuration structure
void CWT_Stop ( CDOG_Type *  base,
uint32_t  stop 
)

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

Parameters
baseCWT peripheral base address
stopexpected value which will be compared with value of secure counter
void CWT_Start ( CDOG_Type *  base,
uint32_t  reload,
uint32_t  start 
)

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

Parameters
baseCWT peripheral base address
reloadreload value
startstart value
void CWT_Check ( CDOG_Type *  base,
uint32_t  check 
)

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

Parameters
baseCWT peripheral base address
checkexpected (stop) value
void CWT_Set ( CDOG_Type *  base,
uint32_t  stop,
uint32_t  reload,
uint32_t  start 
)

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

Parameters
baseCWT peripheral base address
stopexpected value which will be compared with value of secure counter
reloadreload value for instruction timer
startstart value for secure timer
void CWT_Add ( CDOG_Type *  base,
uint32_t  add 
)

This function add specified value to secure counter.

Parameters
baseCWT peripheral base address.
addValue to be added.
void CWT_Add1 ( CDOG_Type *  base)

This function add 1 to secure counter.

Parameters
baseCWT peripheral base address.
void CWT_Add16 ( CDOG_Type *  base)

This function add 16 to secure counter.

Parameters
baseCWT peripheral base address.
void CWT_Add256 ( CDOG_Type *  base)

This function add 256 to secure counter.

Parameters
baseCWT peripheral base address.
void CWT_Sub ( CDOG_Type *  base,
uint32_t  sub 
)

This function substract specified value to secure counter.

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

void CWT_Sub1 ( CDOG_Type *  base)

This function substract specified 1 from secure counter.

Parameters
baseCWT peripheral base address.
void CWT_Sub16 ( CDOG_Type *  base)

This function substract specified 16 from secure counter.

Parameters
baseCWT peripheral base address.
void CWT_Sub256 ( CDOG_Type *  base)

This function substract specified 256 from secure counter.

Parameters
baseCWT peripheral base address.
void CWT_WritePersistent ( CDOG_Type *  base,
uint32_t  value 
)
Parameters
baseCWT peripheral base address.
valueThe value to be written.
uint32_t CWT_ReadPersistent ( CDOG_Type *  base)
Parameters
baseCWT peripheral base address.
Returns
The persistent word.