setdcoc7pwm.c

来自「Mplab C30编译器」· C语言 代码 · 共 22 行

C
22
字号
#include <outcompare.h>

#ifdef _OC7IF

/********************************************************************
*    Function Name:  SetDCOC7PWM                                    *
*    Description:    This routine writes the duty cycle OCRS reg    *
*    Parameters:     unsigned int duty cycle                        *
*    Return Value:   None                                           *
********************************************************************/

void  SetDCOC7PWM(unsigned int dutycycle)
{   
    /* check OC is in PWM Mode.*/
    if((OC7CONbits.OCM & 0x06) == 0x06) 
       OC7RS = dutycycle; /* assign to OCRS */
}

#else
#warning "Does not build on this target"
#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?