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

📄 f280xpwm_res.h

📁 DSP280X芯片的编程简单例子
💻 H
字号:
/* ==================================================================================
File name:        F280XPWM_RES.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 F280XPWM_RES.C.

Target: TMS320F280x family
              
=====================================================================================
History:
-------------------------------------------------------------------------------------
 04-15-2005	Version 3.20: Using DSP280x v. 1.10 or higher 
------------------------------------------------------------------------------------*/

#ifndef __F280XPWM_RES_H__
#define __F280XPWM_RES_H__

#include "f280xbmsk.h"

/*----------------------------------------------------------------------------
Initialization constant for the F280X Time-Base Control Registers for PWM Generation. 
Sets up the timer to run free upon emulation suspend, count up-down mode
prescaler 1.
----------------------------------------------------------------------------*/
#define PWM_RESOLVER_INIT_STATE ( FREE_RUN_FLAG +         \
                                  PRDLD_IMMEDIATE  +       \
                                  TIMER_CNT_UPDN +         \
                                  HSPCLKDIV_PRESCALE_X_1 + \
                                  CLKDIV_PRESCALE_X_1  +   \
                                  PHSDIR_CNT_UP    +       \
                                  CNTLD_DISABLE )


/*----------------------------------------------------------------------------
Initialization constant for the F280X Compare Control Register. 
----------------------------------------------------------------------------*/
#define PWM_RESOLVER_CMPCTL_INIT_STATE ( LOADAMODE_ZRO + \
                                         LOADBMODE_ZRO + \
                                         SHDWAMODE_SHADOW + \
                                         SHDWBMODE_SHADOW )

/*----------------------------------------------------------------------------
Initialization constant for the F280X Action Qualifier Output A Register. 
----------------------------------------------------------------------------*/
#define PWM_RESOLVER_AQCTLA_INIT_STATE ( CAU_SET + CAD_CLEAR )

/*----------------------------------------------------------------------------
Initialization constant for the F280X Dead-Band Generator registers for PWM Generation. 
Sets up the dead band for PWM and sets up dead band values.
----------------------------------------------------------------------------*/
#define PWM_RESOLVER_DBCTL_INIT_STATE  ( BP_ENABLE + POLSEL_ACTIVE_HI_CMP )

#define PWM_RESOLVER_DBCNT_INIT_STATE   100   // 100 counts = 1 usec (delay) * 100 count/usec (for TBCLK = SYSCLK/1)

/*----------------------------------------------------------------------------
Initialization constant for the F280X PWM Chopper Control register for PWM Generation. 
----------------------------------------------------------------------------*/
#define  PWM_RESOLVER_PCCTL_INIT_STATE  CHPEN_DISABLE

/*----------------------------------------------------------------------------
Initialization constant for the F280X Trip Zone Select Register 
----------------------------------------------------------------------------*/
#define  PWM_RESOLVER_TZSEL_INIT_STATE  DISABLE_TZSEL
              
/*----------------------------------------------------------------------------
Initialization constant for the F280X Trip Zone Control Register 
----------------------------------------------------------------------------*/
#define  PWM_RESOLVER_TZCTL_INIT_STATE ( TZA_HI_Z + TZB_HI_Z + \
                            DCAEVT1_HI_Z + DCAEVT2_HI_Z + \
                            DCBEVT1_HI_Z + DCBEVT2_HI_Z )


/*-----------------------------------------------------------------------------
Define the structure of the RESOLVER_PWM Driver Object 
-----------------------------------------------------------------------------*/
typedef struct {   
        int16 RefSignal;       // Input: Excitation reference signal (Q15)
        Uint16 PeriodMax;      // Parameter: PWM Half-Period in CPU clock cycles (Q0)
        void (*init)();        // Pointer to the init function 
     	void (*update)();      // Pointer to the update function
        } RESOLVER_PWM ;

/*-----------------------------------------------------------------------------
Define a RESOLVER_PWM_handle
-----------------------------------------------------------------------------*/
typedef RESOLVER_PWM *RESOLVER_PWM_handle;

/*------------------------------------------------------------------------------
Default Initializers for the F280X RESOLVER_PWM Object 
------------------------------------------------------------------------------*/
#define F280X_RESOLVER_PWM    { 0,4000, \
                               (void (*)(Uint32))F280X_Resolver_PWM_Init,  \
                               (void (*)(Uint32))F280X_Resolver_PWM_Update,  \
                               }

#define RESOLVER_PWM_DEFAULTS 	F280X_RESOLVER_PWM
/*------------------------------------------------------------------------------
 Prototypes for the functions in F280X_RESOLVER.C
------------------------------------------------------------------------------*/
void F280X_Resolver_PWM_Init(RESOLVER_PWM_handle);
void F280X_Resolver_PWM_Update(RESOLVER_PWM_handle);

#endif  // __F280XPWM_RES_H__

⌨️ 快捷键说明

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