PDL for FM0+  Version1.0
Peripheral Driverl Library for FM0+
C:/pdl_v10/library/driver/mft/mft_ocu.h File Reference
#include "mcu.h"
#include "pdl_user.h"
Include dependency graph for mft_ocu.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  stc_mft_ocu_config
 OCU configure. More...
struct  stc_even_compare_config
 The compare configuration of even OCU channel. More...
struct  stc_odd_compare_config
 The compare configuration of odd OCU channel. More...
struct  stc_mft_ocu_intern_data
 Structure of OCU internal data. More...
struct  stc_mft_ocu_instance_data
 OCU instance data type. More...

Defines

#define stc_mftn_ocu_t   FM0P_MFT_OCU_TypeDef
#define MFT0_OCU   (*((volatile stc_mftn_ocu_t *) FM0P_MFT0_OCU_BASE))
#define MFT1_OCU   (*((volatile stc_mftn_ocu_t *) FM0P_MFT1_OCU_BASE))
#define MFT2_OCU   (*((volatile stc_mftn_ocu_t *) FM0P_MFT1_OCU_BASE))
#define MFT_OCU_CH0   0
#define MFT_OCU_CH1   1
#define MFT_OCU_CH2   2
#define MFT_OCU_CH3   3
#define MFT_OCU_CH4   4
#define MFT_OCU_CH5   5
#define MFT_OCU_MAXCH   6
#define MFT_OCU_CH10   0
#define MFT_OCU_CH32   1
#define MFT_OCU_CH54   2
#define OCU_INSTANCE_COUNT

Typedefs

typedef enum en_ocu_instance_index en_ocu_instance_index_t
 Enumeration to define an index for each OCU instance.
typedef enum en_mft_ocu_frt en_mft_ocu_frt_t
 select the FRT to be connected to OCU
typedef enum en_ocu_rt_out_state en_ocu_rt_out_state_t
 output level of the RT pin state
typedef enum en_ocu_occp_buf en_ocu_occp_buf_t
 buffer register function of OCCP
typedef enum en_ocu_ocse_buf en_ocu_ocse_buf_t
 buffer register function of OCSE
typedef struct stc_mft_ocu_config stc_mft_ocu_config_t
 OCU configure.
typedef enum en_rt_status en_rt_even_status_t
 RT output status.
typedef enum en_rt_status en_rt_odd_status_t
typedef enum
en_iop_flag_set_condition 
en_iop_flag_even_t
 The condition for IOP flag set.
typedef enum
en_iop_flag_set_condition 
en_iop_flag_odd_t
typedef struct
stc_even_compare_config 
stc_even_compare_config_t
 The compare configuration of even OCU channel.
typedef struct
stc_odd_compare_config 
stc_odd_compare_config_t
 The compare configuration of odd OCU channel.
typedef struct
stc_mft_ocu_intern_data 
stc_mft_ocu_intern_data_t
 Structure of OCU internal data.
typedef struct
stc_mft_ocu_instance_data 
stc_mft_ocu_instance_data_t
 OCU instance data type.

Enumerations

enum  en_ocu_instance_index { OcuInstanceIndexOcu0 = 0, OcuInstanceIndexOcu1, OcuInstanceIndexOcu2 }
 Enumeration to define an index for each OCU instance. More...
enum  en_mft_ocu_frt { Frt0ToOcu = 0u, Frt1ToOcu, Frt2ToOcu, OcuFrtToExt }
 select the FRT to be connected to OCU More...
enum  en_ocu_rt_out_state { RtLowLevel = 0, RtHighLevel }
 output level of the RT pin state More...
enum  en_ocu_occp_buf { OccpBufDisable = 0, OccpBufTrsfByFrtZero, OccpBufTrsfByFrtPeak, OccpBufTrsfByFrtZeroPeak }
 buffer register function of OCCP More...
enum  en_ocu_ocse_buf { OcseBufDisable = 0, OcseBufTrsfByFrtZero, OcseBufTrsfByFrtPeak, OcseBufTrsfByFrtZeroPeak }
 buffer register function of OCSE More...
enum  en_rt_status { RtOutputHold = 0, RtOutputHigh, RtOutputLow, RtOutputReverse }
 RT output status. More...
enum  en_iop_flag_set_condition { IopFlagHold = 0, IopFlagSet }
 The condition for IOP flag set. More...

Functions

en_result_t Mft_Ocu_Init (volatile FM0P_MFT_OCU_TypeDef *pstcOcu, uint8_t u8Ch, stc_mft_ocu_config_t *pstcOcuConfig)
 Init OCU module.
en_result_t Mft_Ocu_SetEvenChCompareMode (volatile FM0P_MFT_OCU_TypeDef *pstcOcu, uint8_t EvenCh, stc_even_compare_config_t *pstcConfig)
 Compare congifuration of even OCU channel.
en_result_t Mft_Ocu_SetOddChCompareMode (volatile FM0P_MFT_OCU_TypeDef *pstcOcu, uint8_t OddCh, stc_odd_compare_config_t *pstcConfig)
 Compare congifuration of odd OCU channel.
en_result_t Mft_Ocu_EnableOperation (volatile FM0P_MFT_OCU_TypeDef *pstcOcu, uint8_t u8Ch)
 enable ocu operation
en_result_t Mft_Ocu_DisableOperation (volatile FM0P_MFT_OCU_TypeDef *pstcOcu, uint8_t u8Ch)
 Disable ocu operation.
en_result_t Mft_Ocu_EnableInt (volatile FM0P_MFT_OCU_TypeDef *pstcOcu, uint8_t u8Ch, func_ptr_t pfnCallback)
 enable ocu interrupt
en_result_t Mft_Ocu_DisableInt (volatile FM0P_MFT_OCU_TypeDef *pstcOcu, uint8_t u8Ch)
 Disable ocu interrupt.
en_result_t Mft_Ocu_WriteOccp (volatile FM0P_MFT_OCU_TypeDef *pstcOcu, uint8_t u8Ch, uint16_t u16Occp)
 writ occp register
uint16_t Mft_Ocu_ReadOccp (volatile FM0P_MFT_OCU_TypeDef *pstcOcu, uint8_t u8Ch)
 get occp register value
en_int_flag_t Mft_Ocu_GetIntFlag (volatile FM0P_MFT_OCU_TypeDef *pstcOcu, uint8_t u8Ch)
 get ocu interrupt flag
en_result_t Mft_Ocu_ClrIntFlag (volatile FM0P_MFT_OCU_TypeDef *pstcOcu, uint8_t u8Ch)
 clear ocu interrupt flag
en_ocu_rt_out_state_t Mft_Ocu_GetRtPinLevel (volatile FM0P_MFT_OCU_TypeDef *pstcOcu, uint8_t u8Ch)
 Get RT pin level of OCU.
void Mft_Ocu_IrqHandler (volatile FM0P_MFT_OCU_TypeDef *pstcOcu, stc_mft_ocu_intern_data_t *pstcMftOcuInternData)
 OCU module interrupt handler.

Variables

stc_mft_ocu_instance_data_t m_astcMftOcuInstanceDataLut [(PDL_PERIPHERAL_ENABLE_MFT0_OCU==PDL_ON?1:0)+(PDL_PERIPHERAL_ENABLE_MFT1_OCU==PDL_ON?1:0)+(PDL_PERIPHERAL_ENABLE_MFT2_OCU==PDL_ON?1:0)]
 Look-up table for all enabled OCU instances and their internal data.

Detailed Description

Headerfile for MFT's Output Compare Unit functions

History:

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

Definition in file mft_ocu.h.