setdcoc1pwm.c
来自「Microchip的官方PIC24H系列16位单片机的外设源程序库。」· C语言 代码 · 共 17 行
C
17 行
#include <p30fxxxx.h>
#include <outcompare.h>
/********************************************************************
* Function Name: SetDCOC1PWM *
* Description: This routine writes the duty cycle OCRS reg *
* Parameters: unsigned int duty cycle *
* Return Value: None *
********************************************************************/
void SetDCOC1PWM(unsigned int dutycycle)
{
/* check if OC is in PWM Mode */
if((OC1CONbits.OCM & 0x06) == 0x06)
OC1RS = dutycycle; /* assign to OCRS */
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?