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

Read Guidance

This document consists of sections titled with Driver Overview, Data Structures, Enumerations, Functions, etc., each with an overview list and detailed documentation. It is recommended to read the Driver Overview first for it includes a comprehensive description of the peripheral, driver and driver changes. Other sections give detailed information for APIs, enums, macros, etc., for your further reference.

Driver Overview

 EWM Peripheral and Driver Overview
 Content including 1) peripheral features, work logic and work method; 2) driver design logic and use method; 3) typical use case.
 
 The Driver Change Log
 The current EWM driver version is 2.0.0.
 

Data Structures

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

Enumerations

enum  ewm_input_assert_state_t {
  kEWM_EwmInZeroAssert = 0U,
  kEWM_EwmInOneAssert = 1U
}
 

Driver version

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

EWM initialization and de-initialization

void EWM_Init (EWM_Type *base, const ewm_config_t *psConfig)
 Initializes the EWM peripheral. More...
 
void EWM_Deinit (EWM_Type *base)
 Deinitializes the EWM peripheral. More...
 
void EWM_GetDefaultConfig (ewm_config_t *psConfig)
 Initializes the EWM configuration structure. More...
 

EWM functional Operation

static void EWM_EnableInterrupt (EWM_Type *base)
 Enables the EWM interrupt. More...
 
static void EWM_DisableInterrupt (EWM_Type *base)
 Disables the EWM interrupt. More...
 
void EWM_Refresh (EWM_Type *base)
 Services the EWM. More...
 

Data Structure Documentation

struct ewm_config_t

This structure is used to configure the EWM.

Data Fields

uint8_t bEnableEWM: 1
 Enable EWM module.
 
uint8_t bEnableEWMInput: 1
 Enable EWM_in input.
 
uint8_t bEnableInterrupt: 1
 Enable EWM interrupt.
 
ewm_input_assert_state_t eInputAssertState: 1
 EWM_in signal assertion state select.
 
ewm_lpo_clock_source_t eClockSource: 2
 Clock source select.
 
uint8_t u8ClockDivder
 EWM counter clock is clockSource/(clockDivder+1)
 
uint8_t u8CompareLowValue
 Compare low-register value.
 
uint8_t u8CompareHighValue
 Compare high-register value, maximum setting is 0xFE.
 

Enumeration Type Documentation

Enumerator
kEWM_EwmInZeroAssert 

EWM-in assert with low-voltage logic.

kEWM_EwmInOneAssert 

EWM-in assert with high-voltage logic.

Function Documentation

void EWM_Init ( EWM_Type *  base,
const ewm_config_t psConfig 
)

This function is used to initialize the EWM. After calling, the EWM runs immediately according to the configuration.

Note
Except for the interrupt enable control bit, other control bits and registers are write once after a CPU reset. Modifying them more than once generates a bus transfer error.

This is an example.

* ewm_config_t psConfig;
* EWM_GetDefaultConfig(&psConfig);
* psConfig.compareHighValue = 0xAAU;
* EWM_Init(ewm_base,&psConfig);
*
Parameters
baseEWM peripheral base address
psConfigThe configuration of the EWM
void EWM_Deinit ( EWM_Type *  base)

This function is used to shut down the EWM.

Parameters
baseEWM peripheral base address
void EWM_GetDefaultConfig ( ewm_config_t psConfig)

This function initializes the EWM configuration structure to default values. The default values are as follows.

* ewmConfig->bEnableEWM = true;
* ewmConfig->bEnableEWMInput = false;
* ewmConfig->eInputAssertState = kEWM_EwmInZeroAssert;
* ewmConfig->bEnableInterrupt = false;
* ewmConfig->eClockSource = kEWM_LpoClockSource0;
* ewmConfig->u8ClockDivder = 0;
* ewmConfig->u8CompareLowValue = 0;
* ewmConfig->u8CompareHighValue = 0xFEU;
*
Parameters
psConfigPointer to the EWM configuration structure.
See Also
ewm_config_t
static void EWM_EnableInterrupt ( EWM_Type *  base)
inlinestatic

This function enables the EWM interrupt.

Parameters
baseEWM peripheral base address
static void EWM_DisableInterrupt ( EWM_Type *  base)
inlinestatic

This function disables the EWM interrupt.

Parameters
baseEWM peripheral base address
void EWM_Refresh ( EWM_Type *  base)

This function resets the EWM counter to zero.

Parameters
baseEWM peripheral base address