Kinetis SDK v.1.3 API Reference Manual  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

Overview

The section describes the programming interface of the COP HAL driver.

Data Structures

struct  cop_config_t
 Data structure to initialize the COP. More...
 

Enumerations

enum  cop_clock_source_t {
  kCopLpoClock,
  kCopBusClock
}
 COP clock source selection. More...
 
enum  cop_timeout_cycles_t {
  kCopTimeout_short_2to5_or_long_2to13 = 1U,
  kCopTimeout_short_2to8_or_long_2to16 = 2U,
  kCopTimeout_short_2to10_or_long_2to18 = 3U
}
 Define the value of the COP timeout cycles. More...
 
enum  cop_status_t {
  kStatus_COP_Success = 0x0U,
  kStatus_COP_Fail = 0x01,
  kStatus_COP_NotInitlialized = 0x2U,
  kStatus_COP_NullArgument = 0x3U
}
 cop status return codes. More...
 

COP HAL.

void COP_HAL_SetConfig (SIM_Type *base, const cop_config_t *configPtr)
 Configures the COP Watchdog. More...
 
static void COP_HAL_Enable (void)
 Enables the COP Watchdog. More...
 
static void COP_HAL_Disable (SIM_Type *base)
 Disables the COP Watchdog. More...
 
static bool COP_HAL_IsEnable (SIM_Type *base)
 Determines whether the COP is enabled. More...
 
static void COP_HAL_Refresh (SIM_Type *base)
 Servicing the COP Watchdog. More...
 
static void COP_HAL_ResetSystem (SIM_Type *base)
 Resets the system. More...
 
void COP_HAL_Init (SIM_Type *base)
 Restores the COP module to the reset value. More...
 

Data Structure Documentation

struct cop_config_t

This structure is used to initialize the COP during the cop_init function call. It contains all COP configurations.

Data Fields

bool copWindowModeEnable
 Set COP watchdog run mode—Window mode or Normal mode.
 
cop_clock_source_t copClockSource
 Set COP watchdog clock source.
 
cop_timeout_cycles_t copTimeout
 Set COP watchdog timeout value.
 

Enumeration Type Documentation

Enumerator
kCopLpoClock 

LPO clock,1K HZ.

kCopBusClock 

BUS clock.

Enumerator
kCopTimeout_short_2to5_or_long_2to13 

2 to 5 clock cycles when clock source is LPO or in short timeout mode otherwise 2 to 13 clock cycles

kCopTimeout_short_2to8_or_long_2to16 

2 to 8 clock cycles when clock source is LPO or in short timeout mode otherwise 2 to 16 clock cycles

kCopTimeout_short_2to10_or_long_2to18 

2 to 10 clock cycles when clock source is LPO or in short timeout mode otherwise 2 to 18 clock cycles

Enumerator
kStatus_COP_Success 

COP operation Succeed.

kStatus_COP_Fail 

COP operation Failed.

kStatus_COP_NotInitlialized 

COP is not initialized yet.

kStatus_COP_NullArgument 

Argument is NULL.

Function Documentation

void COP_HAL_SetConfig ( SIM_Type *  base,
const cop_config_t configPtr 
)

The COP control register is write once after reset.

Parameters
baseThe COP peripheral base address
configPtrconfigure COP control register
static void COP_HAL_Enable ( void  )
inlinestatic

After reset the COP is enabled.

static void COP_HAL_Disable ( SIM_Type *  base)
inlinestatic

This function disables the COP Watchdog and should be called after reset if your application does not need the COP Watchdog.

Parameters
baseThe COP peripheral base address
static bool COP_HAL_IsEnable ( SIM_Type *  base)
inlinestatic

This function checks whether the COP is running.

Parameters
baseThe COP peripheral base address
Returns
State of the module
Return values
trueCOP is enabled
falseCOP is disabled
static void COP_HAL_Refresh ( SIM_Type *  base)
inlinestatic

This function resets the COP timeout by writing 0x55 then 0xAA. Writing any other value generates a system reset. The writing operations should be atomic.

Parameters
baseThe COP peripheral base address
static void COP_HAL_ResetSystem ( SIM_Type *  base)
inlinestatic

This function resets the system.

Parameters
baseThe COP peripheral base address
void COP_HAL_Init ( SIM_Type *  base)

This function restores the COP module to the reset value.

Parameters
baseThe COP peripheral base address