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

📄 f07pwmdac.h

📁 TI的digital motor control lib的源代码。了解TI的编程规范
💻 H
字号:
/* ==================================================================================
File name:        F07PWMDAC.H                     
                    
Originator:	Digital Control Systems Group
			Texas Instruments
Description:  
Header file containing data type and object definitions and 
initializers. Also contains prototypes for the functions in F07PWMDAC1.C and F07PWMDAC2.ASM.
=====================================================================================
 History:
-------------------------------------------------------------------------------------
 12-10-2000	Release	Rev 1.0                                                  
---------------------------------------------------------------------------------- */

#ifndef __F07PWMDAC_H__
#define __F07PWMDAC_H__
#include "..\include\F2407BMSK.H"

/*----------------------------------------------------------------------------
Initialization constant for the F2407 Timer T3CON for PWMDAC Generation. 
Sets up the timer to run free upon emulation suspend, continuous up-down mode
prescaler 1, timer enabled.
----------------------------------------------------------------------------*/
#define PWMDAC_INIT_STATE  (FREE_RUN_FLAG +         \
                        TIMER_CONT_UPDN +        \
                        TIMER_CLK_PRESCALE_X_1 + \
                        TIMER_ENABLE_BY_OWN    + \
                        TIMER_ENABLE)
/*----------------------------------------------------------------------------
Initialization constant for the F2407 ACTRx register for PWMDAC Generation. 
Sets up PWMDAC polarities.
----------------------------------------------------------------------------*/
#define ACTRB_INIT_STATE ( COMPARE1_AL + \
                          COMPARE2_AH + \
                          COMPARE3_AL + \
                          COMPARE4_AH + \
                          COMPARE5_AL + \
                          COMPARE6_AH )

/*----------------------------------------------------------------------------
Initialization constant for the F2407 DBTCONx register for PWMDAC Generation. 
Sets up the dead band for PWM and sets up dead band values.
----------------------------------------------------------------------------*/
#define DBTCONB_INIT_STATE ( DBT_VAL_9 +  \
                            EDBT3_EN   +  \
                            EDBT2_EN   +  \
                            EDBT1_EN   +  \
                            DBTPS_X4 )
/*-----------------------------------------------------------------------------
Define the structure of the PWMDAC Driver Object 
-----------------------------------------------------------------------------*/
typedef struct {   
  	int *PWM_DAC_IPTR0;	/* Pointer to source data output on PWMDAC channel 0 */
	int *PWM_DAC_IPTR1;	/* Pointer to source data output on PWMDAC channel 1 */
	int *PWM_DAC_IPTR2;	/* Pointer to source data output on PWMDAC channel 2 */
	int pwmdac_period;  	/* PWMDAC period in usec  (Q0) */
    int (*init)();     	/* Pointer to the init function */
   	int (*update)();   	/* Pointer to the update function */
 	} PWMDAC ;          

/*------------------------------------------------------------------------------
Default Initializers for the F2407 PWMGEN Object 
------------------------------------------------------------------------------*/
#define PWMDAC_DEFAULTS {(int *)0x300, \
                         (int *)0x300, \
                         (int *)0x300, \
                         50,         \
                         (int (*)(int))F2407_PWMDAC_Init,  \
                         (int (*)(int))F2407_PWMDAC_Update \
                        }
/*------------------------------------------------------------------------------
 Prototypes for the functions in F07PWMDAC1.C, F07PWMDAC2.ASM 
------------------------------------------------------------------------------*/
int F2407_PWMDAC_Init(PWMDAC *);
int F2407_PWMDAC_Update(PWMDAC *);

#endif  /*__F07PWMDAC_H__*/

⌨️ 快捷键说明

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