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.

__MSP430_HAS_EUSCI_Ax__ not defined for MSP430F6779A when including "msp430.h" and "msp430xgeneric.h" ?

Other Parts Discussed in Thread: MSP430FR5728, MSP430F6779A

We're using the MSP430F6779A and MSP430FR5728 processors and developing with IAR 6.20.1 and have a question about including generic register definitions provided by TI. Are "msp430.h" and "msp430xgeneric.h" the only standard TI-provided files that we need to include at the top of our C files to gain access to all of the necessary processor register definitions like "OFS_UCAxIE"?  With that strategy, it appears that "__MSP430_HAS_EUSCI_Ax__" isn't defined and therefore "OFS_UCAxIE" isn't available.  Whereas we discovered that "msp430f5xx6xxgeneric.h" does define "__MSP430_HAS_EUSCI_Ax__" based on the definition of the specific ports like "__MSP430_HAS_EUSCI_A0__" in "msp430f6779a.h" which seems appropriate.

Questions:

  • Why doesn't "msp430xgeneric.h" include a line like
#if defined(__MSP430_HAS_USCI_A0__) || defined(__MSP430_HAS_USCI_A1__) || defined(__MSP430_HAS_USCI_A2__) || defined(__MSP430_HAS_USCI_A3__)
  #define __MSP430_HAS_USCI_Ax__
#endif
  • Who includes "msp430f5xx6xxgeneric.h"?  It seems a little too processor family-specific, but in our code we could determine which processor family and directly include "msp430f5xx6xxgeneric.h" or "msp430fr5xx6xxgeneric.h" instead of "msp430xgeneric.h", which appears to work.

Further info:

  • In our IAR project settings, we have selected the appropriate processor MSP430F6779A, so "__MSP430F6779A__" is defined.
  • It is already clear to use that "msp430.h" uses the compiler processor-specific flag __MSP430F6779A__ to include a header file for that processor which defines all of the available ports and features of that specific processor.  Then the "msp430xgeneric.h" uses those compiler directives to know which of its library of interfaces to include.

  • Our current solution is to manually include the "msp430f5xx_6xxgeneric.h" file so that it concatenates the individual _HAS_ directives into single joined directives.

    #include "msp430.h"                     // Select which processor-specific include file to use.
    #include "msp430f5xx_6xxgeneric.h"      // Necessary to created combined identifiers like "__MSP430_HAS_EUSCI_Ax__" and "__MSP430_HAS_TxA7__".
    #include "msp430fr5xx_6xxgeneric.h"     // Necessary to created combined identifiers like "__MSP430_HAS_EUSCI_Ax__" and "__MSP430_HAS_TxA7__".
    #include "msp430xgeneric.h"

**Attention** This is a public forum