📄 closesmpspwm.c
字号:
#if defined(__dsPIC30F__)
#include <p30fxxxx.h>
#elif defined(__dsPIC33F__)
#include <p33Fxxxx.h>
#endif
#include "smpspwm.h"
#ifdef _PSEMIF
/*************************************************************************
* Function Name : CloseSmpsPWM
* Description : This function disables the Power Supply PWM module and clears the PWM,
* Faults, Interrupt Enable and Flag bits. This function also clears the PTCON,
* PWMCON1, PWMCON2, PWMCON3, and PWMCON4 registers.
* Parameters : void
* Return Value : None
**************************************************************************/
void CloseSmpsPWM(void)
{
/* Clear the PWM Interrupt status Flags of PWMGEN #1, PWMGEN #2 PWMGEN #3, PWMGEN #4 */
IFS1bits.PWM1IF = 0;
IFS1bits.PWM2IF = 0;
#ifdef _PWM3IF
IFS1bits.PWM3IF = 0;
IFS1bits.PWM4IF = 0;
#endif
IFS1bits.PSEMIF = 0;
/* Clear the PWM Interrupt control registers of PWMGEN #1, PWMGEN #2 PWMGEN #3, PWMGEN #4 */
IEC1bits.PWM1IE = 0;
IEC1bits.PWM2IE = 0;
#ifdef _PWM3IF
IEC1bits.PWM3IE = 0;
IEC1bits.PWM4IE = 0;
#endif
IEC1bits.PSEMIE = 0;
/* Clear the PWM control registers */
PTCON = 0;
PWMCON1 = 0;
PWMCON2 = 0;
#ifdef _PWM3IF
PWMCON3 = 0;
PWMCON4 = 0;
#endif
}
#else
#warning "Does not build on this target"
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -