This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Recognizing Registers

Other Parts Discussed in Thread: CONTROLSUITE

Hi,

I am gonna ask a silly question here. How does the compiler recognize a data-structure as a register?

For example, in the header file ----" DSP2803x_EPwm.h" of the ePWM sample project from ControlSUITE

at the very bottom,it defines EPWM_REGS including all its member registers.

 

struct EPWM_REGS {
   union  TBCTL_REG           TBCTL;       // Time Base Control Register
   union  TBSTS_REG           TBSTS;       // Time Base Status Register
   union  TBPHS_HRPWM_GROUP   TBPHS;       // Union of TBPHS:TBPHSHR
   Uint16                     TBCTR;       // Time Base Counter

  ........

}

//----------------------------------------------------------------------------------------
// External References & Function Declarations:
//
extern volatile struct EPWM_REGS EPwm1Regs;
extern volatile struct EPWM_REGS EPwm2Regs;
extern volatile struct EPWM_REGS EPwm3Regs;

 

I know the keyword ' extern' tells the compiler not to complain and ask the linker to find it, but how does it know, for instance, the member 'TBCTR' is a register variable?

 

Thanks,

 

Frank