f2407pwm1.c

来自「TI公司24X系列DSP控制无刷直流电机」· C语言 代码 · 共 51 行

C
51
字号
/* ==================================================================================
File name:       F2407PWM1.C
                    
Originator:	Digital Control Systems Group
			Texas Instruments
Description:                                   
This file contains source for the Full Compare PWM  drivers for the F243 
Applicability of these functions is indicated in the Table 1
=====================================================================================
History:
-------------------------------------------------------------------------------------
 9-15-2000	Release	Rev 1.00                                                   */
/*----------------------------------------------------------------------------*/
/*                           T A B L E      1                                 */
/*----------------------------------------------------------------------------*/
/*     Function Name    |    Applicability                                    */
/*----------------------------------------------------------------------------*/
/*                      |      F240 | F241| F243 | LF2402 | LF2406 | LF2407   */
/*                      |           |     |      |        |        |          */
/* F2407_EV1_PWM_Init   |           |     |      |        |   Y    |    Y     */
/*----------------------------------------------------------------------------*/


#include "..\include\regs240x.h" 
#include "..\include\F2407PWM.h"
#include "..\include\override.h"




int F2407_EV1_PWM_Init(PWMGEN *p) 
{       SCSR1|=0x0004;                       /* Turn EVA Clocks on            */
        T1PR=p->period_max;                  /* Init Timer 1 period Register  */
        T1CON=PWM_INIT_STATE;                /* Symmetrical Operation         */
        DBTCONA=DBTCON_INIT_STATE;                                    
        ACTRA=ACTR_INIT_STATE;                

        COMCONA=0xa200;

        CMPR1=p->period_max;
        CMPR2=p->period_max;
        CMPR3=p->period_max;
        MCRA=MCRA|0x0fc0;                /* Set up the full compare PWM pins 
                                            to primary functions.*/

        return(0);

}


⌨️ 快捷键说明

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