Predefined Globals and Constants
To facilitate PIC32 programming, the mikroBasic PRO for PIC32 implements a number of predefined globals and constants.
All PIC32 SFRs are implicitly declared as global variables of volatile word. These identifiers have an external linkage, and are visible in the entire project. When creating a project, the mikroBasic PRO for PIC32 will include an appropriate (*.mbas) file from defs folder, containing declarations of available SFRs and constants (such as PORTB, ADPCFG, etc). All identifiers are in upper case, identical to nomenclature in the Microchip datasheets.
For a complete set of predefined globals and constants, look for “Defs” in the mikroBasic PRO for PIC32 installation folder, or probe the Code Assistant for specific letters (Ctrl+Space in the Code Editor).
Predefined project level defines
mikroBasic PRO for PIC32 provides predefined project level defines that you can use in your project, for example :
' MCU name : #IFDEF P32MX460F512L ... #ENDIF ' Family name : #IFDEF PIC32 ... #ENDIF ' Subfamily name (P32MX3, P32MX4, P32MX5, P32MX6, P32MX7) : #IFDEF P32MX4 ... #ENDIF ' ICD build type : #IFDEF MIKRO_ICD ... #ENDIF
What do you think about this topic ? Send us feedback!