MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
EVTG: Event Generator 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

 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_t
 The structure for configuring an AOI output filter sample. More...
 
struct  evtg_aoi_product_term_config_t
 The structure for configuring an AOI product term. More...
 
struct  evtg_aoi_config_t
 EVTG AOI configuration structure. More...
 
struct  evtg_config_t
 EVTG configuration covering all configurable fields. More...
 

Enumerations

enum  evtg_index_t {
  kEVTG_Index0 = 0U,
  kEVTG_Index1 = 1U,
  kEVTG_Index2 = 2U,
  kEVTG_Index3 = 3U
}
 EVTG instance index. More...
 
enum  evtg_input_index_t {
  kEVTG_InputA = 0U,
  kEVTG_InputB = 1U,
  kEVTG_InputC = 2U,
  kEVTG_InputD = 3U
}
 EVTG input index. More...
 
enum  evtg_aoi_index_t {
  kEVTG_AOI0 = 0U,
  kEVTG_AOI1 = 1U
}
 EVTG AOI index. More...
 
enum  evtg_aoi_product_term_t {
  kEVTG_ProductTerm0 = 0U,
  kEVTG_ProductTerm1 = 1U,
  kEVTG_ProductTerm2 = 2U,
  kEVTG_ProductTerm3 = 3U
}
 EVTG AOI product term index. More...
 
enum  evtg_aoi_input_config_t {
  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_t {
  kEVTG_AOIOutFilter_SampleCount3 = 0,
  kEVTG_AOIOutFilter_SampleCount4 = 1,
  kEVTG_AOIOutFilter_SampleCount5 = 2,
  kEVTG_AOIOutFilter_SampleCount6 = 3,
  kEVTG_AOIOutFilter_SampleCount7 = 4,
  kEVTG_AOIOutFilter_SampleCount8 = 5,
  kEVTG_AOIOutFilter_SampleCount9 = 6,
  kEVTG_AOIOutFilter_SampleCount10 = 7
}
 EVTG AOI Output Filter Sample Count. More...
 
enum  evtg_outfdbk_override_input_t {
  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_t {
  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_init_output_t {
  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 2.0.0. 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_t

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_t::eSampleCount

refer to _evtg_aoi_outfilter_count.

uint8_t evtg_aoi_outfilter_config_t::u8SamplePeriod

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

struct evtg_aoi_product_term_config_t

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_t::eAInput
evtg_aoi_input_config_t evtg_aoi_product_term_config_t::eBInput
evtg_aoi_input_config_t evtg_aoi_product_term_config_t::eCInput
evtg_aoi_input_config_t evtg_aoi_product_term_config_t::eDInput
struct evtg_aoi_config_t

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_t::sAOIOutFilterConfig
evtg_aoi_product_term_config_t evtg_aoi_config_t::sProductTerm0
evtg_aoi_product_term_config_t evtg_aoi_config_t::sProductTerm1
evtg_aoi_product_term_config_t evtg_aoi_config_t::sProductTerm2
evtg_aoi_product_term_config_t evtg_aoi_config_t::sProductTerm3
struct evtg_config_t

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_t::bEnableInputASync
bool evtg_config_t::bEnableInputBSync
bool evtg_config_t::bEnableInputCSync
bool evtg_config_t::bEnableInputDSync
evtg_outfdbk_override_input_t evtg_config_t::eOutfdbkOverideinput
evtg_flipflop_mode_t evtg_config_t::eFlipflopMode
bool evtg_config_t::bEnableFlipflopInitOutput
evtg_flipflop_init_output_t evtg_config_t::eFlipflopInitOutputValue
evtg_aoi_config_t evtg_config_t::sAOI0Config
evtg_aoi_config_t evtg_config_t::sAOI1Config

Macro Definition Documentation

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

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.
eFlipflopInitOutputEVTG flip-flop initial output control. see _evtg_flipflop_initoutput
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
eProductTermEVTG product term index.
eInputIndexEVTG input index.
eInputEVTG input configuration with enum _evtg_aoi_input_config.
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
eProductTermEVTG AOI product term index.
psProductTermConfigPointer to EVTG product term configuration structure. see ref _evtg_aoi_product_term_config