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

Overview

The MCUXpresso SDK provides a peripheral driver for the Computer Operating Properly module (COP) of MCUXpresso SDK devices.

Typical use case

Data Structures

struct  cop_config_t
 Describes COP configuration structure. More...
 

Enumerations

enum  cop_clock_source_t {
  kCOP_LpoClock = 0U,
  kCOP_McgIrClock = 1U,
  kCOP_OscErClock = 2U,
  kCOP_BusClock = 3U
}
 COP clock source selection. More...
 
enum  cop_timeout_cycles_t {
  kCOP_2Power5CyclesOr2Power13Cycles = 1U,
  kCOP_2Power8CyclesOr2Power16Cycles = 2U,
  kCOP_2Power10CyclesOr2Power18Cycles = 3U
}
 Define the COP timeout cycles. More...
 
enum  cop_timeout_mode_t {
  kCOP_ShortTimeoutMode = 0U,
  kCOP_LongTimeoutMode = 1U
}
 Define the COP timeout mode. More...
 

Driver version

#define FSL_COP_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))
 COP driver version 2.0.0. More...
 

COP refresh sequence.

#define COP_FIRST_BYTE_OF_REFRESH   (0x55U)
 First byte of refresh sequence.
 
#define COP_SECOND_BYTE_OF_REFRESH   (0xAAU)
 Second byte of refresh sequence.
 

COP Functional Operation

void COP_GetDefaultConfig (cop_config_t *config)
 Initializes the COP configuration structure. More...
 
void COP_Init (SIM_Type *base, const cop_config_t *config)
 Initializes the COP module. More...
 
static void COP_Disable (SIM_Type *base)
 De-initializes the COP module. More...
 
void COP_Refresh (SIM_Type *base)
 Refreshes the COP timer. More...
 

Data Structure Documentation

struct cop_config_t

Data Fields

bool enableWindowMode
 COP run mode: window mode or normal mode.
 
cop_timeout_mode_t timeoutMode
 COP timeout mode: long timeout or short timeout.
 
bool enableStop
 Enable or disable COP in STOP mode.
 
bool enableDebug
 Enable or disable COP in DEBUG mode.
 
cop_clock_source_t clockSource
 Set COP clock source.
 
cop_timeout_cycles_t timeoutCycles
 Set COP timeout value.
 

Macro Definition Documentation

#define FSL_COP_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))

Enumeration Type Documentation

Enumerator
kCOP_LpoClock 

COP clock sourced from LPO.

kCOP_McgIrClock 

COP clock sourced from MCGIRCLK.

kCOP_OscErClock 

COP clock sourced from OSCERCLK.

kCOP_BusClock 

COP clock sourced from Bus clock.

Enumerator
kCOP_2Power5CyclesOr2Power13Cycles 

2^5 or 2^13 clock cycles

kCOP_2Power8CyclesOr2Power16Cycles 

2^8 or 2^16 clock cycles

kCOP_2Power10CyclesOr2Power18Cycles 

2^10 or 2^18 clock cycles

Enumerator
kCOP_ShortTimeoutMode 

COP selects long timeout.

kCOP_LongTimeoutMode 

COP selects short timeout.

Function Documentation

void COP_GetDefaultConfig ( cop_config_t config)

This function initializes the COP configuration structure to default values. The default values are:

* copConfig->enableWindowMode = false;
* copConfig->timeoutMode = kCOP_LongTimeoutMode;
* copConfig->enableStop = false;
* copConfig->enableDebug = false;
* copConfig->clockSource = kCOP_LpoClock;
* copConfig->timeoutCycles = kCOP_2Power10CyclesOr2Power18Cycles;
*
Parameters
configPointer to the COP configuration structure.
See Also
cop_config_t
void COP_Init ( SIM_Type *  base,
const cop_config_t config 
)

This function configures the COP. After it is called, the COP starts running according to the configuration. Because all COP control registers are write-once only, the COP_Init function and the COP_Disable function can be called only once. A second call has no effect.

Example:

* cop_config_t config;
* COP_Init(sim_base,&config);
*
Parameters
baseSIM peripheral base address.
configThe configuration of COP.
static void COP_Disable ( SIM_Type *  base)
inlinestatic

This dedicated function is not provided. Instead, the COP_Disable function can be used to disable the COP.

Disables the COP module.

This function disables the COP Watchdog. Note: The COP configuration register is a write-once after reset. To disable the COP Watchdog, call this function first.

Parameters
baseSIM peripheral base address.
void COP_Refresh ( SIM_Type *  base)

This function feeds the COP.

Parameters
baseSIM peripheral base address.