📄 f281xbdcpwm.h
字号:
/* ==================================================================================
File name: F281XBDCPWM.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 F281XBDCPWM.C.
dc-bus+ ------------------------
| |
[1] [3]
|----(dc-motor)----|
[2] [4]
| |
dc-bus- ------------------------
Target: TMS320F281x family
=====================================================================================
History:
-------------------------------------------------------------------------------------
04-15-2005 Version 3.20: Using DSP281x v. 1.00 or higher
---------------------------------------------------------------------------------- */
#ifndef __F281X_BDCPWM_H__
#define __F281X_BDCPWM_H__
#include "f281xbmsk.h"
/*----------------------------------------------------------------------------
Initialization constant for the F281X Timer TxCON for PWM Generation.
Sets up the timer to run free upon emulation suspend, continuous up mode
prescaler 1, timer enabled.
----------------------------------------------------------------------------*/
#define BDCPWM_INIT_STATE (FREE_RUN_FLAG + \
TIMER_CONT_UP + \
TIMER_CLK_PRESCALE_X_1 + \
TIMER_ENABLE_BY_OWN + \
TIMER_ENABLE)
/*-----------------------------------------------------------------------------
Define the structure of the PWM Driver Object
-----------------------------------------------------------------------------*/
typedef struct {
Uint16 Rotation; // Input: 0 = PWM1&4 enabled, 1 = PWM2&3 enabled (Q0)
int16 MfuncPeriod; // Input: Period scaler (Q15)
int16 DutyFunc; // Input: PWM period modulation input (Q15)
Uint16 PeriodMax; // Parameter: Maximum period (Q0)
Uint16 PwmActive; // Parameter: 0 = PWM active low, 1 = PWM active high (0 or 1)
void (*init)(); // Pointer to the init function
void (*update)(); // Pointer to the update function
} PWMGEN ;
/*
The "PwmActive" setting depends on Power devices.
when PwmActive = 1 (active high) implies the power device turns ON with a HIGH gate signal.
PwmActive = 0 (active low) implies the power device turns ON with a LOW gate signal.
This polarity definition is not the same as the PWM polarity(Active High/Active Low)
defined by the ACTRA register in x281x. The setting chosen here is applicable only
when ACTRA is configured to generate Active High PWM.
*/
/*-----------------------------------------------------------------------------
Define a PWMGEN_handle
-----------------------------------------------------------------------------*/
typedef PWMGEN *PWMGEN_handle;
/*------------------------------------------------------------------------------
Default Initializers for the F281X PWMGEN Object
------------------------------------------------------------------------------*/
#define F281X_EV1_BDC_PWM_GEN {0, \
0x7FFF, \
0x4000, \
0x4000, \
1, \
(void (*)(Uint32))F281X_EV1_BDC_PWM_Init, \
(void (*)(Uint32))F281X_EV1_BDC_PWM_Update \
}
#define F281X_EV2_BDC_PWM_GEN {0, \
0x7FFF, \
0x4000, \
0x4000, \
1, \
(void (*)(Uint32))F281X_EV2_BDC_PWM_Init, \
(void (*)(Uint32))F281X_EV2_BDC_PWM_Update \
}
#define PWMGEN_DEFAULTS F281X_EV1_BDC_PWM_GEN
/*------------------------------------------------------------------------------
Prototypes for the functions in F281XBDCPWM.C
------------------------------------------------------------------------------*/
void F281X_EV1_BDC_PWM_Init(PWMGEN_handle);
void F281X_EV1_BDC_PWM_Update(PWMGEN_handle);
#endif // __F281X_BDCPWM_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -