Epwm.h File Reference

PWM Interface Routines. More...

#include "TIMotorLIB.h"
#include "SFO_V5.h"
#include "IQConstants.h"
#include "Utils.h"

Go to the source code of this file.

Data Structures

struct  PWM3phConfiguration
 three phase PWM configuration More...

Defines

#define EPWM1_INT_ACK   (0x1);
#define EPWM2_INT_ACK   (0x2);
#define EPWM3_INT_ACK   (0x4);
#define EPWM4_INT_ACK   (0x8);
#define EPWM5_INT_ACK   (0x10);
#define EPWM6_INT_ACK   (0x20);
#define PWM_OUTPUTS_SIZE   (12)
 number of pwm outputs

Enumerations

enum  EPWMX { EPWMA, EPWMB }
 

select EPWM device

More...
enum  PHSEN { MASTERPWM, SLAVEPWM }
 

select device as master or slave

More...
enum  ePWMenum {
  PWM1 = 0, PWM2 = 1, PWM3 = 2, PWM4 = 3,
  PWM5 = 4, PWM6 = 5
}
 

access to pwm devices individually

More...
enum  PWMMODE { NORMAL_MODE, HRPWM_MODE }
 

select normal mode or high resolution mode

More...
enum  PWMCARRIER { SAWTOOTH = TB_COUNT_UP, TRIANGLE = TB_COUNT_UPDOWN }
 

select carrier signal (sawtooth or triangle)

More...
enum  PWMMODULATION { SYMMETRICAL = CC_CTR_ZERO, ASYMMETRICAL = CC_CTR_ZERO_PRD }
 

select modulation (symmetrical, asymmetrical) for triangle pwm carrier

More...
enum  INTSEL { CTR_ZERO = ET_CTR_ZERO, CTR_PRD = ET_CTR_PRD }
 

interrupt generation

More...
enum  ePWMSOC { SOCNULL = 0, SOCA = 1, SOCB = 2 }
 

start of conversion

More...
enum  SOCTrigger {
  EvTBeqZERO = 1, EvTBeqPRD = 2, EvTBCNTeqCMPAI = 4, EvTBCNTeqCMPAD = 5,
  EvTBCNTeqCMPBI = 6, EvTBCNTeqCMPBD = 7
}
 

triggers

More...
enum  sideEnum { TOP = 0, BOTTOM = 6 }
 

select top or bottom switch (A --> TOP, B --> BOTTOM)

More...
enum  SWITCHLOGIC { NEG_LOGIC = 1, POS_LOGIC = 2 }
 

select switch logic

More...

Functions

void BindPWMOutputs (void)
void InitPWMPeripheralClocks (void)
 Init clocks on PWM inputs EPWMA/B depending on the configuration stored in pwmConf.epwmX.
void InitPWMAPeripheralClocks (void)
 Init clocks on PWM inputs EPWMA.
void InitPWMBPeripheralClocks (void)
 Init clocks on PWM inputs EPWMB.
void InitEPWMGpio (ePWMenum PWM)
void InitTzGpio (void)
void InitSinglePWMOutput (void(*interruptFCN)(void), ePWMenum PWM, Uint16 tpwm_us, PWMMODE pwmMode, PWMCARRIER pwmCarrier, PWMMODULATION modulation, INTSEL intSel, SWITCHLOGIC switchLogic)
void InitComplementaryPWMOutput (void(*interruptFCN)(void), ePWMenum PWM, Uint16 tpwm_us, Uint16 db_us, PWMMODE pwmMode, PWMCARRIER pwmCarrier, PWMMODULATION modulation, INTSEL intSel, SWITCHLOGIC switchLogic)
void Init3phPWM (void(*interruptFCN)(void), EPWMX epwmX, Uint16 tpwm_us, Uint16 db_us, PWMCARRIER pwmCarrier, PWMMODULATION modulation, INTSEL intSel, _iq vBus, ePWMSOC soc, SWITCHLOGIC switchLogic)
void ConfigurePWMLeg (volatile struct EPWM_REGS *pwmPtr, PHSEN master, Uint16 tpwm_us, Uint16 db_us, PWMCARRIER pwmCarrier, PWMMODULATION modulation, unsigned int polSel)
void AddEventTrigger (volatile struct EPWM_REGS *pwmPtr, ePWMSOC soc, SOCTrigger trigger)
static void SetEnablePWMInput (Uint16 *input)
static void UpdateEPWM (ePWMenum PWM, sideEnum side, _iq cmp)
static void UpdateEPWMDuty (ePWMenum PWM, sideEnum side, _iq duty)
static void UpdateHRPWM (ePWMenum PWM, _iq cmp)
static void UpdatePWM3ph (_iq vas, _iq vbs, _iq vcs, char saturate)
static void UpdatePWMA3ph (_iq vas, _iq vbs, _iq vcs, char saturate)
static void UpdatePWMB3ph (_iq vas, _iq vbs, _iq vcs, char saturate)
static void UpdatePWMDuty3ph (_iq vad, _iq vbd, _iq vcd)
static void UpdatePWMADuty3ph (_iq vad, _iq vbd, _iq vcd)
static void UpdatePWMBDuty3ph (_iq vad, _iq vbd, _iq vcd)
static void ForceSingleEPWM (ePWMenum PWM, sideEnum side, Uint16 level)
 Force EPWM values (spru791a.pdf, pp. 100).
static void _ForceSingleEPWM (volatile struct EPWM_REGS *pwmPtr, sideEnum side, Uint16 level)
static void ForceEPWM (ePWMenum PWM, sideEnum side, Uint16 level)
static void EnablePWM (Uint16 enable)
static void EnableEPWMModuleTBCLK (void)
 Enable device clock.
static void EpwmPIEAck (volatile struct EPWM_REGS *epwmRegs)
static void EpwmAPIEAck (void)
static void EpwmBPIEAck (void)

Variables

struct PWM3phConfiguration pwmConf
struct PWM3phConfiguration pwmAConf pwmBConf
struct EPWM_REGS * ePWM []
 acess pointers to pwm configuration registers
volatile Uint16 * cmpPtr [PWM_OUTPUTS_SIZE]
 fast access to EPWM comparison registers
int MEP_ScaleFactor [PWM_CH]
int MEP_SF1
int MEP_SF2
int MEP_SF3
int MEP_SF4
int MEP_SF5
int MEP_SF6

Detailed Description

PWM Interface Routines.

File Name : Epwm.h Project : TIMotorLIB

TI Doc: SPRU791, SPRUG04 (newer), spraai1

Author:
Pablo Garcia (pgarcia@isa.uniovi.es)
Date:
2007

Definition in file Epwm.h.


Define Documentation

#define EPWM1_INT_ACK   (0x1);

Definition at line 52 of file Epwm.h.

#define EPWM2_INT_ACK   (0x2);

Definition at line 53 of file Epwm.h.

#define EPWM3_INT_ACK   (0x4);

Definition at line 54 of file Epwm.h.

#define EPWM4_INT_ACK   (0x8);

Definition at line 55 of file Epwm.h.

#define EPWM5_INT_ACK   (0x10);

Definition at line 56 of file Epwm.h.

#define EPWM6_INT_ACK   (0x20);

Definition at line 57 of file Epwm.h.

#define PWM_OUTPUTS_SIZE   (12)

number of pwm outputs

Definition at line 60 of file Epwm.h.


Enumeration Type Documentation

enum ePWMenum

access to pwm devices individually

Enumerator:
PWM1 

EPWM1A/1B.

PWM2 

EPWM2A/2B.

PWM3 

EPWM3A/3B.

PWM4 

EPWM4A/4B.

PWM5 

EPWM5A/5B.

PWM6 

EPWM6A/6B.

Definition at line 79 of file Epwm.h.

enum ePWMSOC

start of conversion

Enumerator:
SOCNULL 

A/D start of conversion decoupled from EPWM.

SOCA 

EPWM generates SOC for sequencer A.

SOCB 

EPWM generates SOC for sequencer B.

Definition at line 113 of file Epwm.h.

enum EPWMX

select EPWM device

Enumerator:
EPWMA 

EPWMA.

EPWMB 

EPWMB.

Definition at line 67 of file Epwm.h.

enum INTSEL

interrupt generation

Enumerator:
CTR_ZERO 

interrupt on counter reach zero

CTR_PRD 

interrupt on counter reach period

Definition at line 107 of file Epwm.h.

enum PHSEN

select device as master or slave

Enumerator:
MASTERPWM 

EPWM is master.

SLAVEPWM 

EPWM is slave.

Definition at line 73 of file Epwm.h.

enum PWMCARRIER

select carrier signal (sawtooth or triangle)

Enumerator:
SAWTOOTH 

sawtooth carrier

TRIANGLE 

triangle carrier

Definition at line 95 of file Epwm.h.

enum PWMMODE

select normal mode or high resolution mode

Enumerator:
NORMAL_MODE 

normal mode

HRPWM_MODE 

high resolution mode

Definition at line 89 of file Epwm.h.

select modulation (symmetrical, asymmetrical) for triangle pwm carrier

Enumerator:
SYMMETRICAL 

symmetrical modulation

ASYMMETRICAL 

asymmetrical modulation (update on zero and period)

Definition at line 101 of file Epwm.h.

enum sideEnum

select top or bottom switch (A --> TOP, B --> BOTTOM)

Enumerator:
TOP 

TOP switches.

BOTTOM 

BOTTOM switches.

Definition at line 130 of file Epwm.h.

enum SOCTrigger

triggers

Enumerator:
EvTBeqZERO 

trigger A/D on zero

EvTBeqPRD 

trigger A/D of period

EvTBCNTeqCMPAI 

trigger A/D on compare math EPWMA (increasing)

EvTBCNTeqCMPAD 

trigger A/D on compare math EPWMA (decreasing)

EvTBCNTeqCMPBI 

trigger A/D on compare math EPWMB (increasing)

EvTBCNTeqCMPBD 

trigger A/D on compare math EPWMB (decreasing)

Definition at line 120 of file Epwm.h.

select switch logic

Enumerator:
NEG_LOGIC 
POS_LOGIC 

Definition at line 136 of file Epwm.h.


Function Documentation

static void _ForceSingleEPWM ( volatile struct EPWM_REGS *  pwmPtr,
sideEnum  side,
Uint16  level 
) [inline, static]

Force Single PWM output to a given level

Parameters:
pwmPtr Pointer to the EPWM_REGS register which output wants to be forced.
side selection of TOP/BOTTOM output
level 0 --> low, 1 --> high

Definition at line 541 of file Epwm.h.

void AddEventTrigger ( volatile struct EPWM_REGS *  pwmPtr,
ePWMSOC  soc,
SOCTrigger  trigger 
)

Selects where the Start of Conversion (SOC) signal is generated

Parameters:
pwmPtr,: Pointer to EPWM_REGS register for the configuration
soc,: Which sequencer is triggered (SOCNULL/SOCA/SOCB)
trigger,: 
  • EvTBeqZERO trigger A/D on zero
  • EvTBeqPRD trigger A/D of period
  • EvTBCNTeqCMPAI trigger A/D on compare math EPWMA (increasing)
  • EvTBCNTeqCMPAD trigger A/D on compare math EPWMA (decreasing)
  • EvTBCNTeqCMPBI trigger A/D on compare math EPWMB (increasing)
  • EvTBCNTeqCMPBD trigger A/D on compare math EPWMB (decreasing)

Definition at line 378 of file Epwm.c.

void BindPWMOutputs ( void   ) 

Definition at line 69 of file Epwm.c.

void ConfigurePWMLeg ( volatile struct EPWM_REGS *  pwmPtr,
PHSEN  master,
Uint16  tpwm_us,
Uint16  db_us,
PWMCARRIER  pwmCarrier,
PWMMODULATION  modulation,
unsigned int  polSel 
)

Configure two switches to work in complementary mode

Parameters:
pwmPtr,: Pointer to EPWM_REGS register for the configuration of the switches pair
master,: MASTERPWM/SLAVEPWM. Selects if the clocking signal is generated by the configured output or is passed externally.
tpwm_us,: switching period in us
db_us,: dead time value in us
pwmCarrier,: select SAWTOOTH or TRIANGLE carrier
modulation,: SYMMETRICAL/ASYMMETRICAL. If symmetrical, comparison values are updated when the counter reaches 0. If asymmetrical, comparison values are updated both at 0 and period of the counter
polSel,: Polarity selection for dead time generation (DB_ACTIVE_LOC/DB_ACTIVE_HIC)

Definition at line 332 of file Epwm.c.

static void EnableEPWMModuleTBCLK ( void   )  [inline, static]
static void EnablePWM ( Uint16  enable  )  [inline, static]
Deprecated:
: Not used anymore

Definition at line 577 of file Epwm.h.

static void EpwmAPIEAck ( void   )  [inline, static]

ACK interrupt for EPWMA. This function MUST be called if more interrupts from PIEACK_GROUP3 are wanted

Examples:
TIMotorLIBExampleHrdw/main.c, and TIMotorLIBExampleSw/main.c.

Definition at line 617 of file Epwm.h.

static void EpwmBPIEAck ( void   )  [inline, static]

ACK interrupt for EPWMB. This function MUST be called if more interrupts from PIEACK_GROUP3 are wanted

Examples:
TIMotorLIBExampleHrdw/main.c, and TIMotorLIBExampleSw/main.c.

Definition at line 628 of file Epwm.h.

static void EpwmPIEAck ( volatile struct EPWM_REGS *  epwmRegs  )  [inline, static]

ACK interrupt for epwmRegs. This function MUST be called if more interrupts from PIEACK_GROUP3 are wanted

Parameters:
epwmRegs pointer to EPWM_REGS register which interrupt is ACK

Definition at line 603 of file Epwm.h.

static void ForceEPWM ( ePWMenum  PWM,
sideEnum  side,
Uint16  level 
) [inline, static]

Force Single PWM output to a given level

Parameters:
PWM output selection by identifier (PWM1..PWM6)
side selection of TOP/BOTTOM output
level 0 --> low, 1 --> high

Definition at line 563 of file Epwm.h.

static void ForceSingleEPWM ( ePWMenum  PWM,
sideEnum  side,
Uint16  level 
) [inline, static]

Force EPWM values (spru791a.pdf, pp. 100).

Definition at line 528 of file Epwm.h.

void Init3phPWM ( void(*)(void)  interruptFCN,
EPWMX  epwmX,
Uint16  tpwm_us,
Uint16  db_us,
PWMCARRIER  pwmCarrier,
PWMMODULATION  modulation,
INTSEL  intSel,
_iq  vBus,
ePWMSOC  soc,
SWITCHLOGIC  switchLogic 
)

Intializes a set of EPWM outputs to drive a three phase inverter

Parameters:
interruptFCN,: pointer to ISR executed when intSel condition is reached. If 0, no function is called
epwmX,: Selection of PWM input to be configured (PWM1...PWM6)
tpwm_us,: switching period in us
db_us,: dead time value in us
pwmCarrier,: select SAWTOOTH or TRIANGLE carrier
modulation,: SYMMETRICAL/ASYMMETRICAL. If symmetrical, comparison values are updated when the counter reaches 0. If asymmetrical, comparison values are updated both at 0 and period of the counter
intSel,: CTR_ZERO/CTR_PRD. Call the ISR when the counter reach 0 or when the counter reach the period.
vBus,: DC bus voltage in V (
Todo:
: Eliminate this parameter)
Parameters:
soc,: SOCNULL/SOCA/SOCB. Generates a start of conversion trigger for none, A or B sequencer respectively
switchLogic,: POS_LOGIC/NEG_LOGIC. Select logic for the switches

Definition at line 247 of file Epwm.c.

void InitComplementaryPWMOutput ( void(*)(void)  interruptFCN,
ePWMenum  PWM,
Uint16  tpwm_us,
Uint16  db_us,
PWMMODE  pwmMode,
PWMCARRIER  pwmCarrier,
PWMMODULATION  modulation,
INTSEL  intSel,
SWITCHLOGIC  switchLogic 
)

Intializes a given EPWM pair in complementary mode

Parameters:
interruptFCN,: pointer to ISR executed when intSel condition is reached. If 0, no function is called
PWM,: Selection of PWM input to be configured (PWM1...PWM6)
tpwm_us,: switching period in us
db_us,: dead time value in us
pwmMode,: normal mode (16 bits) or high resolution (
Todo:
) (32 bits)
Parameters:
pwmCarrier,: select SAWTOOTH or TRIANGLE carrier
modulation,: SYMMETRICAL/ASYMMETRICAL. If symmetrical, comparison values are updated when the counter reachs 0. If asymmetrical, comparison values are updated both at 0 and period of the counter
intSel,: CTR_ZERO/CTR_PRD. Call the ISR when the counter reach 0 or when the counter reach the period.
switchLogic,: POS_LOGIC/NEG_LOGIC. Select logic for the switches

Definition at line 201 of file Epwm.c.

void InitEPWMGpio ( ePWMenum  PWM  ) 

Configure needed GPIO ports to be used by EPWM outputs. Affected GPIO inputs are: EPWM1: GPIO0, GPIO1 EPWM2: GPIO2, GPIO3 EPWM3: GPIO4, GPIO5 EPWM4: GPIO6, GPIO7 EPWM5: GPIO8, GPIO9 EPWM6: GPIO10, GPIO11 Actions taken:

  • Enable internal pull-up (GpioCtrlRegs.GPAPUD.bit.GPIOX=0)
  • Configure GPIOX as EPWM (GpioCtrlRegs.GPAMUX1.bit.GPIOX=1)
    Parameters:
    PWM is the pwm input to be used

Definition at line 444 of file Epwm.c.

void InitPWMAPeripheralClocks ( void   ) 

Init clocks on PWM inputs EPWMA.

Definition at line 416 of file Epwm.c.

void InitPWMBPeripheralClocks ( void   ) 

Init clocks on PWM inputs EPWMB.

Definition at line 430 of file Epwm.c.

void InitPWMPeripheralClocks ( void   ) 

Init clocks on PWM inputs EPWMA/B depending on the configuration stored in pwmConf.epwmX.

Definition at line 395 of file Epwm.c.

void InitSinglePWMOutput ( void(*)(void)  interruptFCN,
ePWMenum  PWM,
Uint16  tpwm_us,
PWMMODE  pwmMode,
PWMCARRIER  pwmCarrier,
PWMMODULATION  modulation,
INTSEL  intSel,
SWITCHLOGIC  switchLogic 
)

Initializes a given EPWM

Parameters:
interruptFCN,: pointer to ISR executed when intSel condition is reached. If 0, no function is called
PWM,: Selection of PWM input to be configured (PWM1...PWM6)
tpwm_us,: switching period in us
pwmMode,: normal mode (16 bits) or high resolution (
Todo:
) (32 bits)
Parameters:
pwmCarrier,: select SAWTOOTH or TRIANGLE carrier
modulation,: SYMMETRICAL/ASYMMETRICAL. If symmetrical, comparison values are updated when the counter reaches 0. If asymmetrical, comparison values are updated both at 0 and period of the counter
intSel,: CTR_ZERO/CTR_PRD. Call the ISR when the counter reach 0 or when the counter reach the period.
switchLogic,: POS_LOGIC/NEG_LOGIC. Select logic for the drived switch

Definition at line 122 of file Epwm.c.

void InitTzGpio ( void   ) 

Configure needed GPIO ports to be used by EPWM Trip-zone submodule. Affected GPIO inputs are: TZ1: GPIO12 TZ2: GPIO13 TZ3: GPIO14 TZ4: GPIO15 TZ5: GPIO16 TZ6: GPIO17 Actions taken:

  • Enable internal pull-up (GpioCtrlRegs.GPAPUD.bit.GPIOX=0)
  • Asynch input GPIOX (GpioCtrlRegs.GPAQSEL1.bit.GPIOX = 3)
  • Configure GPIOX as TZX (GpioCtrlRegs.GPAMUXn.bit.GPIOX = 1)

Definition at line 479 of file Epwm.c.

static void SetEnablePWMInput ( Uint16 *  input  )  [inline, static]

Definition at line 346 of file Epwm.h.

static void UpdateEPWM ( ePWMenum  PWM,
sideEnum  side,
_iq  cmp 
) [inline, static]

Definition at line 353 of file Epwm.h.

static void UpdateEPWMDuty ( ePWMenum  PWM,
sideEnum  side,
_iq  duty 
) [inline, static]

Definition at line 360 of file Epwm.h.

static void UpdateHRPWM ( ePWMenum  PWM,
_iq  cmp 
) [inline, static]

Definition at line 367 of file Epwm.h.

static void UpdatePWM3ph ( _iq  vas,
_iq  vbs,
_iq  vcs,
char  saturate 
) [inline, static]
Deprecated:
: Not use UpdatePWM3ph in new projects. Instead, UpdatePWMA3ph or UpdatePWMB3ph
Deprecated:
: Use UpdatePWMA3ph or UpdatePWMB3ph instead.

Todo:
These operation need to be changed if 2*OFFSETPWM > MAX IQ (4096)

(pwmConf.cmp1) = (Uint16)(_IQtoF(_IQmpy(vas,pwmConf.OFFSETPWMDIVVBUS))+pwmConf.OFFSETPWM); (pwmConf.cmp2) = (Uint16)(_IQtoF(_IQmpy(vbs,pwmConf.OFFSETPWMDIVVBUS))+pwmConf.OFFSETPWM); (pwmConf.cmp3) = (Uint16)(_IQtoF(_IQmpy(vcs,pwmConf.OFFSETPWMDIVVBUS))+pwmConf.OFFSETPWM);

(pwmConf.cmp1) = (Uint16)(pwmConf.OFFSETPWM - _IQtoF(_IQmpy(vas,pwmConf.OFFSETPWMDIVVBUS))); (pwmConf.cmp2) = (Uint16)(pwmConf.OFFSETPWM - _IQtoF(_IQmpy(vbs,pwmConf.OFFSETPWMDIVVBUS))); (pwmConf.cmp3) = (Uint16)(pwmConf.OFFSETPWM - _IQtoF(_IQmpy(vcs,pwmConf.OFFSETPWMDIVVBUS)));

Examples:
TIMotorLIBExample2/main.c, and TIMotorLIBExample3/main.c.

Definition at line 378 of file Epwm.h.

static void UpdatePWMA3ph ( _iq  vas,
_iq  vbs,
_iq  vcs,
char  saturate 
) [inline, static]

Update EPWMA configured for three phase systems

Parameters:
vas voltage for phase a
vbs voltage for phase b
vcs voltage for phase c
saturate saturate to Vbus/2

Todo:
: Saturate using IQsat functions

(pwmAConf.cmp1) = (Uint16)(pwmAConf.OFFSETPWM - _IQtoF(_IQmpy(vas,pwmAConf.OFFSETPWMDIVVBUS))); (pwmAConf.cmp2) = (Uint16)(pwmAConf.OFFSETPWM - _IQtoF(_IQmpy(vbs,pwmAConf.OFFSETPWMDIVVBUS))); (pwmAConf.cmp3) = (Uint16)(pwmAConf.OFFSETPWM - _IQtoF(_IQmpy(vcs,pwmAConf.OFFSETPWMDIVVBUS)));

Definition at line 413 of file Epwm.h.

static void UpdatePWMADuty3ph ( _iq  vad,
_iq  vbd,
_iq  vcd 
) [inline, static]

update EPWMA duty for three phase configuration: cmpX = 2*OFFSETPWM(1 - vXd) vXd = [0,1]

Parameters:
vad duty for phase a
vbd duty for phase b
vcd duty for phase c

(pwmAConf.cmp1) = (Uint16)((pwmAConf.OFFSETPWM << 1) - _IQ16toF(_IQ16mpy(_IQtoIQ16(vad),(_IQ16(pwmAConf.OFFSETPWM << 1))))); (pwmAConf.cmp2) = (Uint16)((pwmAConf.OFFSETPWM << 1) - _IQ16toF(_IQ16mpy(_IQtoIQ16(vbd),(_IQ16(pwmAConf.OFFSETPWM << 1))))); (pwmAConf.cmp3) = (Uint16)((pwmAConf.OFFSETPWM << 1) - _IQ16toF(_IQ16mpy(_IQtoIQ16(vcd),(_IQ16(pwmAConf.OFFSETPWM << 1)))));

Examples:
TIMotorLIBExampleHrdw/main.c, and TIMotorLIBExampleSw/main.c.

Definition at line 484 of file Epwm.h.

static void UpdatePWMB3ph ( _iq  vas,
_iq  vbs,
_iq  vcs,
char  saturate 
) [inline, static]

Update EPWMB configured for three phase systems

Parameters:
vas voltage for phase a
vbs voltage for phase b
vcs voltage for phase c
saturate saturate to Vbus/2

Todo:
: Saturate using IQsat functions

(pwmBConf.cmp1) = (Uint16)(pwmBConf.OFFSETPWM - _IQtoF(_IQmpy(vas,pwmBConf.OFFSETPWMDIVVBUS))); (pwmBConf.cmp2) = (Uint16)(pwmBConf.OFFSETPWM - _IQtoF(_IQmpy(vbs,pwmBConf.OFFSETPWMDIVVBUS))); (pwmBConf.cmp3) = (Uint16)(pwmBConf.OFFSETPWM - _IQtoF(_IQmpy(vcs,pwmBConf.OFFSETPWMDIVVBUS)));

Definition at line 438 of file Epwm.h.

static void UpdatePWMBDuty3ph ( _iq  vad,
_iq  vbd,
_iq  vcd 
) [inline, static]

update EPWMB duty for three phase configuration: cmpX = 2*OFFSETPWM(1 - vXd) vXd = [0,1]

Parameters:
vad duty for phase a
vbd duty for phase b
vcd duty for phase c
Examples:
TIMotorLIBExampleHrdw/main.c, and TIMotorLIBExampleSw/main.c.

Definition at line 508 of file Epwm.h.

static void UpdatePWMDuty3ph ( _iq  vad,
_iq  vbd,
_iq  vcd 
) [inline, static]
Deprecated:
: Not use UpdatePWMDuty3ph in new projects. Instead, UpdatePWMADuty3ph or UpdatePWMBDuty3ph
Deprecated:
: Use UpdatePWMADuty3ph or UpdatePWMBDuty3ph instead.

Definition at line 459 of file Epwm.h.


Variable Documentation

volatile Uint16* cmpPtr[PWM_OUTPUTS_SIZE]

fast access to EPWM comparison registers

Definition at line 35 of file Epwm.c.

struct EPWM_REGS* ePWM[]

acess pointers to pwm configuration registers

Definition at line 33 of file Epwm.c.

int MEP_ScaleFactor[PWM_CH]

Definition at line 36 of file Epwm.c.

int MEP_SF1

Definition at line 37 of file Epwm.c.

int MEP_SF2

Definition at line 37 of file Epwm.c.

int MEP_SF3

Definition at line 37 of file Epwm.c.

int MEP_SF4

Definition at line 37 of file Epwm.c.

int MEP_SF5

Definition at line 37 of file Epwm.c.

int MEP_SF6

Definition at line 37 of file Epwm.c.

Definition at line 31 of file Epwm.c.

Deprecated:
: Not use pwmConf in new projects. Instead, pwmAConf or pwmBConf

Definition at line 29 of file Epwm.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Generated on Sat Apr 16 11:42:44 2011 for TIMotorLIB by  doxygen 1.6.3