⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 f2407bldcpwm1.c

📁 TI的digital motor control lib的源代码。了解TI的编程规范
💻 C
字号:
/* ==================================================================================
File name:       F2407BLDCPWM1.C
                    
Originator:	Digital Control Systems Group
			Texas Instruments
Description:                                   
This file contains source for the Full Compare PWM  driver initialization    
for the F2407. 
Applicability of these functions is indicated in the Table 1               		
=====================================================================================
History:
-------------------------------------------------------------------------------------
 9-15-2000	Release	Rev 1.0                                                   */
/* ================================================================================ */
/*                           T A B L E      1                                       */
/*================================================================================  */
/*     Function Name    |    Applicability                                          */
/*================================================================================  */
/*                      |      F240 | F241| F243 | LF2402 | LF2406 | LF2407         */
/*                      |           |     |      |        |        |                */
/* F2407_BLDC_PWM_Init  |           |     |      |    Y   |   Y    |    Y           */
/*================================================================================  */
/*================================================================================  */
/* Routine Name: PWM Init Routine        Routine Type: C Callable                   */
/*                                                                                  */
/* Description:                                                                     */
/*                                                                                  */
/*                                                                                  */
/*  C prototype : int F2407_BLDC_PWM_Init(PWMGEN *p) Though the structure members   */
/*  are not used in the code for consistency structure pointer is passed.           */
/*  History:  Created   August 22, 2000                                             */
/* ================================================================================ */

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

int F2407_BLDC_PWM_Init(PWMGEN *p) 
{       SCSR1|=0x0004;                       /* Turn EVA Clocks on            */
        T1PR=p->period_max;                  /* Init Timer 1 period Register  */
        T1CON=PWM_INIT_STATE;                /* Init PWM Operation         */
    
        ACTRA=0x0000;                
        GPTCONA=0x0000;
        COMCONA=0xa200;

        MCRA=MCRA|0x0fc0;                
        
        return(0);

}

 

⌨️ 快捷键说明

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