PDL for FM4  Version1.2
Peripheral Driverl Library for FM4
mft_wfg.h File Reference
#include "pdl.h"
Include dependency graph for mft_wfg.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  stc_wfg_ctrl_bits
 
struct  stc_mft_wfg_intern_data
 
struct  stc_wfg_nzcl_config
 
struct  stc_dtif_int_sel
 
struct  stc_dtif_int_cb
 
struct  stc_mft_wfg_instance_data
 

Macros

#define stc_mftn_wfg_t   FM4_MFT_WFG_TypeDef
 
#define MFT0_WFG   (*((volatile stc_mftn_wfg_t *) FM4_MFT0_WFG_BASE))
 
#define MFT1_WFG   (*((volatile stc_mftn_wfg_t *) FM4_MFT1_WFG_BASE))
 
#define MFT2_WFG   (*((volatile stc_mftn_wfg_t *) FM4_MFT2_WFG_BASE))
 
#define MFT_WFG_CH0   0
 
#define MFT_WFG_CH1   1
 
#define MFT_WFG_CH2   2
 
#define MFT_WFG_CH3   3
 
#define MFT_WFG_CH4   4
 
#define MFT_WFG_CH5   5
 
#define MFT_WFG_CH10   0
 
#define MFT_WFG_CH32   1
 
#define MFT_WFG_CH54   2
 
#define MFT_WFG_MAXCH   3
 

Typedefs

typedef enum en_wfg_instance_index en_wfg_instance_index_t
 Enumeration to define an index for each WFG instance. More...
 
typedef enum en_mft_wfg_mode en_mft_wfg_mode_t
 
typedef enum en_gten_bits en_gten_bits_t
 
typedef enum en_psel_bits en_psel_bits_t
 
typedef enum en_pgen_bits en_pgen_bits_t
 
typedef enum en_dmod_bit en_dmod_bit_t
 
typedef struct stc_wfg_ctrl_bits stc_wfg_ctrl_bits
 
typedef enum en_wfg_timer_clock en_wfg_timer_clock_t
 
typedef struct
stc_mft_wfg_intern_data 
stc_mft_wfg_intern_data_t
 
typedef enum en_nzcl_filter_width en_nzcl_filter_width_t
 
typedef struct stc_wfg_nzcl_config stc_wfg_nzcl_config_t
 
typedef struct stc_dtif_int_sel stc_dtif_int_sel_t
 
typedef struct stc_dtif_int_cb stc_dtif_int_cb_t
 
typedef struct
stc_mft_wfg_instance_data 
stc_mft_wfg_instance_data_t
 

Enumerations

enum  en_wfg_instance_index {
  WfgInstanceIndexWfg0 = 0,
  WfgInstanceIndexWfg1,
  WfgInstanceIndexWfg2
}
 Enumeration to define an index for each WFG instance. More...
 
enum  en_mft_wfg_mode {
  WfgThroughMode = 0,
  WfgRtPpgMode = 1,
  WfgTimerPpgMode = 2,
  WfgRtDeadTimerMode = 4,
  WfgRtDeadTimerFilterMode = 5,
  WfgPpgDeadTimerFilterMode = 6,
  WfgPpgDeadTimerMode = 7
}
 
enum  en_gten_bits {
  GtenBits00B = 0,
  GtenBits01B,
  GtenBits10B,
  GtenBits11B
}
 
enum  en_psel_bits {
  PselBits00B = 0,
  PselBits01B,
  PselBits10B,
  PselBits11B
}
 
enum  en_pgen_bits {
  PgenBits00B = 0,
  PgenBits01B,
  PgenBits10B,
  PgenBits11B
}
 
enum  en_dmod_bit {
  DmodBit0B = 0,
  DmodBit1B
}
 
enum  en_wfg_timer_clock {
  WfgPlckDiv1 = 0,
  WfgPlckDiv2,
  WfgPlckDiv4,
  WfgPlckDiv8,
  WfgPlckDiv16,
  WfgPlckDiv32,
  WfgPlckDiv64,
  WfgPlckDiv128
}
 
enum  en_nzcl_filter_width {
  NzlcNoFilter,
  NzlcWidth4Cycle,
  NzlcWidth8Cycle,
  NzlcWidth16Cycle,
  NzlcWidth32Cycle,
  NzlcWidth64Cycle,
  NzlcWidth128Cycle
}
 

Functions

en_result_t Mft_Wfg_ConfigMode (volatile FM4_MFT_WFG_TypeDef *pstcMft, uint8_t u8CoupleCh, en_mft_wfg_mode_t enMode)
 configure WFG mode More...
 
en_result_t Mft_Wfg_ConfigCtrlBits (volatile FM4_MFT_WFG_TypeDef *pstcMft, uint8_t u8CoupleCh, stc_wfg_ctrl_bits *pstcCtrlBits)
 configure WFG control bit More...
 
en_result_t Mft_Wfg_InitTimerClock (volatile FM4_MFT_WFG_TypeDef *pstcMft, uint8_t u8CoupleCh, en_wfg_timer_clock_t enClk)
 init timer clock More...
 
en_result_t Mft_Wfg_EnableTimerInt (volatile FM4_MFT_WFG_TypeDef *pstcMft, uint8_t u8CoupleCh, func_ptr_t pfnCallback)
 enable WFG timer interrupt More...
 
en_result_t Mft_Wfg_DisableTimerInt (volatile FM4_MFT_WFG_TypeDef *pstcMft, uint8_t u8CoupleCh)
 disable WFG timer interrupt More...
 
en_result_t Mft_Wfg_StartTimer (volatile FM4_MFT_WFG_TypeDef *pstcMft, uint8_t u8CoupleCh)
 Start WFG timer. More...
 
en_result_t Mft_Wfg_StopTimer (volatile FM4_MFT_WFG_TypeDef *pstcMft, uint8_t u8CoupleCh)
 Stop WFG timer. More...
 
en_int_flag_t Mft_Wfg_GetTimerIntFlag (volatile FM4_MFT_WFG_TypeDef *pstcMft, uint8_t u8CoupleCh)
 get WFG timer interrupt flag More...
 
en_result_t Mft_Wfg_ClrTimerIntFlag (volatile FM4_MFT_WFG_TypeDef *pstcMft, uint8_t u8CoupleCh)
 clear WFG timer interrupt flag More...
 
en_result_t Mft_Wfg_WriteTimerCountCycle (volatile FM4_MFT_WFG_TypeDef *pstcMft, uint8_t u8CoupleCh, uint16_t u16CycleA, uint16_t u16CycleB)
 write timer count cycle More...
 
en_result_t Mft_Wfg_SetTimerCycle (volatile FM4_MFT_WFG_TypeDef *pstcMft, uint8_t u8CoupleCh, uint16_t u16Count)
 set wfg pulse counter More...
 
uint16_t Mft_Wfg_GetTimerCurCycle (volatile FM4_MFT_WFG_TypeDef *pstcMft, uint8_t u8CoupleCh)
 get current pulse counter More...
 
en_result_t Mft_Wfg_ConfigNzcl (volatile FM4_MFT_WFG_TypeDef *pstcMft, stc_wfg_nzcl_config_t *pstcNzclConfig)
 configure NZCL More...
 
en_result_t Mft_Wfg_EnableDtifInt (volatile FM4_MFT_WFG_TypeDef *pstcMft, stc_dtif_int_sel_t *pstcIntSel, stc_dtif_int_cb_t *pstcCallback)
 Enable DTIF interrupt. More...
 
en_result_t Mft_Wfg_DisableDtifInt (volatile FM4_MFT_WFG_TypeDef *pstcMft, stc_dtif_int_sel_t *pstcIntSel)
 Disable DTIF interrupt. More...
 
en_result_t Mft_Wfg_SwTiggerDtif (volatile FM4_MFT_WFG_TypeDef *pstcMft)
 set software trigger DTIF More...
 
en_int_flag_t Mft_Wfg_GetDigitalFilterIntFlag (volatile FM4_MFT_WFG_TypeDef *pstcMft)
 get Digital filter interrupt flag More...
 
en_result_t Mft_Wfg_ClrDigitalFilterIntFlag (volatile FM4_MFT_WFG_TypeDef *pstcMft)
 clear Digital filter interrupt flag More...
 
en_int_flag_t Mft_Wfg_GetAnalogFilterIntFlag (volatile FM4_MFT_WFG_TypeDef *pstcMft)
 get Analgo filter interrupt flag More...
 
en_result_t Mft_Wfg_ClrAnalogFilterIntFlag (volatile FM4_MFT_WFG_TypeDef *pstcMft)
 clear analog filter interrupt flag More...
 
void Mft_Wfg_IrqHandler (volatile FM4_MFT_WFG_TypeDef *pstcMft, stc_mft_wfg_intern_data_t *pstcMftWfgInternData)
 WFG interrupt handler sub function. More...
 

Variables

stc_mft_wfg_instance_data_t m_astcMftWfgInstanceDataLut []
 Look-up table for all enabled WFG instances and their internal data. More...
 

Detailed Description

Headerfile for MFT's Waveform Generator functions

History:

  • 2013-03-21 0.1 Edison First version.
  • 2013-07-16 0.2 Edison Add comments about how to use WFG with APIs

Definition in file mft_wfg.h.