This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SPI_Master_Example .. Where is SPI_MASTER_0_ENABLE defined?

I went to so many references and definitions of variables and functions but I can't seem to find where is decided to use either spi_master_0 or 1.. where is this magic config file mentioned here:

  • This example uses only one instance of the SPI master.
  • Please make sure that only one instance of the SPI master is enabled in config file.

or what exactly does this do:

#if defined(SPI_MASTER_0_ENABLE)
    #define SPI_MASTER_HW SPI_MASTER_0
#elif defined(SPI_MASTER_1_ENABLE)
    #define SPI_MASTER_HW SPI_MASTER_1
#else
    #error "No SPI enabled"
#endif

It defines SPI_MASTER_HW SPI_MASTER_0 when SPI_MASTER_0_ENABLE is defined? But where is SPI_MASTER_0_ENABLE defined??? I can't seem to find it nowhere.

Parents
  • err it's a define - it's defined in the project as .. a define, or if you're using a makefile, in the makefile as a define. In the armgcc example it's in the Makefile (although that defines both of them, incorrectly). In the arm projects it's in the uvproj file, again doubly defined and in iar it's in the ewp file which I guess is what IAR calls its project files .. and again both of them are defined.

Reply
  • err it's a define - it's defined in the project as .. a define, or if you're using a makefile, in the makefile as a define. In the armgcc example it's in the Makefile (although that defines both of them, incorrectly). In the arm projects it's in the uvproj file, again doubly defined and in iar it's in the ewp file which I guess is what IAR calls its project files .. and again both of them are defined.

Children
No Data
Related