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 EWM HAL driver.

Data Structures

struct  ewm_config_t
 Data structure for EWM initialize. More...
 

Enumerations

enum  ewm_status_t {
  kStatus_EWM_Success = 0x0U,
  kStatus_EWM_Fail = 0x01,
  kStatus_EWM_NotInitlialized = 0x2U,
  kStatus_EWM_NullArgument = 0x3U
}
 ewm status return codes. More...
 

Functions

static void EWM_HAL_Enable (EWM_Type *base)
 Enable the EWM. More...
 
static void EWM_HAL_Disable (EWM_Type *base)
 Disable the EWM. More...
 
static bool EWM_HAL_IsEnable (EWM_Type *base)
 Checks whether the EWM is enabled. More...
 
static void EWM_HAL_SetIntCmd (EWM_Type *base, bool enable)
 Enable/Disable EWM interrupt. More...
 
static void EWM_HAL_SetCmpLowRegValue (EWM_Type *base, uint8_t minServiceCycles)
 Set EWM compare low register value. More...
 
static void EWM_HAL_SetCmpHighRegValue (EWM_Type *base, uint8_t maxServiceCycles)
 Set EWM compare high register value. More...
 
static void EWM_HAL_Refresh (EWM_Type *base)
 Service EWM. More...
 
void EWM_HAL_SetConfig (EWM_Type *base, const ewm_config_t *ewmConfigPtr)
 Config EWM control register. More...
 
void EWM_HAL_Init (EWM_Type *base)
 Restores the EWM module to reset value. More...
 

Data Structure Documentation

struct ewm_config_t

This structure is used when initializing the EWM.

Data Fields

bool ewmEnable
 Enable EWM module.
 
bool ewmInEnable
 Enable EWM_in input enable.
 
bool ewmInAssertLogic
 Set EWM_in signal assertion state.
 
bool intEnable
 Enable EWM interrupt enable.
 
uint8_t ewmCmpLowValue
 Set EWM compare low register value.
 
uint8_t ewmCmpHighValue
 Set EWM compare high register value, the maximum value should be 0xfe otherwise the counter will never expire.
 

Enumeration Type Documentation

Enumerator
kStatus_EWM_Success 

EWM operation Succeed.

kStatus_EWM_Fail 

EWM operation Failed.

kStatus_EWM_NotInitlialized 

EWM is not initialized yet.

kStatus_EWM_NullArgument 

Argument is NULL.

Function Documentation

static void EWM_HAL_Enable ( EWM_Type *  base)
inlinestatic

This function enables the EWM.

Parameters
baseThe EWM peripheral base address
static void EWM_HAL_Disable ( EWM_Type *  base)
inlinestatic

This function disables the EWM.

Parameters
baseThe EWM peripheral base address
static bool EWM_HAL_IsEnable ( EWM_Type *  base)
inlinestatic

This function checks whether the EWM is enabled.

Parameters
baseThe EWM peripheral base address
Returns
State of the module
Return values
falsemeans EWM is disabled
truemeans WODG is enabled
static void EWM_HAL_SetIntCmd ( EWM_Type *  base,
bool  enable 
)
inlinestatic

This function sets EWM enable/disable.

Parameters
baseThe EWM peripheral base address
enableSet EWM interrupt enable/disable
static void EWM_HAL_SetCmpLowRegValue ( EWM_Type *  base,
uint8_t  minServiceCycles 
)
inlinestatic

This function sets EWM compare low register value and defines the minimum cycles to service EWM, when counter value is greater than or equal to ewm compare low register value, refresh EWM can be successful, and this register is write once, one more write will cause bus fault.

Parameters
baseThe EWM peripheral base address
minServiceCyclesThe EWM compare low register value
static void EWM_HAL_SetCmpHighRegValue ( EWM_Type *  base,
uint8_t  maxServiceCycles 
)
inlinestatic

This function sets EWM compare high register value and defines the maximum cycles to service EWM, when counter value is less than or equal to ewm compare high register value, refresh EWM can be successful, the compare high register value must be greater than compare low register value, and this register is write once, one more write will cause bus fault.

Parameters
baseThe EWM peripheral base address
maxServiceCyclesThe EWM compare high register value
static void EWM_HAL_Refresh ( EWM_Type *  base)
inlinestatic

This function reset EWM counter to zero and the period of writing the frist value and the second value should be within 15 bus cycles.

Parameters
baseThe EWM peripheral base address
void EWM_HAL_SetConfig ( EWM_Type *  base,
const ewm_config_t ewmConfigPtr 
)

This function configures EWM control register, EWM enable bitfeild, EWM ASSIN bitfeild and EWM INPUT enable bitfeild are WRITE ONCE, one more write will cause bus fault.

Parameters
baseThe EWM peripheral base address
ewmConfigPtrconfig EWM CTRL register
void EWM_HAL_Init ( EWM_Type *  base)

This function restores the EWM module to reset value.

Parameters
baseThe EWM peripheral base address