![]() |
M480 BSP V3.05.005
The Board Support Package for M480 Series
|
Macros | |
#define | TPWM_ENABLE_PWM_MODE(timer) |
Enable PWM Counter Mode. More... | |
#define | TPWM_DISABLE_PWM_MODE(timer) |
Disable PWM Counter Mode. More... | |
#define | TPWM_ENABLE_INDEPENDENT_MODE(timer) |
Enable Independent Mode. More... | |
#define | TPWM_ENABLE_COMPLEMENTARY_MODE(timer) |
Enable Complementary Mode. More... | |
#define | TPWM_SET_COUNTER_TYPE(timer, type) |
Set Counter Type. More... | |
#define | TPWM_START_COUNTER(timer) |
Start PWM Counter. More... | |
#define | TPWM_STOP_COUNTER(timer) |
Stop PWM Counter. More... | |
#define | TPWM_SET_PRESCALER(timer, prescaler) |
Set Counter Clock Prescaler. More... | |
#define | TPWM_GET_PRESCALER(timer) |
Get Counter Clock Prescaler. More... | |
#define | TPWM_SET_PERIOD(timer, period) |
Set Counter Period. More... | |
#define | TPWM_GET_PERIOD(timer) |
Get Counter Period. More... | |
#define | TPWM_SET_CMPDAT(timer, cmp) |
Set Comparator Value. More... | |
#define | TPWM_GET_CMPDAT(timer) |
Get Comparator Value. More... | |
#define | TPWM_CLEAR_COUNTER(timer) |
Clear Counter. More... | |
#define | TPWM_SW_TRIGGER_BRAKE(timer, type) |
Software Trigger Brake Event. More... | |
#define | TPWM_ENABLE_OUTPUT(timer, ch) |
Enable Output Function. More... | |
#define | TPWM_SET_OUTPUT_INVERSE(timer, ch) |
Set Output Inverse. More... | |
#define | TPWM_SET_MASK_OUTPUT(timer, ch, level) |
Enable Output Function. More... | |
#define | TPWM_SET_COUNTER_SYNC_MODE(timer, mode) |
Set Counter Synchronous Mode. More... | |
#define | TPWM_TRIGGER_COUNTER_SYNC(timer) |
Trigger Counter Synchronous. More... | |
#define | TPWM_ENABLE_ZERO_INT(timer) |
Enable Zero Event Interrupt. More... | |
#define | TPWM_DISABLE_ZERO_INT(timer) |
Disable Zero Event Interrupt. More... | |
#define | TPWM_GET_ZERO_INT_FLAG(timer) |
Get Zero Event Interrupt Flag. More... | |
#define | TPWM_CLEAR_ZERO_INT_FLAG(timer) |
Clear Zero Event Interrupt Flag. More... | |
#define | TPWM_ENABLE_PERIOD_INT(timer) |
Enable Period Event Interrupt. More... | |
#define | TPWM_DISABLE_PERIOD_INT(timer) |
Disable Period Event Interrupt. More... | |
#define | TPWM_GET_PERIOD_INT_FLAG(timer) |
Get Period Event Interrupt Flag. More... | |
#define | TPWM_CLEAR_PERIOD_INT_FLAG(timer) |
Clear Period Event Interrupt Flag. More... | |
#define | TPWM_ENABLE_CMP_UP_INT(timer) |
Enable Compare Up Event Interrupt. More... | |
#define | TPWM_DISABLE_CMP_UP_INT(timer) |
Disable Compare Up Event Interrupt. More... | |
#define | TPWM_GET_CMP_UP_INT_FLAG(timer) |
Get Compare Up Event Interrupt Flag. More... | |
#define | TPWM_CLEAR_CMP_UP_INT_FLAG(timer) |
Clear Compare Up Event Interrupt Flag. More... | |
#define | TPWM_ENABLE_CMP_DOWN_INT(timer) |
Enable Compare Down Event Interrupt. More... | |
#define | TPWM_DISABLE_CMP_DOWN_INT(timer) |
Disable Compare Down Event Interrupt. More... | |
#define | TPWM_GET_CMP_DOWN_INT_FLAG(timer) |
Get Compare Down Event Interrupt Flag. More... | |
#define | TPWM_CLEAR_CMP_DOWN_INT_FLAG(timer) |
Clear Compare Down Event Interrupt Flag. More... | |
#define | TPWM_GET_REACH_MAX_CNT_STATUS(timer) |
Get Counter Reach Maximum Count Status. More... | |
#define | TPWM_CLEAR_REACH_MAX_CNT_STATUS(timer) |
Clear Counter Reach Maximum Count Status. More... | |
#define | TPWM_GET_TRG_ADC_STATUS(timer) |
Get Trigger ADC Status. More... | |
#define | TPWM_CLEAR_TRG_ADC_STATUS(timer) |
Clear Trigger ADC Status. More... | |
#define | TPWM_SET_BRAKE_PIN_HIGH_DETECT(timer) |
Set Brake Event at Brake Pin High or Low-to-High. More... | |
#define | TPWM_SET_BRAKE_PIN_LOW_DETECT(timer) |
Set Brake Event at Brake Pin Low or High-to-Low. More... | |
#define | TPWM_SET_BRAKE_PIN_SOURCE(timer, pin) |
Set External Brake Pin Source. More... | |
Functions | |
void | TPWM_SetCounterClockSource (TIMER_T *timer, uint32_t u32CntClkSrc) |
Set PWM Counter Clock Source. More... | |
uint32_t | TPWM_ConfigOutputFreqAndDuty (TIMER_T *timer, uint32_t u32Frequency, uint32_t u32DutyCycle) |
Configure PWM Output Frequency and Duty Cycle. More... | |
void | TPWM_EnableDeadTime (TIMER_T *timer, uint32_t u32DTCount) |
Enable Dead-Time Function. More... | |
void | TPWM_EnableDeadTimeWithPrescale (TIMER_T *timer, uint32_t u32DTCount) |
Enable Dead-Time Function. More... | |
void | TPWM_DisableDeadTime (TIMER_T *timer) |
Disable Dead-Time Function. More... | |
void | TPWM_EnableCounter (TIMER_T *timer) |
Enable PWM Counter. More... | |
void | TPWM_DisableCounter (TIMER_T *timer) |
Disable PWM Generator. More... | |
void | TPWM_EnableTriggerADC (TIMER_T *timer, uint32_t u32Condition) |
Enable Trigger ADC. More... | |
void | TPWM_DisableTriggerADC (TIMER_T *timer) |
Disable Trigger ADC. More... | |
void | TPWM_EnableFaultBrake (TIMER_T *timer, uint32_t u32CH0Level, uint32_t u32CH1Level, uint32_t u32BrakeSource) |
Enable Fault Brake Function. More... | |
void | TPWM_EnableFaultBrakeInt (TIMER_T *timer, uint32_t u32IntSource) |
Enable Fault Brake Interrupt. More... | |
void | TPWM_DisableFaultBrakeInt (TIMER_T *timer, uint32_t u32IntSource) |
Disable Fault Brake Interrupt. More... | |
uint32_t | TPWM_GetFaultBrakeIntFlag (TIMER_T *timer, uint32_t u32IntSource) |
Indicate Fault Brake Interrupt Flag. More... | |
void | TPWM_ClearFaultBrakeIntFlag (TIMER_T *timer, uint32_t u32IntSource) |
Clear Fault Brake Interrupt Flags. More... | |
void | TPWM_SetLoadMode (TIMER_T *timer, uint32_t u32LoadMode) |
Enable load mode of selected channel. More... | |
void | TPWM_EnableBrakePinDebounce (TIMER_T *timer, uint32_t u32BrakePinSrc, uint32_t u32DebounceCnt, uint32_t u32ClkSrcSel) |
Enable brake pin noise filter function. More... | |
void | TPWM_DisableBrakePinDebounce (TIMER_T *timer) |
Disable brake pin noise filter function. More... | |
void | TPWM_EnableBrakePinInverse (TIMER_T *timer) |
Enable brake pin inverse function. More... | |
void | TPWM_DisableBrakePinInverse (TIMER_T *timer) |
Disable brake pin inverse function. More... | |
void | TPWM_SetBrakePinSource (TIMER_T *timer, uint32_t u32BrakePinNum) |
Set brake pin source. More... | |
#define TPWM_CLEAR_CMP_DOWN_INT_FLAG | ( | timer | ) |
Clear Compare Down Event Interrupt Flag.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This macro clears compare down event interrupt flag.
Definition at line 619 of file timer_pwm.h.
#define TPWM_CLEAR_CMP_UP_INT_FLAG | ( | timer | ) |
Clear Compare Up Event Interrupt Flag.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This macro clears compare up event interrupt flag.
Definition at line 570 of file timer_pwm.h.
#define TPWM_CLEAR_COUNTER | ( | timer | ) |
Clear Counter.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This macro is used to clear counter of specified TIMER PWM.
Definition at line 319 of file timer_pwm.h.
#define TPWM_CLEAR_PERIOD_INT_FLAG | ( | timer | ) |
Clear Period Event Interrupt Flag.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This macro clears period event interrupt flag.
Definition at line 521 of file timer_pwm.h.
#define TPWM_CLEAR_REACH_MAX_CNT_STATUS | ( | timer | ) |
Clear Counter Reach Maximum Count Status.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This macro clears reach maximum count status.
Definition at line 644 of file timer_pwm.h.
#define TPWM_CLEAR_TRG_ADC_STATUS | ( | timer | ) |
Clear Trigger ADC Status.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This macro is used to clear PWM counter compare event trigger ADC status.
Definition at line 669 of file timer_pwm.h.
#define TPWM_CLEAR_ZERO_INT_FLAG | ( | timer | ) |
Clear Zero Event Interrupt Flag.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This macro clears zero event interrupt flag.
Definition at line 472 of file timer_pwm.h.
#define TPWM_DISABLE_CMP_DOWN_INT | ( | timer | ) |
Disable Compare Down Event Interrupt.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This macro is used to disable the compare down event interrupt function.
Definition at line 594 of file timer_pwm.h.
#define TPWM_DISABLE_CMP_UP_INT | ( | timer | ) |
Disable Compare Up Event Interrupt.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This macro is used to disable the compare up event interrupt function.
Definition at line 545 of file timer_pwm.h.
#define TPWM_DISABLE_PERIOD_INT | ( | timer | ) |
Disable Period Event Interrupt.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This macro is used to disable the period event interrupt function.
Definition at line 496 of file timer_pwm.h.
#define TPWM_DISABLE_PWM_MODE | ( | timer | ) |
Disable PWM Counter Mode.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This macro is used to disable specified Timer channel as PWM counter mode, then timer counter mode is available.
Definition at line 164 of file timer_pwm.h.
#define TPWM_DISABLE_ZERO_INT | ( | timer | ) |
Disable Zero Event Interrupt.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This macro is used to disable the zero event interrupt function.
Definition at line 447 of file timer_pwm.h.
#define TPWM_ENABLE_CMP_DOWN_INT | ( | timer | ) |
Enable Compare Down Event Interrupt.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This macro is used to enable the compare down event interrupt function.
Definition at line 582 of file timer_pwm.h.
#define TPWM_ENABLE_CMP_UP_INT | ( | timer | ) |
Enable Compare Up Event Interrupt.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This macro is used to enable the compare up event interrupt function.
Definition at line 533 of file timer_pwm.h.
#define TPWM_ENABLE_COMPLEMENTARY_MODE | ( | timer | ) |
Enable Complementary Mode.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This macro is used to enable complementary mode of Timer PWM module and independent mode will be disabled.
Definition at line 188 of file timer_pwm.h.
#define TPWM_ENABLE_INDEPENDENT_MODE | ( | timer | ) |
Enable Independent Mode.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This macro is used to enable independent mode of TIMER PWM module and complementary mode will be disabled.
Definition at line 176 of file timer_pwm.h.
#define TPWM_ENABLE_OUTPUT | ( | timer, | |
ch | |||
) |
Enable Output Function.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
[in] | ch | Enable specified channel output function. Valid values are the combination of: |
This macro is used to enable output function of specified output pins.
Definition at line 352 of file timer_pwm.h.
#define TPWM_ENABLE_PERIOD_INT | ( | timer | ) |
Enable Period Event Interrupt.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This macro is used to enable the period event interrupt function.
Definition at line 484 of file timer_pwm.h.
#define TPWM_ENABLE_PWM_MODE | ( | timer | ) |
Enable PWM Counter Mode.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This macro is used to enable specified Timer channel as PWM counter mode, then timer counter mode is invalid.
Definition at line 151 of file timer_pwm.h.
#define TPWM_ENABLE_ZERO_INT | ( | timer | ) |
Enable Zero Event Interrupt.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This macro is used to enable the zero event interrupt function.
Definition at line 435 of file timer_pwm.h.
#define TPWM_GET_CMP_DOWN_INT_FLAG | ( | timer | ) |
Get Compare Down Event Interrupt Flag.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
0 | Compare down event interrupt did not occur |
1 | Compare down event interrupt occurred |
This macro indicates compare down event occurred or not.
Definition at line 607 of file timer_pwm.h.
#define TPWM_GET_CMP_UP_INT_FLAG | ( | timer | ) |
Get Compare Up Event Interrupt Flag.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
0 | Compare up event interrupt did not occur |
1 | Compare up event interrupt occurred |
This macro indicates compare up event occurred or not.
Definition at line 558 of file timer_pwm.h.
#define TPWM_GET_CMPDAT | ( | timer | ) |
Get Comparator Value.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This macro is used to get the comparator value of specified TIMER PWM.
Definition at line 307 of file timer_pwm.h.
#define TPWM_GET_PERIOD | ( | timer | ) |
Get Counter Period.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This macro is used to get the period of specified TIMER PWM.
Definition at line 281 of file timer_pwm.h.
#define TPWM_GET_PERIOD_INT_FLAG | ( | timer | ) |
Get Period Event Interrupt Flag.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
0 | Period event interrupt did not occur |
1 | Period event interrupt occurred |
This macro indicates period event occurred or not.
Definition at line 509 of file timer_pwm.h.
#define TPWM_GET_PRESCALER | ( | timer | ) |
Get Counter Clock Prescaler.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
Get the prescaler setting, the target counter clock divider is (CLKPSC + 1).
Definition at line 255 of file timer_pwm.h.
#define TPWM_GET_REACH_MAX_CNT_STATUS | ( | timer | ) |
Get Counter Reach Maximum Count Status.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
0 | Timer PWM counter never counts to maximum value |
1 | Timer PWM counter counts to maximum value, 0xFFFF |
This macro indicates Timer PWM counter has count to 0xFFFF or not.
Definition at line 632 of file timer_pwm.h.
#define TPWM_GET_TRG_ADC_STATUS | ( | timer | ) |
Get Trigger ADC Status.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
0 | Trigger ADC start conversion is not occur |
1 | Specified counter compare event has trigger ADC start conversion |
This macro is used to indicate PWM counter compare event has triggered ADC start conversion.
Definition at line 657 of file timer_pwm.h.
#define TPWM_GET_ZERO_INT_FLAG | ( | timer | ) |
Get Zero Event Interrupt Flag.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
0 | Zero event interrupt did not occur |
1 | Zero event interrupt occurred |
This macro indicates zero event occurred or not.
Definition at line 460 of file timer_pwm.h.
#define TPWM_SET_BRAKE_PIN_HIGH_DETECT | ( | timer | ) |
Set Brake Event at Brake Pin High or Low-to-High.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This macro is used to set detect brake event when external brake pin at high level or transfer from low to high.
Definition at line 682 of file timer_pwm.h.
#define TPWM_SET_BRAKE_PIN_LOW_DETECT | ( | timer | ) |
Set Brake Event at Brake Pin Low or High-to-Low.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This macro is used to set detect brake event when external brake pin at low level or transfer from high to low.
Definition at line 694 of file timer_pwm.h.
#define TPWM_SET_BRAKE_PIN_SOURCE | ( | timer, | |
pin | |||
) |
Set External Brake Pin Source.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
[in] | pin | The external brake pin source, could be one of following source |
This macro is used to set detect brake event when external brake pin at high level or transfer from low to high.
Definition at line 711 of file timer_pwm.h.
#define TPWM_SET_CMPDAT | ( | timer, | |
cmp | |||
) |
Set Comparator Value.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
[in] | cmp | Comparator of specified channel. Valid values are between 0x0~0xFFFF. |
This macro is used to set the comparator value of specified TIMER PWM.
Definition at line 295 of file timer_pwm.h.
#define TPWM_SET_COUNTER_SYNC_MODE | ( | timer, | |
mode | |||
) |
Set Counter Synchronous Mode.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
[in] | mode | Synchronous mode. Possible options are: |
This macro is used to set counter synchronous mode of specified Timer PWM module.
Definition at line 409 of file timer_pwm.h.
#define TPWM_SET_COUNTER_TYPE | ( | timer, | |
type | |||
) |
Set Counter Type.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
[in] | type | Timer PWM count type, could be one of the following type |
This macro is used to set Timer PWM counter type.
Definition at line 204 of file timer_pwm.h.
#define TPWM_SET_MASK_OUTPUT | ( | timer, | |
ch, | |||
level | |||
) |
Enable Output Function.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
[in] | ch | Enable specified channel output mask function. Valid values are the combination of: |
[in] | level | Output to high or low on specified mask channel. |
This macro is used to enable output function of specified output pins.
Definition at line 388 of file timer_pwm.h.
#define TPWM_SET_OUTPUT_INVERSE | ( | timer, | |
ch | |||
) |
Set Output Inverse.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
[in] | ch | Set specified channel output is inversed or not. Valid values are the combination of: |
This macro is used to enable output inverse of specified output pins.
Definition at line 369 of file timer_pwm.h.
#define TPWM_SET_PERIOD | ( | timer, | |
period | |||
) |
Set Counter Period.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
[in] | period | Period of specified channel. Valid values are between 0x0~0xFFFF. |
This macro is used to set the period of specified TIMER PWM.
Definition at line 269 of file timer_pwm.h.
#define TPWM_SET_PRESCALER | ( | timer, | |
prescaler | |||
) |
Set Counter Clock Prescaler.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
[in] | prescaler | Clock prescaler of specified channel. Valid values are between 0x0~0xFFF. |
This macro is used to set the prescaler of specified TIMER PWM.
Definition at line 243 of file timer_pwm.h.
#define TPWM_START_COUNTER | ( | timer | ) |
Start PWM Counter.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This macro is used to enable PWM generator and start counter counting.
Definition at line 216 of file timer_pwm.h.
#define TPWM_STOP_COUNTER | ( | timer | ) |
Stop PWM Counter.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This macro is used to stop PWM counter after current period is completed.
Definition at line 228 of file timer_pwm.h.
#define TPWM_SW_TRIGGER_BRAKE | ( | timer, | |
type | |||
) |
Software Trigger Brake Event.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
[in] | type | Type of brake trigger. Valid values are: |
This macro is used to trigger brake event by writing PWMSWBRK register.
Definition at line 335 of file timer_pwm.h.
#define TPWM_TRIGGER_COUNTER_SYNC | ( | timer | ) |
Trigger Counter Synchronous.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This macro is used to trigger synchronous event by specified TIMER PWM.
Definition at line 423 of file timer_pwm.h.
void TPWM_ClearFaultBrakeIntFlag | ( | TIMER_T * | timer, |
uint32_t | u32IntSource | ||
) |
Clear Fault Brake Interrupt Flags.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
[in] | u32IntSource | Interrupt source, could be one of following source |
This function is used to clear fault brake interrupt flags of selected source.
Definition at line 326 of file timer_pwm.c.
uint32_t TPWM_ConfigOutputFreqAndDuty | ( | TIMER_T * | timer, |
uint32_t | u32Frequency, | ||
uint32_t | u32DutyCycle | ||
) |
Configure PWM Output Frequency and Duty Cycle.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
[in] | u32Frequency | Target generator frequency. |
[in] | u32DutyCycle | Target generator duty cycle percentage. Valid range are between 0~100. 10 means 10%, 20 means 20%... |
This API is used to configure PWM output frequency and duty cycle in up count type and auto-reload operation mode.
Definition at line 55 of file timer_pwm.c.
void TPWM_DisableBrakePinDebounce | ( | TIMER_T * | timer | ) |
Disable brake pin noise filter function.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This function is used to disable external brake pin detector noise filter function.
Definition at line 392 of file timer_pwm.c.
void TPWM_DisableBrakePinInverse | ( | TIMER_T * | timer | ) |
Disable brake pin inverse function.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This function is used to disable PWM brake pin inverse function.
Definition at line 415 of file timer_pwm.c.
void TPWM_DisableCounter | ( | TIMER_T * | timer | ) |
Disable PWM Generator.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This function is used to disable PWM counter immediately by clear CNTEN (TIMERx_PWMCTL[0]) bit.
Definition at line 177 of file timer_pwm.c.
void TPWM_DisableDeadTime | ( | TIMER_T * | timer | ) |
Disable Dead-Time Function.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This function is used to enable Dead-time of selected channel.
Definition at line 149 of file timer_pwm.c.
void TPWM_DisableFaultBrakeInt | ( | TIMER_T * | timer, |
uint32_t | u32IntSource | ||
) |
Disable Fault Brake Interrupt.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
[in] | u32IntSource | Interrupt source, could be one of following source |
This function is used to disable fault brake interrupt.
Definition at line 289 of file timer_pwm.c.
void TPWM_DisableTriggerADC | ( | TIMER_T * | timer | ) |
Disable Trigger ADC.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This function is used to disable counter compare event to trigger ADC.
Definition at line 211 of file timer_pwm.c.
void TPWM_EnableBrakePinDebounce | ( | TIMER_T * | timer, |
uint32_t | u32BrakePinSrc, | ||
uint32_t | u32DebounceCnt, | ||
uint32_t | u32ClkSrcSel | ||
) |
Enable brake pin noise filter function.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
[in] | u32BrakePinSrc | The external brake pin source, could be one of following source |
[in] | u32DebounceCnt | This value controls the real debounce sample time. The target debounce sample time is (debounce sample clock period) * (u32DebounceCnt). |
[in] | u32ClkSrcSel | Brake pin detector debounce clock source, could be one of following source |
This function is used to enable external brake pin detector noise filter function.
Definition at line 375 of file timer_pwm.c.
void TPWM_EnableBrakePinInverse | ( | TIMER_T * | timer | ) |
Enable brake pin inverse function.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This function is used to enable PWM brake pin inverse function.
Definition at line 404 of file timer_pwm.c.
void TPWM_EnableCounter | ( | TIMER_T * | timer | ) |
Enable PWM Counter.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
This function is used to enable PWM generator and start counter counting.
Definition at line 163 of file timer_pwm.c.
void TPWM_EnableDeadTime | ( | TIMER_T * | timer, |
uint32_t | u32DTCount | ||
) |
Enable Dead-Time Function.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
[in] | u32DTCount | Dead-Time duration in PWM clock count, valid values are between 0x0~0xFFF, but 0x0 means there is no Dead-Time insertion. |
This function is used to enable Dead-Time function and counter source is the same as Timer PWM clock source.
Definition at line 118 of file timer_pwm.c.
void TPWM_EnableDeadTimeWithPrescale | ( | TIMER_T * | timer, |
uint32_t | u32DTCount | ||
) |
Enable Dead-Time Function.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
[in] | u32DTCount | Dead-Time duration in PWM clock count, valid values are between 0x0~0xFFF, but 0x0 means there is no Dead-Time insertion. |
This function is used to enable Dead-Time function and counter source is the Timer PWM clock source with prescale.
Definition at line 134 of file timer_pwm.c.
void TPWM_EnableFaultBrake | ( | TIMER_T * | timer, |
uint32_t | u32CH0Level, | ||
uint32_t | u32CH1Level, | ||
uint32_t | u32BrakeSource | ||
) |
Enable Fault Brake Function.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
[in] | u32CH0Level | PWMx_CH0 output level while fault brake event occurs. Valid value is one of following setting |
[in] | u32CH1Level | PWMx_CH1 output level while fault brake event occurs. Valid value is one of following setting |
[in] | u32BrakeSource | Fault brake source, combination of following source
|
This function is used to enable fault brake function.
Definition at line 251 of file timer_pwm.c.
void TPWM_EnableFaultBrakeInt | ( | TIMER_T * | timer, |
uint32_t | u32IntSource | ||
) |
Enable Fault Brake Interrupt.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
[in] | u32IntSource | Interrupt source, could be one of following source |
This function is used to enable fault brake interrupt.
Definition at line 271 of file timer_pwm.c.
void TPWM_EnableTriggerADC | ( | TIMER_T * | timer, |
uint32_t | u32Condition | ||
) |
Enable Trigger ADC.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
[in] | u32Condition | The condition to trigger ADC. It could be one of following conditions: |
This function is used to enable specified counter compare event to trigger ADC.
Definition at line 197 of file timer_pwm.c.
uint32_t TPWM_GetFaultBrakeIntFlag | ( | TIMER_T * | timer, |
uint32_t | u32IntSource | ||
) |
Indicate Fault Brake Interrupt Flag.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
[in] | u32IntSource | Interrupt source, could be one of following source |
0 | Fault brake interrupt did not occurred |
1 | Fault brake interrupt occurred |
This function is used to indicate fault brake interrupt flag occurred or not of selected source.
Definition at line 308 of file timer_pwm.c.
void TPWM_SetBrakePinSource | ( | TIMER_T * | timer, |
uint32_t | u32BrakePinNum | ||
) |
Set brake pin source.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
[in] | u32BrakePinNum | Brake pin selection. One of the following: |
This function is used to set PWM brake pin source.
Definition at line 431 of file timer_pwm.c.
void TPWM_SetCounterClockSource | ( | TIMER_T * | timer, |
uint32_t | u32CntClkSrc | ||
) |
Set PWM Counter Clock Source.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
[in] | u32CntClkSrc | PWM counter clock source, could be one of following source |
This function is used to set PWM counter clock source.
Definition at line 38 of file timer_pwm.c.
void TPWM_SetLoadMode | ( | TIMER_T * | timer, |
uint32_t | u32LoadMode | ||
) |
Enable load mode of selected channel.
[in] | timer | The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3. |
[in] | u32LoadMode | Timer PWM counter loading mode, could be one of following mode |
This function is used to enable load mode of selected channel.
Definition at line 345 of file timer_pwm.c.