MCUXpresso SDK API Reference Manual  Rev 2.16.000
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
EVTG: Event Generator Driver

Overview

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.

Modules

 EVTG 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 EVTG driver version is 2.0.0.
 

Data Structures

struct  _evtg_aoi_outfilter_config
 The structure for configuring an AOI output filter sample. More...
 
struct  _evtg_aoi_product_term_config
 The structure for configuring an AOI product term. More...
 
struct  _evtg_aoi_config
 EVTG AOI configuration structure. More...
 
struct  _evtg_config
 EVTG configuration covering all configurable fields. More...
 

Typedefs

typedef enum _evtg_index evtg_index_t
 EVTG instance index. More...
 
typedef enum _evtg_input_index evtg_input_index_t
 EVTG input index. More...
 
typedef enum _evtg_aoi_index evtg_aoi_index_t
 EVTG AOI index. More...
 
typedef enum _evtg_aoi_product_term evtg_aoi_product_term_t
 EVTG AOI product term index. More...
 
typedef enum _evtg_aoi_input_config evtg_aoi_input_config_t
 EVTG input configuration. More...
 
typedef enum
_evtg_aoi_outfilter_count 
evtg_aoi_outfilter_count_t
 EVTG AOI Output Filter Sample Count. More...
 
typedef enum
_evtg_outfdbk_override_input 
evtg_outfdbk_override_input_t
 EVTG output feedback override control mode. More...
 
typedef enum _evtg_flipflop_mode evtg_flipflop_mode_t
 EVTG flip flop mode configuration. More...
 
typedef enum
_evtg_flipflop_initoutput 
evtg_flipflop_init_output_t
 EVTG flip-flop initial value. More...
 
typedef struct
_evtg_aoi_outfilter_config 
evtg_aoi_outfilter_config_t
 The structure for configuring an AOI output filter sample. More...
 
typedef struct
_evtg_aoi_product_term_config 
evtg_aoi_product_term_config_t
 The structure for configuring an AOI product term. More...
 
typedef struct _evtg_aoi_config evtg_aoi_config_t
 EVTG AOI configuration structure. More...
 
typedef struct _evtg_config evtg_config_t
 EVTG configuration covering all configurable fields. More...
 

Enumerations

enum  _evtg_index {
  kEVTG_Index0 = 0U,
  kEVTG_Index1 = 1U,
  kEVTG_Index2 = 2U,
  kEVTG_Index3 = 3U
}
 EVTG instance index. More...
 
enum  _evtg_input_index {
  kEVTG_InputA = 0U,
  kEVTG_InputB = 1U,
  kEVTG_InputC = 2U,
  kEVTG_InputD = 3U
}
 EVTG input index. More...
 
enum  _evtg_aoi_index {
  kEVTG_AOI0 = 0U,
  kEVTG_AOI1 = 1U
}
 EVTG AOI index. More...
 
enum  _evtg_aoi_product_term {
  kEVTG_ProductTerm0 = 0U,
  kEVTG_ProductTerm1 = 1U,
  kEVTG_ProductTerm2 = 2U,
  kEVTG_ProductTerm3 = 3U
}
 EVTG AOI product term index. More...
 
enum  _evtg_aoi_input_config {
  kEVTG_Input_LogicZero = 0U,
  kEVTG_Input_DirectPass = 1U,
  kEVTG_Input_Complement = 2U,
  kEVTG_Input_LogicOne = 3U
}
 EVTG input configuration. More...
 
enum  _evtg_aoi_outfilter_count {
  kEVTG_AOIOutFilter_SampleCount3 = 0U,
  kEVTG_AOIOutFilter_SampleCount4 = 1U,
  kEVTG_AOIOutFilter_SampleCount5 = 2U,
  kEVTG_AOIOutFilter_SampleCount6 = 3U,
  kEVTG_AOIOutFilter_SampleCount7 = 4U,
  kEVTG_AOIOutFilter_SampleCount8 = 5U,
  kEVTG_AOIOutFilter_SampleCount9 = 6U,
  kEVTG_AOIOutFilter_SampleCount10 = 7U
}
 EVTG AOI Output Filter Sample Count. More...
 
enum  _evtg_outfdbk_override_input {
  kEVTG_Output_OverrideInputA = 0U,
  kEVTG_Output_OverrideInputB = 1U,
  kEVTG_Output_OverrideInputC = 2U,
  kEVTG_Output_OverrideInputD = 3U
}
 EVTG output feedback override control mode. More...
 
enum  _evtg_flipflop_mode {
  kEVTG_FFMode_Bypass = 0U,
  kEVTG_FFMode_RSTrigger = 1U,
  kEVTG_FFMode_TFF = 2U,
  kEVTG_FFMode_DFF = 3U,
  kEVTG_FFMode_JKFF = 4U,
  kEVTG_FFMode_Latch = 5U
}
 EVTG flip flop mode configuration. More...
 
enum  _evtg_flipflop_initoutput {
  kEVTG_FF_InitOut0 = 0U,
  kEVTG_FF_InitOut1 = 1U
}
 EVTG flip-flop initial value. More...
 

Driver version

#define FSL_EVTG_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))
 EVTG driver version. More...
 

Initialization Interfaces

void EVTG_Init (EVTG_Type *base, evtg_index_t eEvtgIndex, evtg_config_t *psConfig)
 Initialize EVTG with a user configuration structure. More...
 
static void EVTG_GetDefaultConfig (evtg_config_t *psConfig, evtg_flipflop_mode_t eFlipflopMode)
 Loads default values to the EVTG configuration structure. More...
 

Force Init Flipflop Interfaces

static void EVTG_ForceFlipflopInitOutput (EVTG_Type *base, evtg_index_t eEvtgIndex, evtg_flipflop_init_output_t eFlipflopInitOutputValue)
 Force Flip-flop initial output value to be presented on flip-flop positive output. More...
 

Input Interfaces

static void EVTG_SetProductTermInput (EVTG_Type *base, evtg_index_t eEvtgIndex, evtg_aoi_index_t eAOIIndex, evtg_aoi_product_term_t eProductTerm, evtg_input_index_t eInputIndex, evtg_aoi_input_config_t eInput)
 Configure each input value of AOI product term. More...
 
void EVTG_ConfigAOIProductTerm (EVTG_Type *base, evtg_index_t eEvtgIndex, evtg_aoi_index_t eAOIIndex, evtg_aoi_product_term_t eProductTerm, evtg_aoi_product_term_config_t *psProductTermConfig)
 Configure AOI product term by initializing the product term configuration structure. More...
 

Data Structure Documentation

struct _evtg_aoi_outfilter_config

AOI output filter sample count represent the number of consecutive samples that must agree prior to the AOI output filter accepting an transition. AOI output filter sample period represent the sampling period (in IP bus clock cycles) of the AOI output signals. Each AOI output is sampled multiple times at the rate specified by this period.

For the modes with Filter function enabled, filter delay is "(FILT_CNT + 3) x FILT_PER + 2".

Data Fields

evtg_aoi_outfilter_count_t eSampleCount
 EVTG AOI output filter sample count. More...
 
uint8_t u8SamplePeriod
 EVTG AOI output filter sample period, within 0~255. More...
 

Field Documentation

evtg_aoi_outfilter_count_t _evtg_aoi_outfilter_config::eSampleCount
uint8_t _evtg_aoi_outfilter_config::u8SamplePeriod

If sample period value is 0x00 (default), then the input filter is bypassed.

struct _evtg_aoi_product_term_config

Data Fields

evtg_aoi_input_config_t eAInput: 2
 Input A configuration. More...
 
evtg_aoi_input_config_t eBInput: 2
 Input B configuration. More...
 
evtg_aoi_input_config_t eCInput: 2
 Input C configuration. More...
 
evtg_aoi_input_config_t eDInput: 2
 Input D configuration. More...
 

Field Documentation

evtg_aoi_input_config_t _evtg_aoi_product_term_config::eAInput
evtg_aoi_input_config_t _evtg_aoi_product_term_config::eBInput
evtg_aoi_input_config_t _evtg_aoi_product_term_config::eCInput
evtg_aoi_input_config_t _evtg_aoi_product_term_config::eDInput
struct _evtg_aoi_config

Data Fields

evtg_aoi_outfilter_config_t sAOIOutFilterConfig
 EVTG AOI output filter sample configuration structure. More...
 
evtg_aoi_product_term_config_t sProductTerm0
 Configure AOI product term0. More...
 
evtg_aoi_product_term_config_t sProductTerm1
 Configure AOI product term1. More...
 
evtg_aoi_product_term_config_t sProductTerm2
 Configure AOI product term2. More...
 
evtg_aoi_product_term_config_t sProductTerm3
 Configure AOI product term3. More...
 

Field Documentation

evtg_aoi_outfilter_config_t _evtg_aoi_config::sAOIOutFilterConfig
evtg_aoi_product_term_config_t _evtg_aoi_config::sProductTerm0
evtg_aoi_product_term_config_t _evtg_aoi_config::sProductTerm1
evtg_aoi_product_term_config_t _evtg_aoi_config::sProductTerm2
evtg_aoi_product_term_config_t _evtg_aoi_config::sProductTerm3
struct _evtg_config

Data Fields

bool bEnableInputASync: 1
 Enable/Disable EVTG A input synchronous with bus clk. More...
 
bool bEnableInputBSync: 1
 Enable/Disable EVTG B input synchronous with bus clk. More...
 
bool bEnableInputCSync: 1
 Enable/Disable EVTG C input synchronous with bus clk. More...
 
bool bEnableInputDSync: 1
 Enable/Disable EVTG D input synchronous with bus clk. More...
 
evtg_outfdbk_override_input_t eOutfdbkOverideinput: 2
 EVTG output feedback to EVTG input and replace one of the four inputs. More...
 
evtg_flipflop_mode_t eFlipflopMode: 3
 Flip-Flop can be configured as one of Bypass mode, RS trigger mode, T-FF mode, D-FF mode, JK-FF mode, Latch mode. More...
 
bool bEnableFlipflopInitOutput: 1
 Flip-flop initial output value enable/disable. More...
 
evtg_flipflop_init_output_t eFlipflopInitOutputValue: 1
 Flip-flop initial output value configuration. More...
 
evtg_aoi_config_t sAOI0Config
 Configure EVTG AOI0. More...
 
evtg_aoi_config_t sAOI1Config
 Configure EVTG AOI1. More...
 

Field Documentation

bool _evtg_config::bEnableInputASync
bool _evtg_config::bEnableInputBSync
bool _evtg_config::bEnableInputCSync
bool _evtg_config::bEnableInputDSync
evtg_outfdbk_override_input_t _evtg_config::eOutfdbkOverideinput
evtg_flipflop_mode_t _evtg_config::eFlipflopMode
bool _evtg_config::bEnableFlipflopInitOutput
evtg_flipflop_init_output_t _evtg_config::eFlipflopInitOutputValue
evtg_aoi_config_t _evtg_config::sAOI0Config
evtg_aoi_config_t _evtg_config::sAOI1Config

Macro Definition Documentation

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

Typedef Documentation

typedef enum _evtg_index evtg_index_t

When FF is configured as JK-FF mode, need EVTG_OUTA feedback to EVTG input and replace one of the four inputs.

AOI output filter sample count represent the number of consecutive samples that must agree prior to the AOI output filter accepting an transition. AOI output filter sample period represent the sampling period (in IP bus clock cycles) of the AOI output signals. Each AOI output is sampled multiple times at the rate specified by this period.

For the modes with Filter function enabled, filter delay is "(FILT_CNT + 3) x FILT_PER + 2".

typedef struct _evtg_config evtg_config_t

Enumeration Type Documentation

Enumerator
kEVTG_Index0 

EVTG instance index 0.

kEVTG_Index1 

EVTG instance index 1.

kEVTG_Index2 

EVTG instance index 2.

kEVTG_Index3 

EVTG instance index 3.

Enumerator
kEVTG_InputA 

EVTG input A.

kEVTG_InputB 

EVTG input B.

kEVTG_InputC 

EVTG input C.

kEVTG_InputD 

EVTG input D.

Enumerator
kEVTG_AOI0 

EVTG AOI index 0.

kEVTG_AOI1 

EVTG AOI index 1.

Enumerator
kEVTG_ProductTerm0 

EVTG AOI product term index 0.

kEVTG_ProductTerm1 

EVTG AOI product term index 1.

kEVTG_ProductTerm2 

EVTG AOI product term index 2.

kEVTG_ProductTerm3 

EVTG AOI product term index 3.

Enumerator
kEVTG_Input_LogicZero 

Force input in product term to a logical zero.

kEVTG_Input_DirectPass 

Pass input in product term.

kEVTG_Input_Complement 

Complement input in product term.

kEVTG_Input_LogicOne 

Force input in product term to a logical one.

Enumerator
kEVTG_AOIOutFilter_SampleCount3 

EVTG AOI output filter sample count is 3.

kEVTG_AOIOutFilter_SampleCount4 

EVTG AOI output filter sample count is 4.

kEVTG_AOIOutFilter_SampleCount5 

EVTG AOI output filter sample count is 5.

kEVTG_AOIOutFilter_SampleCount6 

EVTG AOI output filter sample count is 6.

kEVTG_AOIOutFilter_SampleCount7 

EVTG AOI output filter sample count is 7.

kEVTG_AOIOutFilter_SampleCount8 

EVTG AOI output filter sample count is 8.

kEVTG_AOIOutFilter_SampleCount9 

EVTG AOI output filter sample count is 9.

kEVTG_AOIOutFilter_SampleCount10 

EVTG AOI output filter sample count is 10.

When FF is configured as JK-FF mode, need EVTG_OUTA feedback to EVTG input and replace one of the four inputs.

Enumerator
kEVTG_Output_OverrideInputA 

Replace input A.

kEVTG_Output_OverrideInputB 

Replace input B.

kEVTG_Output_OverrideInputC 

Replace input C.

kEVTG_Output_OverrideInputD 

Replace input D.

Enumerator
kEVTG_FFMode_Bypass 

Bypass mode (default).In this mode, user can choose to enable or disable input sync logic and filter function.

kEVTG_FFMode_RSTrigger 

RS trigger mode.

In this mode, user can choose to enable or disable input sync logic and filter function.

kEVTG_FFMode_TFF 

T-FF mode.

In this mode, input sync or filter has to be enabled to remove the possible glitch.

kEVTG_FFMode_DFF 

D-FF mode.

In this mode, input sync or filter has to be enabled to remove the possible glitch.

kEVTG_FFMode_JKFF 

JK-FF mode.

In this mode, input sync or filter has to be enabled to remove the possible glitch.

kEVTG_FFMode_Latch 

Latch mode.

In this mode, input sync or filter has to be enabled to remove the possible glitch.

Enumerator
kEVTG_FF_InitOut0 

Configure the positive output of flip-flop as 0.

kEVTG_FF_InitOut1 

Configure the positive output of flip-flop as 1.

Function Documentation

void EVTG_Init ( EVTG_Type *  base,
evtg_index_t  eEvtgIndex,
evtg_config_t psConfig 
)
Parameters
baseEVTG base address.
eEvtgIndexEVTG instance index.
psConfigEVTG initial configuration structure pointer.
static void EVTG_GetDefaultConfig ( evtg_config_t psConfig,
evtg_flipflop_mode_t  eFlipflopMode 
)
inlinestatic

The purpose of this API is to initialize the configuration structure to default value for EVTG_Init() to use. The Flip-Flop can be configured as Bypass mode, RS trigger mode, T-FF mode, D-FF mode, JK-FF mode, Latch mode. Please check RM INTC chapter for more details.

Parameters
psConfigEVTG initial configuration structure pointer.
eFlipflopModeEVTG flip flop mode. see @ ref _evtg_flipflop_mode
static void EVTG_ForceFlipflopInitOutput ( EVTG_Type *  base,
evtg_index_t  eEvtgIndex,
evtg_flipflop_init_output_t  eFlipflopInitOutputValue 
)
inlinestatic
Parameters
baseEVTG base address.
eEvtgIndexEVTG instance index.
eFlipflopInitOutputValueEVTG flip-flop initial output control. see evtg_flipflop_init_output_t
static void EVTG_SetProductTermInput ( EVTG_Type *  base,
evtg_index_t  eEvtgIndex,
evtg_aoi_index_t  eAOIIndex,
evtg_aoi_product_term_t  eProductTerm,
evtg_input_index_t  eInputIndex,
evtg_aoi_input_config_t  eInput 
)
inlinestatic

Each selected input term in each product term can be configured to produce a logical 0 or 1 or pass the true or complement of the selected event input. Adapt to some simple aoi expressions.

Parameters
baseEVTG base address.
eEvtgIndexEVTG instance index.
eAOIIndexEVTG AOI index. see enum ref evtg_aoi_index_t
eProductTermEVTG product term index.
eInputIndexEVTG input index.
eInputEVTG input configuration with enum evtg_aoi_input_config_t.
void EVTG_ConfigAOIProductTerm ( EVTG_Type *  base,
evtg_index_t  eEvtgIndex,
evtg_aoi_index_t  eAOIIndex,
evtg_aoi_product_term_t  eProductTerm,
evtg_aoi_product_term_config_t psProductTermConfig 
)
Parameters
baseEVTG base address.
eEvtgIndexEVTG instance index.
eAOIIndexEVTG AOI index. see enum evtg_aoi_index_t
eProductTermEVTG AOI product term index.
psProductTermConfigPointer to EVTG product term configuration structure. see ref _evtg_aoi_product_term_config