M480 BSP V3.05.006
The Board Support Package for M480 Series
Macros | Functions

Macros

#define ECAP_SET_NOISE_FILTER_CLKDIV(ecap, u32ClkSel)
 This macro is used to select noise filter clock pre-divide number. More...
 
#define ECAP_NOISE_FILTER_DISABLE(ecap)
 This macro is used to disable noise filter. More...
 
#define ECAP_NOISE_FILTER_ENABLE(ecap, u32ClkSel)
 This macro is used to enable noise filter. More...
 
#define ECAP_ENABLE_INPUT_CHANNEL(ecap, u32Mask)
 This macro is used to enable input channel unit. More...
 
#define ECAP_DISABLE_INPUT_CHANNEL(ecap, u32Mask)
 This macro is used to disable input channel unit. More...
 
#define ECAP_SEL_INPUT_SRC(ecap, u32Index, u32Src)
 This macro is used to select input channel source. More...
 
#define ECAP_ENABLE_INT(ecap, u32Mask)
 This macro is used to enable input channel interrupt. More...
 
#define ECAP_DISABLE_INT(ecap, u32Mask)
 This macro is used to disable input channel interrupt. More...
 
#define ECAP_ENABLE_OVF_INT(ecap)
 This macro is used to enable input channel overflow interrupt. More...
 
#define ECAP_DISABLE_OVF_INT(ecap)
 This macro is used to disable input channel overflow interrupt. More...
 
#define ECAP_ENABLE_CMP_MATCH_INT(ecap)
 This macro is used to enable input channel compare-match interrupt. More...
 
#define ECAP_DISABLE_CMP_MATCH_INT(ecap)
 This macro is used to disable input channel compare-match interrupt. More...
 
#define ECAP_CNT_START(ecap)
 This macro is used to start capture counter. More...
 
#define ECAP_CNT_STOP(ecap)
 This macro is used to stop capture counter. More...
 
#define ECAP_SET_CNT_CLEAR_EVENT(ecap, u32Event)
 This macro is used to set event to clear capture counter. More...
 
#define ECAP_ENABLE_CMP(ecap)
 This macro is used to enable compare function. More...
 
#define ECAP_DISABLE_CMP(ecap)
 This macro is used to disable compare function. More...
 
#define ECAP_ENABLE_CNT(ecap)
 This macro is used to enable input capture function. More...
 
#define ECAP_DISABLE_CNT(ecap)
 This macro is used to disable input capture function. More...
 
#define ECAP_SEL_CAPTURE_EDGE(ecap, u32Index, u32Edge)
 This macro is used to select input channel edge detection. More...
 
#define ECAP_SEL_RELOAD_TRIG_SRC(ecap, u32TrigSrc)
 This macro is used to select ECAP counter reload trigger source. More...
 
#define ECAP_SEL_TIMER_CLK_DIV(ecap, u32Clkdiv)
 This macro is used to select capture timer clock divide. More...
 
#define ECAP_SEL_TIMER_CLK_SRC(ecap, u32ClkSrc)
 This macro is used to select capture timer/counter clock source. More...
 
#define ECAP_GET_INT_STATUS(ecap)
 This macro is used to read input capture status. More...
 
#define ECAP_GET_CAPTURE_FLAG(ecap, u32Mask)
 This macro is used to get input channel interrupt flag. More...
 
#define ECAP_CLR_CAPTURE_FLAG(ecap, u32Mask)
 This macro is used to clear input channel interrupt flag. More...
 
#define ECAP_SET_CNT_VALUE(ecap, u32Val)
 This macro is used to set input capture counter value. More...
 
#define ECAP_GET_CNT_VALUE(ecap)
 This macro is used to get input capture counter value. More...
 
#define ECAP_GET_CNT_HOLD_VALUE(ecap, u32Index)
 This macro is used to get input capture counter hold value. More...
 
#define ECAP_SET_CNT_CMP(ecap, u32Val)
 This macro is used to set input capture counter compare value. More...
 

Functions

void ECAP_Open (ECAP_T *ecap, uint32_t u32FuncMask)
 Enable ECAP function. More...
 
void ECAP_Close (ECAP_T *ecap)
 Disable ECAP function. More...
 
void ECAP_EnableINT (ECAP_T *ecap, uint32_t u32Mask)
 This macro is used to enable input channel interrupt. More...
 
void ECAP_DisableINT (ECAP_T *ecap, uint32_t u32Mask)
 This macro is used to disable input channel interrupt. More...
 

Detailed Description

Macro Definition Documentation

◆ ECAP_CLR_CAPTURE_FLAG

#define ECAP_CLR_CAPTURE_FLAG (   ecap,
  u32Mask 
)

This macro is used to clear input channel interrupt flag.

Parameters
[in]ecapSpecify ECAP port
[in]u32MaskThe input channel mask
Returns
None

This macro will write 1 to clear the input channel_n interrupt flag.

Definition at line 398 of file ecap.h.

◆ ECAP_CNT_START

#define ECAP_CNT_START (   ecap)

This macro is used to start capture counter.

Parameters
[in]ecapSpecify ECAP port
Returns
None

This macro will start capture counter up-counting.

Definition at line 229 of file ecap.h.

◆ ECAP_CNT_STOP

#define ECAP_CNT_STOP (   ecap)

This macro is used to stop capture counter.

Parameters
[in]ecapSpecify ECAP port
Returns
None

This macro will stop capture counter up-counting.

Definition at line 238 of file ecap.h.

◆ ECAP_DISABLE_CMP

#define ECAP_DISABLE_CMP (   ecap)

This macro is used to disable compare function.

Parameters
[in]ecapSpecify ECAP port
Returns
None

This macro will disable the compare function.

Definition at line 278 of file ecap.h.

◆ ECAP_DISABLE_CMP_MATCH_INT

#define ECAP_DISABLE_CMP_MATCH_INT (   ecap)

This macro is used to disable input channel compare-match interrupt.

Parameters
[in]ecapSpecify ECAP port
Returns
None

This macro will disable the input channel compare-match interrupt.

Definition at line 220 of file ecap.h.

◆ ECAP_DISABLE_CNT

#define ECAP_DISABLE_CNT (   ecap)

This macro is used to disable input capture function.

Parameters
[in]ecapSpecify ECAP port
Returns
None

This macro will disable input capture timer/counter.

Definition at line 296 of file ecap.h.

◆ ECAP_DISABLE_INPUT_CHANNEL

#define ECAP_DISABLE_INPUT_CHANNEL (   ecap,
  u32Mask 
)

This macro is used to disable input channel unit.

Parameters
[in]ecapSpecify ECAP port
[in]u32MaskThe input channel mask
Returns
None

This macro will disable the input channel_n to input capture.

Definition at line 142 of file ecap.h.

◆ ECAP_DISABLE_INT

#define ECAP_DISABLE_INT (   ecap,
  u32Mask 
)

This macro is used to disable input channel interrupt.

Parameters
[in]ecapSpecify ECAP port
[in]u32MaskThe input channel mask
Returns
None

This macro will disable the input channel_n interrupt.

Definition at line 184 of file ecap.h.

◆ ECAP_DISABLE_OVF_INT

#define ECAP_DISABLE_OVF_INT (   ecap)

This macro is used to disable input channel overflow interrupt.

Parameters
[in]ecapSpecify ECAP port
Returns
None

This macro will disable the input channel overflow interrupt.

Definition at line 202 of file ecap.h.

◆ ECAP_ENABLE_CMP

#define ECAP_ENABLE_CMP (   ecap)

This macro is used to enable compare function.

Parameters
[in]ecapSpecify ECAP port
Returns
None

This macro will enable the compare function.

Definition at line 269 of file ecap.h.

◆ ECAP_ENABLE_CMP_MATCH_INT

#define ECAP_ENABLE_CMP_MATCH_INT (   ecap)

This macro is used to enable input channel compare-match interrupt.

Parameters
[in]ecapSpecify ECAP port
Returns
None

This macro will enable the input channel compare-match interrupt.

Definition at line 211 of file ecap.h.

◆ ECAP_ENABLE_CNT

#define ECAP_ENABLE_CNT (   ecap)

This macro is used to enable input capture function.

Parameters
[in]ecapSpecify ECAP port
Returns
None

This macro will enable input capture timer/counter.

Definition at line 287 of file ecap.h.

◆ ECAP_ENABLE_INPUT_CHANNEL

#define ECAP_ENABLE_INPUT_CHANNEL (   ecap,
  u32Mask 
)

This macro is used to enable input channel unit.

Parameters
[in]ecapSpecify ECAP port
[in]u32MaskThe input channel mask
Returns
None

This macro will enable the input channel_n to input capture.

Definition at line 129 of file ecap.h.

◆ ECAP_ENABLE_INT

#define ECAP_ENABLE_INT (   ecap,
  u32Mask 
)

This macro is used to enable input channel interrupt.

Parameters
[in]ecapSpecify ECAP port
[in]u32MaskThe input channel mask
Returns
None

This macro will enable the input channel_n interrupt.

Definition at line 171 of file ecap.h.

◆ ECAP_ENABLE_OVF_INT

#define ECAP_ENABLE_OVF_INT (   ecap)

This macro is used to enable input channel overflow interrupt.

Parameters
[in]ecapSpecify ECAP port
Returns
None

This macro will enable the input channel overflow interrupt.

Definition at line 193 of file ecap.h.

◆ ECAP_GET_CAPTURE_FLAG

#define ECAP_GET_CAPTURE_FLAG (   ecap,
  u32Mask 
)

This macro is used to get input channel interrupt flag.

Parameters
[in]ecapSpecify ECAP port
[in]u32MaskThe input channel mask
Returns
None

This macro will write 1 to get the input channel_n interrupt flag.

Definition at line 383 of file ecap.h.

◆ ECAP_GET_CNT_HOLD_VALUE

#define ECAP_GET_CNT_HOLD_VALUE (   ecap,
  u32Index 
)

This macro is used to get input capture counter hold value.

Parameters
[in]ecapSpecify ECAP port
[in]u32IndexThe input channel number
Returns
Capture counter hold value

This macro will get a hold value of input capture channel_n.

Definition at line 430 of file ecap.h.

◆ ECAP_GET_CNT_VALUE

#define ECAP_GET_CNT_VALUE (   ecap)

This macro is used to get input capture counter value.

Parameters
[in]ecapSpecify ECAP port
Returns
Capture counter value

This macro will get a counter value of input capture.

Definition at line 417 of file ecap.h.

◆ ECAP_GET_INT_STATUS

#define ECAP_GET_INT_STATUS (   ecap)

This macro is used to read input capture status.

Parameters
[in]ecapSpecify ECAP port
Returns
Input capture status flags

This macro will get the input capture interrupt status.

Definition at line 368 of file ecap.h.

◆ ECAP_NOISE_FILTER_DISABLE

#define ECAP_NOISE_FILTER_DISABLE (   ecap)

This macro is used to disable noise filter.

Parameters
[in]ecapSpecify ECAP port
Returns
None

This macro will disable the noise filter of input capture.

Definition at line 100 of file ecap.h.

◆ ECAP_NOISE_FILTER_ENABLE

#define ECAP_NOISE_FILTER_ENABLE (   ecap,
  u32ClkSel 
)

This macro is used to enable noise filter.

Parameters
[in]ecapSpecify ECAP port
[in]u32ClkSelSelect noise filter clock divide number
Returns
None

This macro will enable the noise filter of input capture and set noise filter clock divide.

Definition at line 116 of file ecap.h.

◆ ECAP_SEL_CAPTURE_EDGE

#define ECAP_SEL_CAPTURE_EDGE (   ecap,
  u32Index,
  u32Edge 
)

This macro is used to select input channel edge detection.

Parameters
[in]ecapSpecify ECAP port
[in]u32IndexThe input channel number
[in]u32EdgeThe input source
Returns
None

This macro will select input capture can detect falling edge, rising edge or either rising or falling edge change.

Definition at line 313 of file ecap.h.

◆ ECAP_SEL_INPUT_SRC

#define ECAP_SEL_INPUT_SRC (   ecap,
  u32Index,
  u32Src 
)

This macro is used to select input channel source.

Parameters
[in]ecapSpecify ECAP port
[in]u32IndexThe input channel number
[in]u32SrcThe input source
Returns
None

This macro will select the input source from ICx, CHx.

Definition at line 158 of file ecap.h.

◆ ECAP_SEL_RELOAD_TRIG_SRC

#define ECAP_SEL_RELOAD_TRIG_SRC (   ecap,
  u32TrigSrc 
)

This macro is used to select ECAP counter reload trigger source.

Parameters
[in]ecapSpecify ECAP port
[in]u32TrigSrcThe input source
Returns
None

This macro will select capture counter reload trigger source.

Definition at line 327 of file ecap.h.

◆ ECAP_SEL_TIMER_CLK_DIV

#define ECAP_SEL_TIMER_CLK_DIV (   ecap,
  u32Clkdiv 
)

This macro is used to select capture timer clock divide.

Parameters
[in]ecapSpecify ECAP port
[in]u32ClkdivThe input source
Returns
None

This macro will select capture timer clock has a pre-divider with eight divided option.

Definition at line 345 of file ecap.h.

◆ ECAP_SEL_TIMER_CLK_SRC

#define ECAP_SEL_TIMER_CLK_SRC (   ecap,
  u32ClkSrc 
)

This macro is used to select capture timer/counter clock source.

Parameters
[in]ecapSpecify ECAP port
[in]u32ClkSrcThe input source
Returns
None

This macro will select capture timer/clock clock source.

Definition at line 359 of file ecap.h.

◆ ECAP_SET_CNT_CLEAR_EVENT

#define ECAP_SET_CNT_CLEAR_EVENT (   ecap,
  u32Event 
)

This macro is used to set event to clear capture counter.

Parameters
[in]ecapSpecify ECAP port
[in]u32EventThe input channel number
Returns
None

This macro will enable and select compare or capture event that can clear capture counter.

Definition at line 254 of file ecap.h.

◆ ECAP_SET_CNT_CMP

#define ECAP_SET_CNT_CMP (   ecap,
  u32Val 
)

This macro is used to set input capture counter compare value.

Parameters
[in]ecapSpecify ECAP port
[in]u32ValInput capture compare value
Returns
None

This macro will set a compare value of input capture counter.

Definition at line 440 of file ecap.h.

◆ ECAP_SET_CNT_VALUE

#define ECAP_SET_CNT_VALUE (   ecap,
  u32Val 
)

This macro is used to set input capture counter value.

Parameters
[in]ecapSpecify ECAP port
[in]u32ValCounter value
Returns
None

This macro will set a counter value of input capture.

Definition at line 408 of file ecap.h.

◆ ECAP_SET_NOISE_FILTER_CLKDIV

#define ECAP_SET_NOISE_FILTER_CLKDIV (   ecap,
  u32ClkSel 
)

This macro is used to select noise filter clock pre-divide number.

Parameters
[in]ecapSpecify ECAP port
[in]u32ClkSelThe noise filter clock divide number
Returns
None

This macro will set the sampling frequency of the noise filter cock.

Definition at line 91 of file ecap.h.

Function Documentation

◆ ECAP_Close()

void ECAP_Close ( ECAP_T ecap)

Disable ECAP function.

Parameters
[in]ecapThe pointer of the specified ECAP module.
Returns
None

This macro disable input capture function.

Definition at line 50 of file ecap.c.

◆ ECAP_DisableINT()

void ECAP_DisableINT ( ECAP_T ecap,
uint32_t  u32Mask 
)

This macro is used to disable input channel interrupt.

Parameters
[in]ecapSpecify ECAP port
[in]u32MaskThe input channel number
Returns
None

This macro will disable the input channel_n interrupt.

Definition at line 96 of file ecap.c.

◆ ECAP_EnableINT()

void ECAP_EnableINT ( ECAP_T ecap,
uint32_t  u32Mask 
)

This macro is used to enable input channel interrupt.

Parameters
[in]ecapSpecify ECAP port
[in]u32MaskThe input channel Mask
Returns
None

This macro will enable the input channel_n interrupt.

Definition at line 68 of file ecap.c.

◆ ECAP_Open()

void ECAP_Open ( ECAP_T ecap,
uint32_t  u32FuncMask 
)

Enable ECAP function.

Parameters
[in]ecapThe pointer of the specified ECAP module.
[in]u32FuncMaskInput capture function select
Returns
None

This macro enable input capture function and select compare and reload function.

Definition at line 33 of file ecap.c.