![]() |
PDL for FM0+
Version1.0
Peripheral Driverl Library for FM0+
|
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 | |
static stc_mft_ocu_intern_data_t * | MftGetInternDataPtr (volatile FM0P_MFT_OCU_TypeDef *pstcOcu) |
Return the internal data for a certain OCU instance. | |
void | Mft_Ocu_IrqHandler (volatile FM0P_MFT_OCU_TypeDef *pstcOcu, stc_mft_ocu_intern_data_t *pstcMftOcuInternData) |
OCU module interrupt handler. | |
static void | Mft_Ocu_InitIrq (volatile FM0P_MFT_OCU_TypeDef *pstcOcu) |
Device dependent initialization of interrupts according CMSIS with level defined in pdl.h. | |
static void | Mft_Ocu_DeInitIrq (volatile FM0P_MFT_OCU_TypeDef *pstcOcu) |
Device dependent de-initialization of interrupts according CMSIS. | |
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_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. | |
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 | |
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 FRT of MFT instances and their internal data. | |
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. |
Provided functions of OCU module:
How to use OCU module?
Before using OCU, a FRT used to connect with applying OCU must be initialed. For how to configure FRT, see the description in the mft_frt.h
Mft_Ocu_Init() must be used for configuration of an Output Compare Unit (OCU) channel with a structure of the type stc_mft_ocu_config_t. A FRT should be connected with applying OCU with this function.
Mft_Ocu_SetEvenChCompareMode() is used to set the compare function/mode of even channel with the structure type stc_even_compare_config_t. Mft_Ocu_SetOddChCompareMode() is used to set the compare function/mode of odd channel with the structure type stc_odd_compare_config_t.
With Mft_Ocu_WriteOccp() the OCU compare value is set to the value given in the parameter Mft_Ocu_WriteOccp::u16Cycle. Whether the compare value is modified directly depends on buffer function.
A OCU interrupt can be enabled by the function Mft_Ocu_EnableInt(). This function can set callback function for each channel too.
After above setting, calling Mft_Ocu_EnableOperation() will start OCU.
With interrupt mode, the interrupt occurs when FRT count match OCU compare value, the interrupt flag will be cleared and run into user interrupt callback function.
With polling mode, user can use Mft_Ocu_GetIntFlag() to check if the interrupt occurs, and clear the interrupt flag by Mft_Ocu_ClrIntFlag().
When stopping the OCU, use Mft_Ocu_DisableOperation() to disable OCU and Mft_Ocu_DisableInt() to disable OCU interrupt.
#define MFT0_OCU (*((volatile stc_mftn_ocu_t *) FM0P_MFT0_OCU_BASE)) |
Definition at line 121 of file mft_ocu.h.
Referenced by Mft_Ocu_DeInitIrq(), Mft_Ocu_InitIrq(), and MFT_OPC_IRQHandler().
#define MFT1_OCU (*((volatile stc_mftn_ocu_t *) FM0P_MFT1_OCU_BASE)) |
Definition at line 122 of file mft_ocu.h.
Referenced by Mft_Ocu_DeInitIrq(), Mft_Ocu_InitIrq(), and MFT_OPC_IRQHandler().
#define MFT2_OCU (*((volatile stc_mftn_ocu_t *) FM0P_MFT1_OCU_BASE)) |
Definition at line 123 of file mft_ocu.h.
Referenced by Mft_Ocu_DeInitIrq(), Mft_Ocu_InitIrq(), and MFT_OPC_IRQHandler().
#define MFT_OCU_CH0 0 |
#define MFT_OCU_CH1 1 |
#define MFT_OCU_CH10 0 |
#define MFT_OCU_CH2 2 |
#define MFT_OCU_CH3 3 |
#define MFT_OCU_CH32 1 |
#define MFT_OCU_CH4 4 |
#define MFT_OCU_CH5 5 |
#define MFT_OCU_CH54 2 |
#define MFT_OCU_MAXCH 6 |
Definition at line 131 of file mft_ocu.h.
Referenced by Mft_Ocu_ClrIntFlag(), Mft_Ocu_DisableInt(), Mft_Ocu_DisableOperation(), Mft_Ocu_EnableInt(), Mft_Ocu_EnableOperation(), Mft_Ocu_Init(), Mft_Ocu_IrqHandler(), Mft_Ocu_ReadOccp(), and Mft_Ocu_WriteOccp().
#define OCU_INSTANCE_COUNT |
(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)
Definition at line 137 of file mft_ocu.h.
Referenced by MftGetInternDataPtr().
#define stc_mftn_ocu_t FM0P_MFT_OCU_TypeDef |
Definition at line 119 of file mft_ocu.h.
Referenced by Mft_Ocu_DeInitIrq(), Mft_Ocu_InitIrq(), and MFT_OPC_IRQHandler().
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 enum en_mft_ocu_frt en_mft_ocu_frt_t |
select the FRT to be connected to OCU
typedef enum en_ocu_instance_index en_ocu_instance_index_t |
Enumeration to define an index for each OCU instance.
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 enum en_ocu_rt_out_state en_ocu_rt_out_state_t |
output level of the RT pin state
typedef enum en_rt_status en_rt_even_status_t |
RT output status.
typedef enum en_rt_status en_rt_odd_status_t |
typedef struct stc_even_compare_config stc_even_compare_config_t |
The compare configuration of even OCU channel.
typedef struct stc_mft_ocu_config stc_mft_ocu_config_t |
OCU configure.
typedef struct stc_mft_ocu_instance_data stc_mft_ocu_instance_data_t |
OCU instance data type.
typedef struct stc_mft_ocu_intern_data stc_mft_ocu_intern_data_t |
Structure of OCU internal data.
typedef struct stc_odd_compare_config stc_odd_compare_config_t |
The compare configuration of odd OCU channel.
enum en_mft_ocu_frt |
enum en_ocu_occp_buf |
enum en_ocu_ocse_buf |
enum en_ocu_rt_out_state |
enum en_rt_status |
en_result_t Mft_Ocu_ClrIntFlag | ( | volatile FM0P_MFT_OCU_TypeDef * | pstcOcu, |
uint8_t | u8Ch | ||
) |
clear ocu interrupt flag
[in] | pstcOcu | Pointer to OCU instance |
[in] | u8Ch | channel of OCU
|
Ok | OCU interrupt flag is clear |
ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 715 of file mft_ocu.c.
References ErrorInvalidParameter, MFT_OCU_MAXCH, and Ok.
Referenced by Mft_Ocu_IrqHandler().
static void Mft_Ocu_DeInitIrq | ( | volatile FM0P_MFT_OCU_TypeDef * | pstcOcu | ) | [static] |
Device dependent de-initialization of interrupts according CMSIS.
[in] | pstcOcu | Pointer to OCU instance |
Ok | Successful initialization |
Definition at line 207 of file mft_ocu.c.
References MFT0_OCU, MFT1_OCU, MFT2_OCU, PDL_DEFAULT_INTERRUPT_LEVEL, and stc_mftn_ocu_t.
Referenced by Mft_Ocu_DisableInt().
en_result_t Mft_Ocu_DisableInt | ( | volatile FM0P_MFT_OCU_TypeDef * | pstcOcu, |
uint8_t | u8Ch | ||
) |
Disable ocu interrupt.
[in] | pstcOcu | Pointer to OCU instance |
[in] | u8Ch | channel of OCU
|
Ok | OCU interrupt disabled |
ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 626 of file mft_ocu.c.
References ErrorInvalidParameter, Mft_Ocu_DeInitIrq(), MFT_OCU_MAXCH, MftGetInternDataPtr(), and Ok.
en_result_t Mft_Ocu_DisableOperation | ( | volatile FM0P_MFT_OCU_TypeDef * | pstcOcu, |
uint8_t | u8Ch | ||
) |
Disable ocu operation.
[in] | pstcOcu | Pointer to OCU instance |
[in] | u8Ch | channel of OCU
|
Ok | OCU operation disabled |
ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 524 of file mft_ocu.c.
References ErrorInvalidParameter, MFT_OCU_MAXCH, and Ok.
en_result_t Mft_Ocu_EnableInt | ( | volatile FM0P_MFT_OCU_TypeDef * | pstcOcu, |
uint8_t | u8Ch, | ||
func_ptr_t | pfnCallback | ||
) |
enable ocu interrupt
[in] | pstcOcu | Pointer to OCU instance |
[in] | u8Ch | channel of OCU
|
[in] | pfnCallback | callback function |
Ok | OCU interrupt enabled |
ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 571 of file mft_ocu.c.
References ErrorInvalidParameter, Mft_Ocu_InitIrq(), MFT_OCU_MAXCH, MftGetInternDataPtr(), Ok, and stc_mft_ocu_intern_data::pfnOcu0Callback.
en_result_t Mft_Ocu_EnableOperation | ( | volatile FM0P_MFT_OCU_TypeDef * | pstcOcu, |
uint8_t | u8Ch | ||
) |
enable ocu operation
[in] | pstcOcu | Pointer to OCU instance |
[in] | u8Ch | channel of OCU
|
Ok | OCU operation enabled |
ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 481 of file mft_ocu.c.
References ErrorInvalidParameter, MFT_OCU_MAXCH, and Ok.
en_int_flag_t Mft_Ocu_GetIntFlag | ( | volatile FM0P_MFT_OCU_TypeDef * | pstcOcu, |
uint8_t | u8Ch | ||
) |
get ocu interrupt flag
[in] | pstcOcu | Pointer to OCU instance |
[in] | u8Ch | channel of OCU
|
PdlClr | OCU interrupt flag is clear |
PdlSet | OCU interrupt flag is set |
Definition at line 678 of file mft_ocu.c.
References PdlClr, and PdlSet.
Referenced by Mft_Ocu_IrqHandler().
en_ocu_rt_out_state_t Mft_Ocu_GetRtPinLevel | ( | volatile FM0P_MFT_OCU_TypeDef * | pstcOcu, |
uint8_t | u8Ch | ||
) |
Get RT pin level of OCU.
[in] | pstcOcu | Pointer to OCU instance |
[in] | u8Ch | channel of OCU
|
RtLowlevel | RT pin is low level |
RtHighlevel | RT pin is high level |
Definition at line 755 of file mft_ocu.c.
References RtHighLevel, and RtLowLevel.
en_result_t Mft_Ocu_Init | ( | volatile FM0P_MFT_OCU_TypeDef * | pstcOcu, |
uint8_t | u8Ch, | ||
stc_mft_ocu_config_t * | pstcOcuConfig | ||
) |
Init OCU module.
[in] | pstcOcu | Pointer to OCU instance |
[in] | u8Ch | channel of OCU
|
[in] | pstcOcuConfig | configure of OCU
|
Ok | OCU module initialized |
ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 270 of file mft_ocu.c.
References stc_mft_ocu_config::bCmod, stc_mft_ocu_config::bFm4, stc_mft_ocu_config::enFrtConnect, stc_mft_ocu_config::enOccpBufMode, stc_mft_ocu_config::enOcseBufMode, stc_mft_ocu_config::enStatePin, ErrorInvalidParameter, MFT_OCU_MAXCH, MftGetInternDataPtr(), OccpBufTrsfByFrtZeroPeak, OcseBufTrsfByFrtZeroPeak, OcuFrtToExt, Ok, stc_mft_ocu_intern_data::pfnOcu0Callback, stc_mft_ocu_intern_data::pfnOcu1Callback, stc_mft_ocu_intern_data::pfnOcu2Callback, stc_mft_ocu_intern_data::pfnOcu3Callback, stc_mft_ocu_intern_data::pfnOcu4Callback, stc_mft_ocu_intern_data::pfnOcu5Callback, and stc_mft_ocu_config::u8Mod.
static void Mft_Ocu_InitIrq | ( | volatile FM0P_MFT_OCU_TypeDef * | pstcOcu | ) | [static] |
Device dependent initialization of interrupts according CMSIS with level defined in pdl.h.
[in] | pstcOcu | Pointer to OCU instance |
Ok | Successful initialization |
Definition at line 184 of file mft_ocu.c.
References MFT0_OCU, MFT1_OCU, MFT2_OCU, PDL_IRQ_LEVEL_MFT_OCU, and stc_mftn_ocu_t.
Referenced by Mft_Ocu_EnableInt().
void Mft_Ocu_IrqHandler | ( | volatile FM0P_MFT_OCU_TypeDef * | pstcOcu, |
stc_mft_ocu_intern_data_t * | pstcMftOcuInternData | ||
) |
OCU module interrupt handler.
[in] | pstcOcu | Pointer to OCU instance |
[in] | pstcMftOcuInternData | callback function of OCU |
Definition at line 147 of file mft_ocu.c.
References Mft_Ocu_ClrIntFlag(), Mft_Ocu_GetIntFlag(), MFT_OCU_MAXCH, PdlSet, and stc_mft_ocu_intern_data::pfnOcu0Callback.
Referenced by MFT_OPC_IRQHandler().
uint16_t Mft_Ocu_ReadOccp | ( | volatile FM0P_MFT_OCU_TypeDef * | pstcOcu, |
uint8_t | u8Ch | ||
) |
get occp register value
[in] | pstcOcu | Pointer to OCU instance |
[in] | u8Ch | channel of OCU
|
16bit | occp value |
Definition at line 825 of file mft_ocu.c.
References MFT_OCU_MAXCH.
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.
[in] | pstcOcu | Pointer to OCU instance |
[in] | EvenCh | even channel of OCU
|
[in] | pstcConfig | pointer to structure of compare mode |
Ok | Even OCU channel compare mode is set |
ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 354 of file mft_ocu.c.
References stc_even_compare_config::enFrtDownCntEvenMatchEvenChRtStatus, stc_even_compare_config::enFrtPeakEvenMatchEvenChRtStatus, stc_even_compare_config::enFrtPeakEvenNotMatchEvenChStatus, stc_even_compare_config::enFrtUpCntEvenMatchEvenChRtStatus, stc_even_compare_config::enFrtZeroEvenMatchEvenChRtStatus, stc_even_compare_config::enFrtZeroEvenNotMatchEvenChRtStatus, stc_even_compare_config::enIopFlagWhenFrtDownCntEvenMatch, stc_even_compare_config::enIopFlagWhenFrtPeakEvenMatch, stc_even_compare_config::enIopFlagWhenFrtUpCntEvenMatch, stc_even_compare_config::enIopFlagWhenFrtZeroEvenMatch, ErrorInvalidParameter, IopFlagSet, Ok, and RtOutputReverse.
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.
[in] | pstcOcu | Pointer to OCU instance |
[in] | OddCh | odd channel of OCU
|
[in] | pstcConfig | pointer to structure of compare mode |
Ok | Odd OCU channel compare mode is set |
ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 410 of file mft_ocu.c.
References stc_odd_compare_config::enFrtDownOddMatchEvenMatchOddChRtStatus, stc_odd_compare_config::enFrtDownOddMatchEvenNotMatchOddChRtStatus, stc_odd_compare_config::enFrtDownOddNotMatchEvenMatchOddChRtStatus, stc_odd_compare_config::enFrtPeakOddMatchEvenMatchOddChRtStatus, stc_odd_compare_config::enFrtPeakOddMatchEvenNotMatchOddChRtStatus, stc_odd_compare_config::enFrtPeakOddNotMatchEvenMatchOddChRtStatus, stc_odd_compare_config::enFrtPeakOddNotMatchEvenNotMatchOddChRtStatus, stc_odd_compare_config::enFrtUpCntOddMatchEvenMatchOddChRtStatus, stc_odd_compare_config::enFrtUpCntOddMatchEvenNotMatchOddChRtStatus, stc_odd_compare_config::enFrtUpCntOddNotMatchEvenMatchOddChRtStatus, stc_odd_compare_config::enFrtZeroOddMatchEvenMatchOddChRtStatus, stc_odd_compare_config::enFrtZeroOddMatchEvenNotMatchOddChRtStatus, stc_odd_compare_config::enFrtZeroOddNotMatchEvenMatchOddChRtStatus, stc_odd_compare_config::enFrtZeroOddNotMatchEvenNotMatchOddChRtStatus, stc_odd_compare_config::enIopFlagWhenFrtDownCntOddMatch, stc_odd_compare_config::enIopFlagWhenFrtPeakOddMatch, stc_odd_compare_config::enIopFlagWhenFrtUpCntOddMatch, stc_odd_compare_config::enIopFlagWhenFrtZeroOddMatch, ErrorInvalidParameter, IopFlagSet, Ok, and RtOutputReverse.
en_result_t Mft_Ocu_WriteOccp | ( | volatile FM0P_MFT_OCU_TypeDef * | pstcOcu, |
uint8_t | u8Ch, | ||
uint16_t | u16Occp | ||
) |
writ occp register
[in] | pstcOcu | Pointer to OCU instance |
[in] | u8Ch | channel of OCU
|
[in] | u16Occp | the value of occp
|
Ok | OCCP written |
ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 793 of file mft_ocu.c.
References ErrorInvalidParameter, MFT_OCU_MAXCH, and Ok.
static stc_mft_ocu_intern_data_t* MftGetInternDataPtr | ( | volatile FM0P_MFT_OCU_TypeDef * | pstcOcu | ) | [static] |
Return the internal data for a certain OCU instance.
pstcOcu | Pointer to OCU instance |
Definition at line 121 of file mft_ocu.c.
References OCU_INSTANCE_COUNT, and stc_mft_ocu_instance_data::stcInternData.
Referenced by Mft_Ocu_DisableInt(), Mft_Ocu_EnableInt(), and Mft_Ocu_Init().
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)] |
{ { & (*((volatile FM0P_MFT_OCU_TypeDef *) FM0P_MFT0_OCU_BASE)) , {NULL, NULL, NULL, NULL, NULL, NULL} }, { & (*((volatile FM0P_MFT_OCU_TypeDef *) FM0P_MFT1_OCU_BASE)) , {NULL, NULL, NULL, NULL, NULL, NULL} }, { & (*((volatile FM0P_MFT_OCU_TypeDef *) FM0P_MFT1_OCU_BASE)) , {NULL, NULL, NULL, NULL, NULL, NULL} }, }
Look-up table for all enabled FRT of MFT instances and their internal data.
Look-up table for all enabled OCU instances and their internal data.
Definition at line 74 of file mft_ocu.c.
Referenced by MFT_OPC_IRQHandler().
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.
Definition at line 74 of file mft_ocu.c.
Referenced by MFT_OPC_IRQHandler().