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.